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)
next if File.directory?(full_path)
if Utils.has_yaml_header? full_path
read_docs(full_path)
read_document(full_path)
else
read_files(file_path, full_path)
read_static_file(file_path, full_path)
end
end
docs.sort!
@ -197,8 +197,8 @@ module Jekyll
end
private
def read_docs(full_path)
doc = Jekyll::Document.new(full_path, { :site => site, :collection => self })
def read_document(full_path)
doc = Jekyll::Document.new(full_path, :site => site, :collection => self)
doc.read
if site.publisher.publish?(doc) || !write?
docs << doc
@ -208,11 +208,14 @@ module Jekyll
end
private
def read_files(file_path, full_path)
relative_dir = Jekyll.sanitized_path(relative_directory,
File.dirname(file_path)).chomp("/.")
def read_static_file(file_path, full_path)
relative_dir = Jekyll.sanitized_path(
relative_directory,
File.dirname(file_path)
).chomp("/.")
files << StaticFile.new(site, site.source, relative_dir,
File.basename(full_path), self)
File.basename(full_path), self)
end
end
end