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 b9f232e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 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,14 @@ 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("/.")
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

0 comments on commit b9f232e

Please sign in to comment.