rubocop: fix methods naming and indentation
This commit is contained in:
parent
695b5396fd
commit
b9f232e5bf
|
@ -57,9 +57,9 @@ module Jekyll
|
||||||
full_path = collection_dir(file_path)
|
full_path = collection_dir(file_path)
|
||||||
next if File.directory?(full_path)
|
next if File.directory?(full_path)
|
||||||
if Utils.has_yaml_header? full_path
|
if Utils.has_yaml_header? full_path
|
||||||
read_docs(full_path)
|
read_document(full_path)
|
||||||
else
|
else
|
||||||
read_files(file_path, full_path)
|
read_static_file(file_path, full_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
docs.sort!
|
docs.sort!
|
||||||
|
@ -197,8 +197,8 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def read_docs(full_path)
|
def read_document(full_path)
|
||||||
doc = Jekyll::Document.new(full_path, { :site => site, :collection => self })
|
doc = Jekyll::Document.new(full_path, :site => site, :collection => self)
|
||||||
doc.read
|
doc.read
|
||||||
if site.publisher.publish?(doc) || !write?
|
if site.publisher.publish?(doc) || !write?
|
||||||
docs << doc
|
docs << doc
|
||||||
|
@ -208,9 +208,12 @@ module Jekyll
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def read_files(file_path, full_path)
|
def read_static_file(file_path, full_path)
|
||||||
relative_dir = Jekyll.sanitized_path(relative_directory,
|
relative_dir = Jekyll.sanitized_path(
|
||||||
File.dirname(file_path)).chomp("/.")
|
relative_directory,
|
||||||
|
File.dirname(file_path)
|
||||||
|
).chomp("/.")
|
||||||
|
|
||||||
files << StaticFile.new(site, site.source, relative_dir,
|
files << StaticFile.new(site, site.source, relative_dir,
|
||||||
File.basename(full_path), self)
|
File.basename(full_path), self)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue