Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all remaining rubocop violations #241

Merged
merged 6 commits into from
Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/puppet/provider/package/pear.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def self.pearlist(hash)
pearhash[:provider] = :pear
pearhash
end
end.reject { |p| p.nil? }
end.reject(&:nil?)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if this could actually be replaced with end.compact, but was too scared!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array#compact should work, the only difference to this manual solution I could find was that compact will only remove actual nil, whereas this will work on classes that define a custom #nil? (I see no reason why that would be something you want though).


rescue Puppet::ExecutionFailure => detail
raise Puppet::Error, format('Could not list pears: %s', detail)
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/package/pecl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def self.pecllist(hash)
peclhash[:provider] = :peclcmd
peclhash
end
end.reject { |p| p.nil? }
end.reject(&:nil?)
rescue Puppet::ExecutionFailure => detail
raise Puppet::Error, format('Could not list pecls: %s', detail)
end
Expand Down