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

ruby-changes:37114

From: hsbt <ko1@a...>
Date: Fri, 9 Jan 2015 23:20:33 +0900 (JST)
Subject: [ruby-changes:37114] hsbt:r49195 (trunk): * lib/rubygems: Update to RubyGems HEAD(e53c54a).

hsbt	2015-01-09 23:20:10 +0900 (Fri, 09 Jan 2015)

  New Revision: 49195

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

  Log:
    * lib/rubygems:  Update to RubyGems HEAD(e53c54a).
    * test/rubygems:  ditto.

  Modified files:
    trunk/ChangeLog
    trunk/lib/rubygems/basic_specification.rb
    trunk/lib/rubygems/commands/help_command.rb
    trunk/lib/rubygems/commands/yank_command.rb
    trunk/lib/rubygems/dependency_installer.rb
    trunk/lib/rubygems/path_support.rb
    trunk/lib/rubygems/psych_additions.rb
    trunk/lib/rubygems/remote_fetcher.rb
    trunk/lib/rubygems/security/signer.rb
    trunk/lib/rubygems/specification.rb
    trunk/test/rubygems/test_gem.rb
    trunk/test/rubygems/test_gem_commands_pristine_command.rb
    trunk/test/rubygems/test_gem_commands_unpack_command.rb
    trunk/test/rubygems/test_gem_dependency_installer.rb
    trunk/test/rubygems/test_gem_ext_cmake_builder.rb
    trunk/test/rubygems/test_gem_installer.rb
    trunk/test/rubygems/test_gem_package.rb
    trunk/test/rubygems/test_gem_uninstaller.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49194)
+++ ChangeLog	(revision 49195)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jan  9 23:20:04 2015  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* lib/rubygems:  Update to RubyGems HEAD(e53c54a).
+	* test/rubygems:  ditto.
+
 Fri Jan  9 11:13:01 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (assocs, assoc): eliminate splatting empty literal
Index: lib/rubygems/basic_specification.rb
===================================================================
--- lib/rubygems/basic_specification.rb	(revision 49194)
+++ lib/rubygems/basic_specification.rb	(revision 49195)
@@ -61,8 +61,7 @@ class Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/basic_specification.rb#L61
     @contains_requirable_file ||= {}
     @contains_requirable_file[file] ||=
     begin
-      if instance_variable_defined?(:@ignored) or
-         instance_variable_defined?('@ignored') then
+      if instance_variable_defined?(:@ignored) then
         return false
       elsif missing_extensions? then
         @ignored = true
Index: lib/rubygems/path_support.rb
===================================================================
--- lib/rubygems/path_support.rb	(revision 49194)
+++ lib/rubygems/path_support.rb	(revision 49195)
@@ -43,13 +43,6 @@ class Gem::PathSupport https://github.com/ruby/ruby/blob/trunk/lib/rubygems/path_support.rb#L43
   private
 
   ##
-  # Set the Gem home directory (as reported by Gem.dir).
-
-  def home=(home)
-    @home = home.to_s
-  end
-
-  ##
   # Set the Gem search path (as reported by Gem.path).
 
   def path=(gpaths)
Index: lib/rubygems/dependency_installer.rb
===================================================================
--- lib/rubygems/dependency_installer.rb	(revision 49194)
+++ lib/rubygems/dependency_installer.rb	(revision 49195)
@@ -218,7 +218,17 @@ class Gem::DependencyInstaller https://github.com/ruby/ruby/blob/trunk/lib/rubygems/dependency_installer.rb#L218
         tuples, errors = Gem::SpecFetcher.fetcher.search_for_dependency dep
 
         if best_only && !tuples.empty?
-          tuples.sort! { |a,b| b[0].version <=> a[0].version }
+          tuples.sort! do |a,b|
+            if b[0].version == a[0].version
+              if b[0].platform != Gem::Platform::RUBY
+                1
+              else
+                -1
+              end
+            else
+              b[0].version <=> a[0].version
+            end
+          end
           tuples = [tuples.first]
         end
 
