diff options
-rw-r--r-- | .rubocop_todo.yml | 5 | ||||
-rw-r--r-- | lib/bundler.rb | 2 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 10 | ||||
-rw-r--r-- | lib/bundler/index.rb | 8 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 2 | ||||
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 4 | ||||
-rw-r--r-- | lib/bundler/source/git.rb | 4 | ||||
-rw-r--r-- | lib/bundler/spec_set.rb | 2 | ||||
-rw-r--r-- | spec/support/helpers.rb | 4 |
9 files changed, 21 insertions, 20 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f103f871..38ec2438 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -422,9 +422,10 @@ Style/SingleLineMethods: Style/SingleSpaceBeforeFirstArg: Enabled: false -# Offense count: 18 +# Offense count: 7 # Cop supports --auto-correct. -Style/SpaceAfterComma: +# Configuration parameters: EnforcedStyle, SupportedStyles. +Style/SpaceAroundEqualsInParameterDefault: Enabled: false # Offense count: 4 diff --git a/lib/bundler.rb b/lib/bundler.rb index 3212a47e..b027f688 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -251,7 +251,7 @@ module Bundler def with_clean_env with_original_env do ENV["MANPATH"] = ENV["BUNDLE_ORIG_MANPATH"] - ENV.delete_if {|k,_| k[0,7] == "BUNDLE_" } + ENV.delete_if { |k, _| k[0, 7] == "BUNDLE_" } if ENV.has_key? "RUBYOPT" ENV["RUBYOPT"] = ENV["RUBYOPT"].sub "-rbundler/setup", "" ENV["RUBYOPT"] = ENV["RUBYOPT"].sub "-I#{File.expand_path("..", __FILE__)}", "" diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 7ebad15e..3abbd3c8 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -364,9 +364,9 @@ module Bundler deleted.concat deleted_deps.map {|d| "* #{pretty_dep(d)}" } end - both_sources = Hash.new {|h,k| h[k] = [] } - @dependencies.each {|d| both_sources[d.name][0] = d } - @locked_deps.each {|d| both_sources[d.name][1] = d.source } + both_sources = Hash.new { |h, k| h[k] = [] } + @dependencies.each { |d| both_sources[d.name][0] = d } + @locked_deps.each { |d| both_sources[d.name][1] = d.source } both_sources.each do |name, (dep, lock_source)| if (dep.nil? && !lock_source.nil?) || (!dep.nil? && !lock_source.nil? && !lock_source.can_lock?(dep)) @@ -454,8 +454,8 @@ module Bundler def converge_locals locals = [] - Bundler.settings.local_overrides.map do |k,v| - spec = @dependencies.find {|s| s.name == k } + Bundler.settings.local_overrides.map do |k, v| + spec = @dependencies.find { |s| s.name == k } source = spec && spec.source if source && source.respond_to?(:local_override!) source.unlock! if @unlock[:gems].include?(spec.name) diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb index ad36b756..d0e3ae47 100644 --- a/lib/bundler/index.rb +++ b/lib/bundler/index.rb @@ -16,16 +16,16 @@ module Bundler def initialize @sources = [] @cache = {} - @specs = Hash.new {|h,k| h[k] = Hash.new } - @all_specs = Hash.new {|h,k| h[k] = [] } + @specs = Hash.new { |h, k| h[k] = Hash.new } + @all_specs = Hash.new { |h, k| h[k] = [] } end def initialize_copy(o) super @sources = @sources.dup @cache = {} - @specs = Hash.new {|h,k| h[k] = Hash.new } - @all_specs = Hash.new {|h,k| h[k] = [] } + @specs = Hash.new { |h, k| h[k] = Hash.new } + @all_specs = Hash.new { |h, k| h[k] = [] } o.specs.each do |name, hash| @specs[name] = hash.dup diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 3c9e5477..1525ec13 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -125,7 +125,7 @@ module Bundler if options.any? Bundler.ui.warn "#{spec.name} has no executables, but you may want " + "one from a gem it depends on." - options.each {|name,bins| Bundler.ui.warn " #{name} has: #{bins.join(", ")}" } + options.each{|name, bins| Bundler.ui.warn " #{name} has: #{bins.join(", ")}" } else Bundler.ui.warn "There are no executables for the gem #{spec.name}." end diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index b7cf99c0..90560cba 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -10,7 +10,7 @@ require "rubygems/specification" require "bundler/match_platform" module Gem - @loaded_stacks = Hash.new {|h,k| h[k] = [] } + @loaded_stacks = Hash.new { |h, k| h[k] = [] } class Specification attr_accessor :remote, :location, :relative_loaded_from @@ -122,7 +122,7 @@ module Gem def to_lock out = " #{name}" unless requirement == Gem::Requirement.default - reqs = requirement.requirements.map {|o,v| "#{o} #{v}" }.sort.reverse + reqs = requirement.requirements.map{|o, v| "#{o} #{v}" }.sort.reverse out << " (#{reqs.join(", ")})" end out diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index 4fcbd890..a10294de 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -246,7 +246,7 @@ module Bundler end def base_name - File.basename(uri.sub(%r{^(\w+://)?([^/:]+:)?(//\w*/)?(\w*/)*},""),".git") + File.basename(uri.sub(%r{^(\w+://)?([^/:]+:)?(//\w*/)?(\w*/)*}, ""), ".git") end def shortref_for_display(ref) @@ -261,7 +261,7 @@ module Bundler if uri =~ %r{^\w+://(\w+@)?} # Downcase the domain component of the URI # and strip off a trailing slash, if one is present - input = URI.parse(uri).normalize.to_s.sub(%r{/$},"") + input = URI.parse(uri).normalize.to_s.sub(%r{/$}, "") else # If there is no URI scheme, assume it is an ssh/git URI input = uri diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 61e6400d..9823f3fc 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -129,7 +129,7 @@ module Bundler def lookup @lookup ||= begin - lookup = Hash.new {|h,k| h[k] = [] } + lookup = Hash.new { |h, k| h[k] = [] } specs = @specs.sort_by do |s| s.platform.to_s == "ruby" ? "\0" : s.platform.to_s end diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index fc9dc725..23823b4b 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -360,12 +360,12 @@ module Spec def with_env_vars(env_hash, &block) current_values = {} - env_hash.each do |k,v| + env_hash.each do |k, v| current_values[k] = v ENV[k] = v end block.call if block_given? - env_hash.each do |k,v| + env_hash.each do |k, v| ENV[k] = current_values[k] end end |