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

ruby-changes:26812

From: kou <ko1@a...>
Date: Thu, 17 Jan 2013 22:20:25 +0900 (JST)
Subject: [ruby-changes:26812] kou:r38864 (trunk): * lib/rubygems/ext/builder.rb (Gem::Ext::Builder.make): Remove

kou	2013-01-17 22:20:12 +0900 (Thu, 17 Jan 2013)

  New Revision: 38864

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

  Log:
    * lib/rubygems/ext/builder.rb (Gem::Ext::Builder.make): Remove
      .time dependency from *.rb install target. It causes needless
      *.rb install. [Bug #7698] [ruby-core:51437]
      Reported by Tadashi Saito. Thanks!!!
    * test/rubygems/test_gem_installer.rb
      (TestGemInstaller#test_install_extension_and_script): Add a test
      for the above change.

  Modified files:
    trunk/ChangeLog
    trunk/lib/rubygems/ext/builder.rb
    trunk/test/rubygems/test_gem_installer.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38863)
+++ ChangeLog	(revision 38864)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jan 17 22:10:35 2013  Kouhei Sutou  <kou@c...>
+
+	* lib/rubygems/ext/builder.rb (Gem::Ext::Builder.make): Remove
+	  .time dependency from *.rb install target. It causes needless
+	  *.rb install. [Bug #7698] [ruby-core:51437]
+	  Reported by Tadashi Saito. Thanks!!!
+	* test/rubygems/test_gem_installer.rb
+	  (TestGemInstaller#test_install_extension_and_script): Add a test
+	  for the above change.
+
 Thu Jan 17 21:08:20 2013  Kouhei Sutou  <kou@c...>
 
 	* eval.c: Fix a typo in ruby_finalize() documentation.
Index: lib/rubygems/ext/builder.rb
===================================================================
--- lib/rubygems/ext/builder.rb	(revision 38863)
+++ lib/rubygems/ext/builder.rb	(revision 38864)
@@ -19,6 +19,7 @@ class Gem::Ext::Builder https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/builder.rb#L19
     mf = Gem.read_binary 'Makefile'
     mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}")
     mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$[^$]*/, "RUBYLIBDIR = #{dest_path}")
+    mf = mf.gsub(/\s*\S+\.time$/, "")
 
     File.open('Makefile', 'wb') {|f| f.print mf}
 
Index: test/rubygems/test_gem_installer.rb
===================================================================
--- test/rubygems/test_gem_installer.rb	(revision 38863)
+++ test/rubygems/test_gem_installer.rb	(revision 38864)
@@ -964,6 +964,33 @@ load Gem.bin_path('a', 'executable', ver https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L964
     assert_match %r|I am a shiny gem!|, @ui.output
   end
 
+  def test_install_extension_and_script
+    @spec.extensions << "extconf.rb"
+    write_file File.join(@tempdir, "extconf.rb") do |io|
+      io.write <<-RUBY
+        require "mkmf"
+        create_makefile("#{@spec.name}")
+      RUBY
+    end
+
+    rb = File.join("lib", "#{@spec.name}.rb")
+    @spec.files += [rb]
+    write_file File.join(@tempdir, rb) do |io|
+      io.write <<-RUBY
+        # #{@spec.name}.rb
+      RUBY
+    end
+
+    assert !File.exist?(File.join(@spec.gem_dir, rb))
+    use_ui @ui do
+      path = Gem::Package.build @spec
+
+      @installer = Gem::Installer.new path
+      @installer.install
+    end
+    assert File.exist?(File.join(@spec.gem_dir, rb))
+  end
+
   def test_installation_satisfies_dependency_eh
     quick_spec 'a'
 

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

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