Index: lib/rubygems/specification.rb
===================================================================
--- lib/rubygems/specification.rb	(revision 49194)
+++ lib/rubygems/specification.rb	(revision 49195)
@@ -1932,7 +1932,7 @@ class Gem::Specification < Gem::BasicSpe https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L1932
   # Singular accessor for #licenses
 
   def license
-    val = licenses and val.first
+    licenses.first
   end
 
   ##
Index: lib/rubygems/commands/yank_command.rb
===================================================================
--- lib/rubygems/commands/yank_command.rb	(revision 49194)
+++ lib/rubygems/commands/yank_command.rb	(revision 49195)
@@ -21,7 +21,7 @@ via the webhooks.  If you accidentally p https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/yank_command.rb#L21
 data you will need to change them immediately and yank your gem.
 
 If you are yanking a gem due to intellectual property reasons contact
-http://help.rubygems.org for permanant removal.  Be sure to mention this
+http://help.rubygems.org for permanent removal.  Be sure to mention this
 as the reason for the removal request.
     EOF
   end
Index: lib/rubygems/commands/help_command.rb
===================================================================
--- lib/rubygems/commands/help_command.rb	(revision 49194)
+++ lib/rubygems/commands/help_command.rb	(revision 49195)
@@ -176,7 +176,7 @@ dependencies file.: https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/help_command.rb#L176
 Ruby Version and Engine Dependency
 ==================================
 
-You can specifiy the version, engine and engine version of ruby to use with
+You can specify the version, engine and engine version of ruby to use with
 your gem dependencies file.  If you are not running the specified version
 RubyGems will raise an exception.
 
@@ -223,7 +223,7 @@ The #group method can also be used to pl https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/help_command.rb#L223
 The #group method allows multiple groups.
 
 The #gemspec development dependencies are placed in the :development group by
-default.  This may be overriden with the :development_group option:
+default.  This may be overridden with the :development_group option:
 
   gemspec development_group: :other
 
Index: lib/rubygems/security/signer.rb
===================================================================
--- lib/rubygems/security/signer.rb	(revision 49194)
+++ lib/rubygems/security/signer.rb	(revision 49195)
@@ -122,7 +122,7 @@ class Gem::Security::Signer https://github.com/ruby/ruby/blob/trunk/lib/rubygems/security/signer.rb#L122
   #   ~/.gem/gem-public_cert.pem.expired.%Y%m%d%H%M%S
   #
   # If the signing certificate can be re-signed the expired certificate will
-  # be saved as ~/.gem/gem-pubilc_cert.pem.expired.%Y%m%d%H%M%S where the
+  # be saved as ~/.gem/gem-public_cert.pem.expired.%Y%m%d%H%M%S where the
   # expiry time (not after) is used for the timestamp.
 
   def re_sign_key # :nodoc:
Index: lib/rubygems/psych_additions.rb
===================================================================
--- lib/rubygems/psych_additions.rb	(revision 49194)
+++ lib/rubygems/psych_additions.rb	(revision 49195)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/psych_additions.rb#L1
-# This exists just to satify bugs in marshal'd gemspecs that
+# This exists just to satisfy bugs in marshal'd gemspecs that
 # contain a reference to YAML::PrivateType. We prune these out
 # in Specification._load, but if we don't have the constant, Marshal
 # blows up.
Index: lib/rubygems/remote_fetcher.rb
===================================================================
--- lib/rubygems/remote_fetcher.rb	(revision 49194)
+++ lib/rubygems/remote_fetcher.rb	(revision 49195)
@@ -103,7 +103,7 @@ class Gem::RemoteFetcher https://github.com/ruby/ruby/blob/trunk/lib/rubygems/remote_fetcher.rb#L103
   # filename. Returns nil if the gem cannot be located.
   #--
   # Should probably be integrated with #download below, but that will be a
-  # larger, more emcompassing effort. -erikh
+  # larger, more encompassing effort. -erikh
 
   def download_to_cache dependency
     found, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dependency
Index: test/rubygems/test_gem_package.rb
===================================================================
--- test/rubygems/test_gem_package.rb	(revision 49194)
+++ test/rubygems/test_gem_package.rb	(revision 49195)
@@ -298,7 +298,7 @@ class TestGemPackage < Gem::Package::Tar https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package.rb#L298
     assert_equal %w[lib/code.rb], reader.contents
   end
 
