rubocop: lib/jekyll/collection.rb #5022

Merged
merged 2 commits into from Jul 16, 2016

Conversation

Projects
None yet
4 participants
@ayastreb
Contributor

ayastreb commented Jun 17, 2016

#4885

@parkr parkr referenced this pull request Jun 21, 2016

Closed

Make jekyll/jekyll code compliant with rubocop rules #4885

114 of 115 tasks complete

@parkr parkr added the refactor label Jun 21, 2016

@ayastreb

This comment has been minimized.

Show comment
Hide comment
@ayastreb

ayastreb Jul 14, 2016

Contributor

@parkr any thoughts about this PR? 😄

Contributor

ayastreb commented Jul 14, 2016

@parkr any thoughts about this PR? 😄

lib/jekyll/collection.rb
- else
- Jekyll.logger.debug "Skipped From Publishing:", doc.relative_path
- end
+ read_docs(full_path)

This comment has been minimized.

@parkr

parkr Jul 15, 2016

Member

In this case, you're just reading one document. Thus, this should be singular: read_document(full_path).

@parkr

parkr Jul 15, 2016

Member

In this case, you're just reading one document. Thus, this should be singular: read_document(full_path).

lib/jekyll/collection.rb
- File.dirname(file_path)).chomp("/.")
- files << StaticFile.new(site, site.source, relative_dir,
- File.basename(full_path), self)
+ read_files(file_path, full_path)

This comment has been minimized.

@parkr

parkr Jul 15, 2016

Member

Same here – singular: read_static_file(file_path, full_path).

@parkr

parkr Jul 15, 2016

Member

Same here – singular: read_static_file(file_path, full_path).

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jul 15, 2016

Member

Two naming nits. Otherwise, LGTM.

Member

parkr commented Jul 15, 2016

Two naming nits. Otherwise, LGTM.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jul 15, 2016

Member

@jekyll/core, could one of you take a look at this and give it a LGTM?

Member

parkr commented Jul 15, 2016

@jekyll/core, could one of you take a look at this and give it a LGTM?

lib/jekyll/collection.rb
+
+ private
+ def read_docs(full_path)
+ doc = Jekyll::Document.new(full_path, { :site => site, :collection => self })

This comment has been minimized.

@envygeeks

envygeeks Jul 15, 2016

Contributor
doc = Document.new(full_path, {
  :site => site, :collection => self
})

doc.read
if site.publisher.publish?(doc) || !write?
@envygeeks

envygeeks Jul 15, 2016

Contributor
doc = Document.new(full_path, {
  :site => site, :collection => self
})

doc.read
if site.publisher.publish?(doc) || !write?

This comment has been minimized.

@parkr

parkr Jul 15, 2016

Member

You don't like the 1-line solution there? I think it reads nicely. We could even remove the curly braces:

doc = Document.new(full_path, :site => site, :collection => self)
@parkr

parkr Jul 15, 2016

Member

You don't like the 1-line solution there? I think it reads nicely. We could even remove the curly braces:

doc = Document.new(full_path, :site => site, :collection => self)

This comment has been minimized.

@envygeeks

envygeeks Jul 15, 2016

Contributor

I do like the version you've given @parkr.

@envygeeks

envygeeks Jul 15, 2016

Contributor

I do like the version you've given @parkr.

lib/jekyll/collection.rb
+ private
+ def read_files(file_path, full_path)
+ relative_dir = Jekyll.sanitized_path(relative_directory,
+ File.dirname(file_path)).chomp("/.")

This comment has been minimized.

@envygeeks

envygeeks Jul 15, 2016

Contributor

This is very uncleanly and offsets the eyes IMO. Why not just fold the () and put the data between?

@envygeeks

envygeeks Jul 15, 2016

Contributor

This is very uncleanly and offsets the eyes IMO. Why not just fold the () and put the data between?

@envygeeks

This comment has been minimized.

Show comment
Hide comment
@envygeeks

envygeeks Jul 15, 2016

Contributor

Just a few comments! Thanks.

Contributor

envygeeks commented Jul 15, 2016

Just a few comments! Thanks.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jul 16, 2016

Member

LGTM. @envygeeks?

Member

parkr commented Jul 16, 2016

LGTM. @envygeeks?

@envygeeks

This comment has been minimized.

Show comment
Hide comment
@envygeeks

envygeeks Jul 16, 2016

Contributor

LGTM.

Contributor

envygeeks commented Jul 16, 2016

LGTM.

@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Jul 16, 2016

Member

@jekyllbot: merge +dev

Member

parkr commented Jul 16, 2016

@jekyllbot: merge +dev

@jekyllbot jekyllbot merged commit cfeb54d into jekyll:master Jul 16, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
jekyll/lgtm Approved by @parkr and @envygeeks.

jekyllbot added a commit that referenced this pull request Jul 16, 2016

stevecheckoway added a commit to stevecheckoway/jekyll that referenced this pull request Jul 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment