Skip to content

Commit

Permalink
rubocop: fix methods naming and indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ayastreb committed Jul 15, 2016
1 parent 695b539 commit 3e3c0fc
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions lib/jekyll/collection.rb
Expand Up @@ -57,9 +57,9 @@ def read
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!
Expand Down Expand Up @@ -197,8 +197,8 @@ def extract_metadata
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
Expand All @@ -208,11 +208,16 @@ def read_docs(full_path)
end

private
def read_files(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)
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
)
end
end
end

0 comments on commit 3e3c0fc

Please sign in to comment.