-  def test_build_signed_encryped_key
+  def test_build_signed_encrypted_key
     skip 'openssl is missing' unless defined?(OpenSSL::SSL)
 
     spec = Gem::Specification.new 'build', '1'
Index: test/rubygems/test_gem.rb
===================================================================
--- test/rubygems/test_gem.rb	(revision 49194)
+++ test/rubygems/test_gem.rb	(revision 49195)
@@ -1145,7 +1145,7 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1145
     ]
 
     tests.each do |_name, _paths, expected|
-      Gem.paths = { 'GEM_HOME' => _paths.first, 'GEM_PATH' => _paths }
+      Gem.use_paths _paths.first, _paths
       Gem::Specification.reset
       Gem.searcher = nil
 
@@ -1192,10 +1192,7 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1192
     install_gem m, :install_dir => Gem.dir
     install_gem m, :install_dir => Gem.user_dir
 
-    Gem.paths = {
-      'GEM_HOME' => Gem.dir,
-      'GEM_PATH' => [ Gem.dir, Gem.user_dir]
-    }
+    Gem.use_paths Gem.dir, [ Gem.dir, Gem.user_dir]
 
     assert_equal \
       File.join(Gem.dir, "gems", "m-1"),
Index: test/rubygems/test_gem_ext_cmake_builder.rb
===================================================================
--- test/rubygems/test_gem_ext_cmake_builder.rb	(revision 49194)
+++ test/rubygems/test_gem_ext_cmake_builder.rb	(revision 49195)
@@ -20,7 +20,7 @@ class TestGemExtCmakeBuilder < Gem::Test https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_cmake_builder.rb#L20
   def test_self_build
     File.open File.join(@ext, 'CMakeLists.txt'), 'w' do |cmakelists|
       cmakelists.write <<-eo_cmake
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.6)
 install (FILES test.txt DESTINATION bin)
       eo_cmake
     end
Index: test/rubygems/test_gem_dependency_installer.rb
===================================================================
--- test/rubygems/test_gem_dependency_installer.rb	(revision 49194)
+++ test/rubygems/test_gem_dependency_installer.rb	(revision 49195)
@@ -14,6 +14,14 @@ class TestGemDependencyInstaller < Gem:: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_dependency_installer.rb#L14
     FileUtils.mkdir @gems_dir
 
     Gem::RemoteFetcher.fetcher = @fetcher = Gem::FakeFetcher.new
+
+    @original_platforms = Gem.platforms
+    Gem.platforms = []
+  end
+
+  def teardown
+    Gem.platforms = @original_platforms
+    super
   end
 
   def util_setup_gems
@@ -272,7 +280,7 @@ class TestGemDependencyInstaller < Gem:: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_dependency_installer.rb#L280
   # This asserts that if a gem's dependency is satisfied by an
   # already installed gem, RubyGems doesn't installed a newer
   # version
-  def test_install_doesnt_upgrade_installed_depedencies
+  def test_install_doesnt_upgrade_installed_dependencies
     util_setup_gems
 
     a2, a2_gem = util_gem 'a', '2'
@@ -1084,6 +1092,24 @@ class TestGemDependencyInstaller < Gem:: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_dependency_installer.rb#L1092
     assert_equal [@a1_pre, @a1], prereleases
   end
 
+  def test_find_gems_with_sources_with_best_only_and_platform
+    util_setup_gems
+    a1_x86_mingw32, = util_gem 'a', '1' do |s|
+      s.platform = 'x86-mingw32'
+    end
+    util_setup_spec_fetcher @a1, a1_x86_mingw32
+    Gem.platforms << Gem::Platform.new('x86-mingw32')
+
+    installer = Gem::DependencyInstaller.new
+
+    dependency = Gem::Dependency.new('a', Gem::Requirement.default)
+
+    releases =
+      installer.find_gems_with_sources(dependency, true).all_specs
+
+    assert_equal [a1_x86_mingw32], releases
+  end
+
   def test_find_gems_with_sources_with_bad_source
     Gem.sources.replace ["http://not-there.nothing"]
 
