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

ruby-changes:53968

From: hsbt <ko1@a...>
Date: Tue, 4 Dec 2018 17:01:02 +0900 (JST)
Subject: [ruby-changes:53968] hsbt:r66188 (trunk): Merge rubygems master@221bdea

hsbt	2018-12-04 17:00:57 +0900 (Tue, 04 Dec 2018)

  New Revision: 66188

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

  Log:
    Merge rubygems master@221bdea
    
      * Fixed https://github.com/rubygems/rubygems/pull/2506

  Modified files:
    trunk/lib/rubygems/specification.rb
    trunk/test/rubygems/test_gem_specification.rb
Index: lib/rubygems/specification.rb
===================================================================
--- lib/rubygems/specification.rb	(revision 66187)
+++ lib/rubygems/specification.rb	(revision 66188)
@@ -2693,7 +2693,7 @@ class Gem::Specification < Gem::BasicSpe https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L2693
     @version = Gem::Version.create(version)
     # skip to set required_ruby_version when pre-released rubygems.
     # It caused to raise CircularDependencyError
-    if @version.prerelease? && @name.strip != "rubygems"
+    if @version.prerelease? && (@name.nil? || @name.strip != "rubygems")
       self.required_rubygems_version = '> 1.3.1'
     end
     invalidate_memoized_attributes
Index: test/rubygems/test_gem_specification.rb
===================================================================
--- test/rubygems/test_gem_specification.rb	(revision 66187)
+++ test/rubygems/test_gem_specification.rb	(revision 66188)
@@ -1345,6 +1345,16 @@ dependencies: [] https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L1345
     assert_equal '/path/to/file', e.file_path
   end
 
+  def test_initialize_prerelease_version_before_name
+    spec = Gem::Specification.new do |s|
+      s.version = '1.0.0.dev'
+      s.name = 'a'
+    end
+
+    assert_equal "a", spec.name
+    assert_equal "1.0.0.dev", spec.version.to_s
+  end
+
   def test__dump
     @a2.platform = Gem::Platform.local
     @a2.instance_variable_set :@original_platform, 'old_platform'

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

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