[前][次][番号順一覧][スレッド一覧]

ruby-changes:32006

From: drbrain <ko1@a...>
Date: Mon, 9 Dec 2013 08:41:20 +0900 (JST)
Subject: [ruby-changes:32006] drbrain:r44085 (trunk): * lib/rubygems: Update to RubyGems master bf37240. Fixes useless

drbrain	2013-12-09 08:41:14 +0900 (Mon, 09 Dec 2013)

  New Revision: 44085

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44085

  Log:
    * lib/rubygems:  Update to RubyGems master bf37240.  Fixes useless
      error message with `gem install -g` with no gem dependencies file.
    * test/rubygems:  ditto.

  Modified files:
    trunk/ChangeLog
    trunk/lib/rubygems/commands/install_command.rb
    trunk/test/rubygems/test_gem_commands_install_command.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44084)
+++ ChangeLog	(revision 44085)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Dec  9 08:40:40 2013  Eric Hodel  <drbrain@s...>
+
+	* lib/rubygems:  Update to RubyGems master bf37240.  Fixes useless
+	  error message with `gem install -g` with no gem dependencies file.
+	* test/rubygems:  ditto.
+
 Mon Dec  9 04:52:25 2013  Eric Hodel  <drbrain@s...>
 
 	* NEWS:  Update RubyGems entry with notable features.
Index: lib/rubygems/commands/install_command.rb
===================================================================
--- lib/rubygems/commands/install_command.rb	(revision 44084)
+++ lib/rubygems/commands/install_command.rb	(revision 44085)
@@ -40,6 +40,13 @@ class Gem::Commands::InstallCommand < Ge https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/install_command.rb#L40
         File.exist? file
       end unless v
 
+      unless v then
+        message = v ? v : "(tried #{Gem::GEM_DEP_FILES.join ', '})"
+
+        raise OptionParser::InvalidArgument,
+                "cannot find gem dependencies file #{message}"
+      end
+
       o[:gemdeps] = v
     end
 
Index: test/rubygems/test_gem_commands_install_command.rb
===================================================================
--- test/rubygems/test_gem_commands_install_command.rb	(revision 44084)
+++ test/rubygems/test_gem_commands_install_command.rb	(revision 44085)
@@ -809,14 +809,22 @@ ERROR:  Possible alternatives: non_exist https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_install_command.rb#L809
   end
 
   def test_handle_options_file
+    FileUtils.touch 'Gemfile'
+
     @cmd.handle_options %w[-g Gemfile]
 
     assert_equal 'Gemfile', @cmd.options[:gemdeps]
 
+    FileUtils.rm 'Gemfile'
+
+    FileUtils.touch 'gem.deps.rb'
+
     @cmd.handle_options %w[--file gem.deps.rb]
 
     assert_equal 'gem.deps.rb', @cmd.options[:gemdeps]
 
+    FileUtils.rm 'gem.deps.rb'
+
     FileUtils.touch 'Isolate'
 
     @cmd.handle_options %w[-g]

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]