Index: test/rubygems/test_gem_uninstaller.rb
===================================================================
--- test/rubygems/test_gem_uninstaller.rb	(revision 49194)
+++ test/rubygems/test_gem_uninstaller.rb	(revision 49195)
@@ -385,7 +385,7 @@ create_makefile '#{@spec.name}' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_uninstaller.rb#L385
     assert_match %r!Successfully uninstalled q-1!, lines.last
   end
 
-  def test_uninstall_only_lists_unsatified_deps
+  def test_uninstall_only_lists_unsatisfied_deps
     quick_gem 'r', '1' do |s| s.add_dependency 'q', '~> 1.0' end
     quick_gem 'x', '1' do |s| s.add_dependency 'q', '= 1.0'  end
     quick_gem 'q', '1.0'
@@ -409,7 +409,7 @@ create_makefile '#{@spec.name}' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_uninstaller.rb#L409
     assert_match %r!Successfully uninstalled q-1.0!, lines.last
   end
 
-  def test_uninstall_doesnt_prompt_when_other_gem_satifies_requirement
+  def test_uninstall_doesnt_prompt_when_other_gem_satisfies_requirement
     quick_gem 'r', '1' do |s| s.add_dependency 'q', '~> 1.0' end
     quick_gem 'q', '1.0'
     quick_gem 'q', '1.1'
Index: test/rubygems/test_gem_commands_pristine_command.rb
===================================================================
--- test/rubygems/test_gem_commands_pristine_command.rb	(revision 49194)
+++ test/rubygems/test_gem_commands_pristine_command.rb	(revision 49195)
@@ -231,7 +231,7 @@ class TestGemCommandsPristineCommand < G https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_pristine_command.rb#L231
 
     Gem.clear_paths
     gemhome2 = File.join @tempdir, 'gemhome2'
-    Gem.paths = { "GEM_PATH" => [gemhome2, @gemhome], "GEM_HOME" => gemhome2 }
+    Gem.use_paths gemhome2, [gemhome2, @gemhome]
 
     b = util_spec 'b'
     install_gem b
@@ -301,7 +301,7 @@ class TestGemCommandsPristineCommand < G https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_pristine_command.rb#L301
 
     Gem.clear_paths
     gemhome2 = File.join(@tempdir, 'gemhome2')
-    Gem.paths = { "GEM_PATH" => [gemhome2, @gemhome], "GEM_HOME" => gemhome2 }
+    Gem.use_paths gemhome2, [gemhome2, @gemhome]
 
     install_gem specs["b-1"]
     FileUtils.rm File.join(gemhome2, 'cache', 'b-1.gem')
Index: test/rubygems/test_gem_installer.rb
===================================================================
--- test/rubygems/test_gem_installer.rb	(revision 49194)
+++ test/rubygems/test_gem_installer.rb	(revision 49195)
@@ -319,7 +319,7 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L319
 
     options = {
       :bin_dir => bin_dir,
-      :install_dir => "/non/existant"
+      :install_dir => "/non/existent"
     }
 
     inst = Gem::Installer.new '', options
Index: test/rubygems/test_gem_commands_unpack_command.rb
===================================================================
--- test/rubygems/test_gem_commands_unpack_command.rb	(revision 49194)
+++ test/rubygems/test_gem_commands_unpack_command.rb	(revision 49195)
@@ -66,7 +66,7 @@ class TestGemCommandsUnpackCommand < Gem https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_unpack_command.rb#L66
 
     gemhome2 = File.join @tempdir, 'gemhome2'
 
-    Gem.paths = { "GEM_PATH" => [gemhome2, @gemhome], "GEM_HOME" => gemhome2 }
+    Gem.use_paths gemhome2, [gemhome2, @gemhome]
 
     @cmd.options[:args] = %w[a]
 
@@ -86,7 +86,7 @@ class TestGemCommandsUnpackCommand < Gem https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_unpack_command.rb#L86
 
     gemhome2 = File.join @tempdir, 'gemhome2'
 
-    Gem.paths = { "GEM_PATH" => [gemhome2, @gemhome], "GEM_HOME" => gemhome2 }
+    Gem.use_paths gemhome2, [gemhome2, @gemhome]
 
     @cmd.options[:args] = %w[z]
 

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

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