rubocop: fix methods naming and indentation

This commit is contained in:
Anatoliy Yastreb 2016-07-15 10:56:29 +03:00
parent 695b5396fd
commit b9f232e5bf
1 changed files with 11 additions and 8 deletions

View File

@ -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,11 +208,14 @@ 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
end end
end end