summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2015-11-26 12:15:08 -0600
committerSamuel Giddins <segiddins@segiddins.me>2015-11-26 12:15:08 -0600
commitd5f3f861f273ae95cba12a0e6b230005e1061964 (patch)
tree5dff6a0da72c7d22f66bc8836d077366799edf31
parent277e0ff55995786f7202b0e7dc3831f4a92ac0e7 (diff)
downloadbundler-d5f3f861f273ae95cba12a0e6b230005e1061964.tar.gz
[RuboCop] Enable Style/RedundantSelf
-rw-r--r--.rubocop_todo.yml12
-rw-r--r--lib/bundler.rb2
-rw-r--r--lib/bundler/definition.rb2
-rw-r--r--lib/bundler/graph.rb2
-rw-r--r--lib/bundler/rubygems_integration.rb2
-rw-r--r--lib/bundler/source/rubygems.rb2
-rw-r--r--spec/support/less_than_proc.rb2
-rw-r--r--spec/support/ruby_ext.rb2
8 files changed, 7 insertions, 19 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index ca2481aaf8..3a9654b77d 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -246,18 +246,6 @@ Style/PredicateName:
Style/RaiseArgs:
Enabled: false
-# Offense count: 7
-# Cop supports --auto-correct.
-Style/RedundantSelf:
- Exclude:
- - 'lib/bundler.rb'
- - 'lib/bundler/definition.rb'
- - 'lib/bundler/graph.rb'
- - 'lib/bundler/rubygems_integration.rb'
- - 'lib/bundler/source/rubygems.rb'
- - 'spec/support/less_than_proc.rb'
- - 'spec/support/ruby_ext.rb'
-
# Offense count: 1
# Configuration parameters: Methods.
Style/SingleLineBlockParams:
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 1da7e6ab88..7af59ac363 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -175,7 +175,7 @@ module Bundler
def app_cache(custom_path = nil)
path = custom_path || root
- path.join(self.settings.app_cache_path)
+ path.join(settings.app_cache_path)
end
def tmp(name = Process.pid.to_s)
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 1de65df695..a3196d9124 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -661,7 +661,7 @@ module Bundler
end
def requested_groups
- self.groups - Bundler.settings.without - @optional_groups + Bundler.settings.with
+ groups - Bundler.settings.without - @optional_groups + Bundler.settings.with
end
def lockfiles_equal?(current, proposed, preserve_bundled_with)
diff --git a/lib/bundler/graph.rb b/lib/bundler/graph.rb
index cf5913ec70..c8c61497ef 100644
--- a/lib/bundler/graph.rb
+++ b/lib/bundler/graph.rb
@@ -97,7 +97,7 @@ module Bundler
Gem::Dependency.class_eval do
def matching_specs(platform_only = false)
matches = Bundler.load.specs.select { |spec|
- self.name == spec.name and
+ name == spec.name and
requirement.satisfied_by? spec.version
}
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 3f375dff8c..b1f0984cc9 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -203,7 +203,7 @@ module Bundler
def with_build_args(args)
ext_lock.synchronize do
- old_args = self.build_args
+ old_args = build_args
begin
self.build_args = args
yield
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 8e3173c666..c8588e4db3 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -68,7 +68,7 @@ module Bundler
end
def to_s
- remote_names = self.remotes.map(&:to_s).join(", ")
+ remote_names = remotes.map(&:to_s).join(", ")
"rubygems repository #{remote_names}"
end
alias_method :name, :to_s
diff --git a/spec/support/less_than_proc.rb b/spec/support/less_than_proc.rb
index 5098befbf1..515470968a 100644
--- a/spec/support/less_than_proc.rb
+++ b/spec/support/less_than_proc.rb
@@ -3,7 +3,7 @@ class LessThanProc < Proc
def self.with(present)
provided = Gem::Version.new(present.dup)
- self.new do |required|
+ new do |required|
if required =~ /[=><~]/
!Gem::Requirement.new(required).satisfied_by?(provided)
else
diff --git a/spec/support/ruby_ext.rb b/spec/support/ruby_ext.rb
index 59f428aa11..9c5b08c9e5 100644
--- a/spec/support/ruby_ext.rb
+++ b/spec/support/ruby_ext.rb
@@ -9,7 +9,7 @@ class IO
begin
IO.select([self], nil, nil, select_timeout)
break if eof? # stop raising :-(
- buffer << self.readpartial(chunk_size)
+ buffer << readpartial(chunk_size)
rescue(EOFError)
break
end