Reformat codebase

This commit is contained in:
Gabriel Arazas 2023-03-07 00:35:19 +08:00
parent 0020083349
commit 2a69a330df
2 changed files with 9 additions and 8 deletions

View File

@ -1,2 +1,3 @@
# frozen_string_literal: true
require 'asciidoctor/foodogsquared-extensions'

View File

@ -46,14 +46,14 @@ class GitHubRawIncludeProcessor < Asciidoctor::Extensions::IncludeProcessor
# If the response is an array, it is likely to be a directory. In this
# usecase, we'll just list them.
content = if response.kind_of? Array
warning = %(given path '#{path}' from GitHub repo '#{repo}' is a directory)
warn_or_raise doc, warning
warning
elsif response.kind_of? Object
if response['content'] && response['encoding'] == 'base64'
Base64.decode64 response['content']
end
end
warning = %(given path '#{path}' from GitHub repo '#{repo}' is a directory)
warn_or_raise doc, warning
warning
elsif response.kind_of? Object
if response['content'] && response['encoding'] == 'base64'
Base64.decode64 response['content']
end
end
reader.push_include content, target, target, 1, attrs
end