summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErick Sasse <esasse@gmail.com>2015-07-22 22:38:52 -0300
committerErick Sasse <esasse@gmail.com>2015-07-22 22:38:52 -0300
commit02f33e6c46bd1df5a317dbb4c84090cc5f0a712b (patch)
tree45b606bc7103e00e14477d7981438ffd34f5ee28
parent8db3f4b975655da1e906c5e38fdfa15b59faf791 (diff)
downloadbundler-02f33e6c46bd1df5a317dbb4c84090cc5f0a712b.tar.gz
Fix Performance/ReverseEach
-rw-r--r--.rubocop_todo.yml5
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--lib/bundler/source/rubygems.rb2
3 files changed, 2 insertions, 7 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index cc3636e380..ab75eace17 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -53,11 +53,6 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Max: 54
-# Offense count: 2
-# Cop supports --auto-correct.
-Performance/ReverseEach:
- Enabled: false
-
# Offense count: 1
Style/AccessorMethodName:
Enabled: false
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index c11567640c..7ed8a6fdad 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -316,7 +316,7 @@ module Bundler
desc "licenses", "Prints the license of all gems in the bundle"
def licenses
- Bundler.load.specs.sort_by {|s| s.license.to_s }.reverse.each do |s|
+ Bundler.load.specs.sort_by {|s| s.license.to_s }.reverse_each do |s|
gem_name = s.name
license = s.license || s.licenses
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 9bd908fb60..f282edfd96 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -274,7 +274,7 @@ module Bundler
@installed_specs ||= begin
idx = Index.new
have_bundler = false
- Bundler.rubygems.all_specs.reverse.each do |spec|
+ Bundler.rubygems.all_specs.reverse_each do |spec|
next if spec.name == "bundler" && spec.version.to_s != VERSION
have_bundler = true if spec.name == "bundler"
spec.source = self