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

ruby-changes:48105

From: hsbt <ko1@a...>
Date: Fri, 20 Oct 2017 18:03:42 +0900 (JST)
Subject: [ruby-changes:48105] hsbt:r60219 (trunk): Merge rubygems master(ddbf3203f3857649abe95c73edefc7de7e6ecff4).

hsbt	2017-10-20 18:03:37 +0900 (Fri, 20 Oct 2017)

  New Revision: 60219

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

  Log:
    Merge rubygems master(ddbf3203f3857649abe95c73edefc7de7e6ecff4).
    
      It fixed: https://github.com/rubygems/rubygems/issues/2041

  Modified files:
    trunk/lib/rubygems/basic_specification.rb
    trunk/test/rubygems/test_gem_stream_ui.rb
    trunk/test/rubygems/test_gem_stub_specification.rb
Index: test/rubygems/test_gem_stub_specification.rb
===================================================================
--- test/rubygems/test_gem_stub_specification.rb	(revision 60218)
+++ test/rubygems/test_gem_stub_specification.rb	(revision 60219)
@@ -110,6 +110,18 @@ class TestStubSpecification < Gem::TestC https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stub_specification.rb#L110
     assert_equal code_rb, stub.matches_for_glob('code*').first
   end
 
+  def test_matches_for_glob_with_bundler_inline
+    stub = stub_with_extension
+    code_rb = File.join stub.gem_dir, 'lib', 'code.rb'
+    FileUtils.mkdir_p File.dirname code_rb
+    FileUtils.touch code_rb
+
+    stub.stub(:raw_require_paths, nil) do
+      assert_equal code_rb, stub.matches_for_glob('code*').first
+    end
+  end
+
+
   def test_missing_extensions_eh
     stub = stub_with_extension do |s|
       extconf_rb = File.join s.gem_dir, s.extensions.first
Index: test/rubygems/test_gem_stream_ui.rb
===================================================================
--- test/rubygems/test_gem_stream_ui.rb	(revision 60218)
+++ test/rubygems/test_gem_stream_ui.rb	(revision 60219)
@@ -37,7 +37,7 @@ class TestGemStreamUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L37
 
   def test_ask
     skip 'TTY detection broken on windows' if
-      Gem.win_platform? unless RUBY_VERSION > '1.9.2'
+      Gem.win_platform? && RUBY_VERSION <= '1.9.2'
 
     Timeout.timeout(1) do
       expected_answer = "Arthur, King of the Britons"
@@ -49,7 +49,7 @@ class TestGemStreamUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L49
 
   def test_ask_no_tty
     skip 'TTY detection broken on windows' if
-      Gem.win_platform? unless RUBY_VERSION > '1.9.2'
+      Gem.win_platform? && RUBY_VERSION <= '1.9.2'
 
     @in.tty = false
 
@@ -61,7 +61,7 @@ class TestGemStreamUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L61
 
   def test_ask_for_password
     skip 'Always uses $stdin on windows' if
-      Gem.win_platform? unless RUBY_VERSION > '1.9.2'
+      Gem.win_platform? && RUBY_VERSION <= '1.9.2'
 
     Timeout.timeout(1) do
       expected_answer = "Arthur, King of the Britons"
@@ -73,7 +73,7 @@ class TestGemStreamUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L73
 
   def test_ask_for_password_no_tty
     skip 'TTY handling is broken on windows' if
-      Gem.win_platform? unless RUBY_VERSION > '1.9.2'
+      Gem.win_platform? && RUBY_VERSION <= '1.9.2'
 
     @in.tty = false
 
@@ -85,7 +85,7 @@ class TestGemStreamUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L85
 
   def test_ask_yes_no_no_tty_with_default
     skip 'TTY handling is broken on windows' if
-      Gem.win_platform? unless RUBY_VERSION > '1.9.2'
+      Gem.win_platform? && RUBY_VERSION <= '1.9.2'
 
     @in.tty = false
 
@@ -100,7 +100,7 @@ class TestGemStreamUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stream_ui.rb#L100
 
   def test_ask_yes_no_no_tty_without_default
     skip 'TTY handling is broken on windows' if
-      Gem.win_platform? unless RUBY_VERSION > '1.9.2'
+      Gem.win_platform? && RUBY_VERSION <= '1.9.2'
 
     @in.tty = false
 
Index: lib/rubygems/basic_specification.rb
===================================================================
--- lib/rubygems/basic_specification.rb	(revision 60218)
+++ lib/rubygems/basic_specification.rb	(revision 60219)
@@ -275,10 +275,14 @@ class Gem::BasicSpecification https://github.com/ruby/ruby/blob/trunk/lib/rubygems/basic_specification.rb#L275
   # for this spec.
 
   def lib_dirs_glob
-    dirs = if self.raw_require_paths.size > 1 then
-             "{#{self.raw_require_paths.join(',')}}"
+    dirs = if self.raw_require_paths
+             if self.raw_require_paths.size > 1 then
+               "{#{self.raw_require_paths.join(',')}}"
+             else
+               self.raw_require_paths.first
+             end
            else
-             self.raw_require_paths.first
+            "lib" # default value for require_paths for bundler/inline
            end
 
     "#{self.full_gem_path}/#{dirs}".dup.untaint

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

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