diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-18 14:12:18 -0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2011-01-18 14:39:27 -0800 |
commit | 4d6c3daeaa7e64408cd43b7823c0abc23c2b72c7 (patch) | |
tree | 2e514756d0f5f7a928b15f1049acabf68bd011ed | |
parent | 2418bc9755ecca2ae91d846a9a444ec3d2a662a7 (diff) | |
download | bundler-4d6c3daeaa7e64408cd43b7823c0abc23c2b72c7.tar.gz |
fixing some useless assignment warnings
-rw-r--r-- | lib/bundler/gem_helper.rb | 7 | ||||
-rw-r--r-- | lib/bundler/index.rb | 2 | ||||
-rw-r--r-- | lib/bundler/resolver.rb | 4 | ||||
-rw-r--r-- | spec/install/gems/groups_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/platform_spec.rb | 2 | ||||
-rw-r--r-- | spec/quality_spec.rb | 2 | ||||
-rw-r--r-- | spec/runtime/setup_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/builders.rb | 2 |
8 files changed, 11 insertions, 12 deletions
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index 5cc5c82503..b2510f60de 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -51,7 +51,7 @@ module Bundler def install_gem built_gem_path = build_gem - out, code = sh_with_code("gem install #{built_gem_path}") + out, _ = sh_with_code("gem install #{built_gem_path}") raise "Couldn't install gem, run `gem install #{built_gem_path}' for more detailed output" unless out[/Successfully installed/] Bundler.ui.confirm "#{name} (#{version}) installed" end @@ -68,7 +68,7 @@ module Bundler protected def rubygem_push(path) - out, status = sh("gem push #{path}") + out, _ = sh("gem push #{path}") raise "Gem push failed due to lack of RubyGems.org credentials." if out[/Enter your RubyGems.org credentials/] Bundler.ui.confirm "Pushed #{name} #{version} to rubygems.org" end @@ -100,8 +100,7 @@ module Bundler end def clean? - out, code = sh_with_code("git diff --exit-code") - code == 0 + sh_with_code("git diff --exit-code")[1] == 0 end def tag_version diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb index 1ca9af19a0..b2105cf682 100644 --- a/lib/bundler/index.rb +++ b/lib/bundler/index.rb @@ -104,7 +104,7 @@ module Bundler def same_version?(a, b) regex = /^(.*?)(?:\.0)*$/ - ret = a.to_s[regex, 1] == b.to_s[regex, 1] + a.to_s[regex, 1] == b.to_s[regex, 1] end def spec_satisfies_dependency?(spec, dep) diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index 0a27c09227..4948357c9b 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -407,7 +407,7 @@ module Bundler end def error_message - output = errors.inject("") do |o, (conflict, (origin, requirement))| + errors.inject("") do |o, (conflict, (origin, requirement))| # origin is the SpecSet of specs from the Gemfile that is conflicted with if origin @@ -422,7 +422,7 @@ module Bundler o << " Current Bundler version:\n" newer_bundler_required = requirement.requirement > Gem::Requirement.new(origin.version) # If the origin is a LockfileParser, it does not respond_to :required_by - elsif !origin.respond_to?(:required_by) || !(required_by = origin.required_by.first) + elsif !origin.respond_to?(:required_by) || !(origin.required_by.first) o << " In snapshot (Gemfile.lock):\n" end diff --git a/spec/install/gems/groups_spec.rb b/spec/install/gems/groups_spec.rb index 44fb7563c2..c667114e02 100644 --- a/spec/install/gems/groups_spec.rb +++ b/spec/install/gems/groups_spec.rb @@ -45,7 +45,7 @@ describe "bundle install with gem sources" do end it "removes old groups when new groups are set up" do - out = run <<-RUBY, :emo, :expect_err => true + run <<-RUBY, :emo, :expect_err => true Bundler.setup(:default) require 'thin'; puts THIN RUBY diff --git a/spec/install/gems/platform_spec.rb b/spec/install/gems/platform_spec.rb index f4017dc3d8..d5207420c9 100644 --- a/spec/install/gems/platform_spec.rb +++ b/spec/install/gems/platform_spec.rb @@ -177,7 +177,7 @@ describe "bundle install with platform conditionals" do end it "does not blow up on sources with all platform-excluded specs" do - git = build_git "foo" + build_git "foo" install_gemfile <<-G platform :#{not_local_tag} do diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb index df430d5cb9..1e6ebb0dee 100644 --- a/spec/quality_spec.rb +++ b/spec/quality_spec.rb @@ -49,7 +49,7 @@ describe "The library itself" do it "can still be built" do Dir.chdir(root) do `gem build bundler.gemspec` - $?.should == 0 + check $?.should == 0 # clean up the .gem generated system("rm bundler-#{Bundler::VERSION}.gem") diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index ff5d365a92..40847a0b2b 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -68,7 +68,7 @@ describe "Bundler.setup" do gem "rack" G - lockfile = File.read(bundled_app("Gemfile.lock")) + File.read(bundled_app("Gemfile.lock")) FileUtils.rm(bundled_app("Gemfile.lock")) diff --git a/spec/support/builders.rb b/spec/support/builders.rb index 665428552c..321eba2f11 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -489,7 +489,7 @@ module Spec end class GitUpdater < LibBuilder - WINDOWS = Config::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)! + WINDOWS = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)! NULL = WINDOWS ? "NUL" : "/dev/null" def silently(str) |