Skip to content

Commit

Permalink
Don't invoke methods using ::
Browse files Browse the repository at this point in the history
  • Loading branch information
markijbema committed Aug 9, 2013
1 parent ffeeb17 commit f6467c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/onebox/preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Preview
def initialize(link)
@url = link
@resource = open(@url)
@document = Nokogiri::HTML(@resource)
@document = Nokogiri.HTML(@resource)

This comment has been minimized.

Copy link
@krainboltgreene

krainboltgreene Aug 9, 2013

This is the way described in the documentation of Nokogiri, so I'm not sure I'm ready to switch. I'll look at their API and see if they have a more Ruby idiomatic way.

This comment has been minimized.

Copy link
@markijbema

markijbema Aug 9, 2013

Author Owner

Shall I remove this commit and disable this cop? I don't care too much either way, as said, I'm merely trying to establish a baseline.

This comment has been minimized.

Copy link
@krainboltgreene

krainboltgreene Aug 9, 2013

This is fine, I was commenting more for my sake than as a challenge to the commit. I very appreciate the once over.

This comment has been minimized.

Copy link
@markijbema

markijbema Aug 9, 2013

Author Owner

Now that I think about this, maybe constructor-like methods like this one should be excempted from the rule.

This comment has been minimized.

Copy link
@markijbema

markijbema Aug 10, 2013

Author Owner
end

def to_s
Expand Down
4 changes: 2 additions & 2 deletions spec/support/html_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def onebox_view(html)
end

def response(file)
Nokogiri::HTML(File.read(File.join("spec", "fixtures", file)))
Nokogiri.HTML(File.read(File.join("spec", "fixtures", file)))
end
end

0 comments on commit f6467c7

Please sign in to comment.