Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
[RuboCop] Enable Style/RedundantSelf
Browse files Browse the repository at this point in the history
  • Loading branch information
segiddins committed Nov 26, 2015
1 parent 277e0ff commit d5f3f86
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 19 deletions.
12 changes: 0 additions & 12 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def app_config_path

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)
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ def pinned_spec_names(specs)
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)
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/graph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _patching_gem_dependency_class
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
}

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/rubygems_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def fetch_all_remote_specs(remote)

def with_build_args(args)
ext_lock.synchronize do
old_args = self.build_args
old_args = build_args
begin
self.build_args = args
yield
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/source/rubygems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def to_lock
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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/less_than_proc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/support/ruby_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def read_available_bytes(chunk_size = 16_384, select_timeout = 0.02)
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
Expand Down

0 comments on commit d5f3f86

Please sign in to comment.