ruby-changes:31238
From: drbrain <ko1@a...>
Date: Thu, 17 Oct 2013 07:37:50 +0900 (JST)
Subject: [ruby-changes:31238] drbrain:r43317 (trunk): * lib/rubygems: Update to RubyGems master 2abce58. Changes:
drbrain 2013-10-17 07:37:39 +0900 (Thu, 17 Oct 2013) New Revision: 43317 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43317 Log: * lib/rubygems: Update to RubyGems master 2abce58. Changes: Fixed documentation generation when sdoc and json are installed as gems. Added some missing documentation. Modified files: trunk/ChangeLog trunk/lib/rubygems/ext/cmake_builder.rb trunk/lib/rubygems/ext/configure_builder.rb trunk/lib/rubygems/ext/ext_conf_builder.rb trunk/lib/rubygems/ext/rake_builder.rb trunk/lib/rubygems/installer.rb trunk/lib/rubygems/request_set.rb trunk/lib/rubygems/specification.rb trunk/test/rubygems/test_gem.rb trunk/test/rubygems/test_gem_specification.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 43316) +++ ChangeLog (revision 43317) @@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Oct 17 07:36:53 2013 Eric Hodel <drbrain@s...> + + * lib/rubygems: Update to RubyGems master 2abce58. Changes: + + Fixed documentation generation when sdoc and json are installed as + gems. + + Added some missing documentation. + Thu Oct 17 07:10:26 2013 Zachary Scott <e@z...> * ext/curses/curses.c: [DOC] Cleaned up formatting consistency of rdoc Index: lib/rubygems/ext/cmake_builder.rb =================================================================== --- lib/rubygems/ext/cmake_builder.rb (revision 43316) +++ lib/rubygems/ext/cmake_builder.rb (revision 43317) @@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/cmake_builder.rb#L1 +require 'rubygems/command' + class Gem::Ext::CmakeBuilder < Gem::Ext::Builder def self.build(extension, directory, dest_path, results) unless File.exist?('Makefile') then Index: lib/rubygems/ext/configure_builder.rb =================================================================== --- lib/rubygems/ext/configure_builder.rb (revision 43316) +++ lib/rubygems/ext/configure_builder.rb (revision 43317) @@ -4,8 +4,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/configure_builder.rb#L4 # See LICENSE.txt for permissions. #++ -require 'rubygems/ext/builder' - class Gem::Ext::ConfigureBuilder < Gem::Ext::Builder def self.build(extension, directory, dest_path, results, args=[]) Index: lib/rubygems/ext/rake_builder.rb =================================================================== --- lib/rubygems/ext/rake_builder.rb (revision 43316) +++ lib/rubygems/ext/rake_builder.rb (revision 43317) @@ -4,9 +4,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/rake_builder.rb#L4 # See LICENSE.txt for permissions. #++ -require 'rubygems/ext/builder' -require 'rubygems/command' - class Gem::Ext::RakeBuilder < Gem::Ext::Builder def self.build(extension, directory, dest_path, results, args=[]) Index: lib/rubygems/ext/ext_conf_builder.rb =================================================================== --- lib/rubygems/ext/ext_conf_builder.rb (revision 43316) +++ lib/rubygems/ext/ext_conf_builder.rb (revision 43317) @@ -4,8 +4,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/ext_conf_builder.rb#L4 # See LICENSE.txt for permissions. #++ -require 'rubygems/ext/builder' -require 'rubygems/command' require 'fileutils' require 'tempfile' Index: lib/rubygems/request_set.rb =================================================================== --- lib/rubygems/request_set.rb (revision 43316) +++ lib/rubygems/request_set.rb (revision 43317) @@ -5,6 +5,19 @@ require 'rubygems/dependency_list' https://github.com/ruby/ruby/blob/trunk/lib/rubygems/request_set.rb#L5 require 'rubygems/installer' require 'tsort' +## +# A RequestSet groups a request to activate a set of dependencies. +# +# nokogiri = Gem::Dependency.new 'nokogiri', '~> 1.6' +# pg = Gem::Dependency.new 'pg', '~> 0.14' +# +# set = Gem::RequestSet.new nokogiri, pg +# +# requests = set.resolve +# +# p requests.map { |r| r.full_name } +# #=> ["nokogiri-1.6.0", "mini_portile-0.5.1", "pg-0.17.0"] + class Gem::RequestSet include TSort @@ -23,6 +36,15 @@ class Gem::RequestSet https://github.com/ruby/ruby/blob/trunk/lib/rubygems/request_set.rb#L36 attr_accessor :soft_missing + ## + # Creates a RequestSet for a list of Gem::Dependency objects, +deps+. You + # can then #resolve and #install the resolved list of dependencies. + # + # nokogiri = Gem::Dependency.new 'nokogiri', '~> 1.6' + # pg = Gem::Dependency.new 'pg', '~> 0.14' + # + # set = Gem::RequestSet.new nokogiri, pg + def initialize *deps @dependencies = deps Index: lib/rubygems/specification.rb =================================================================== --- lib/rubygems/specification.rb (revision 43316) +++ lib/rubygems/specification.rb (revision 43317) @@ -1390,16 +1390,27 @@ class Gem::Specification < Gem::BasicSpe https://github.com/ruby/ruby/blob/trunk/lib/rubygems/specification.rb#L1390 def build_extensions # :nodoc: return if default_gem? + return if extensions.empty? return if File.exist? gem_build_complete_path return if !File.writable?(base_dir) && !File.exist?(File.join(base_dir, 'extensions')) - gem_original_require 'rubygems/ext' - gem_original_require 'rubygems/user_interaction' + begin + # We need to require things in $LOAD_PATH without looking for the + # extension we are about to build. + unresolved_deps = Gem::Specification.unresolved_deps.dup + Gem::Specification.unresolved_deps.clear - Gem::DefaultUserInteraction.use_ui Gem::SilentUI.new do - builder = Gem::Ext::Builder.new self - builder.build_extensions + require 'rubygems/config_file' + require 'rubygems/ext' + require 'rubygems/user_interaction' + + Gem::DefaultUserInteraction.use_ui Gem::SilentUI.new do + builder = Gem::Ext::Builder.new self + builder.build_extensions + end + ensure + Gem::Specification.unresolved_deps.replace unresolved_deps end end Index: lib/rubygems/installer.rb =================================================================== --- lib/rubygems/installer.rb (revision 43316) +++ lib/rubygems/installer.rb (revision 43317) @@ -4,6 +4,7 @@ https://github.com/ruby/ruby/blob/trunk/lib/rubygems/installer.rb#L4 # See LICENSE.txt for permissions. #++ +require 'rubygems/command' require 'rubygems/exceptions' require 'rubygems/package' require 'rubygems/ext' Index: test/rubygems/test_gem.rb =================================================================== --- test/rubygems/test_gem.rb (revision 43316) +++ test/rubygems/test_gem.rb (revision 43317) @@ -1,6 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1 # coding: US-ASCII require 'rubygems/test_case' require 'rubygems' +require 'rubygems/command' require 'rubygems/installer' require 'pathname' require 'tmpdir' Index: test/rubygems/test_gem_specification.rb =================================================================== --- test/rubygems/test_gem_specification.rb (revision 43316) +++ test/rubygems/test_gem_specification.rb (revision 43317) @@ -1210,6 +1210,15 @@ dependencies: [] https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_specification.rb#L1210 FileUtils.chmod 0755, @gemhome end + def test_build_extensions_none + refute_path_exists @a1.extension_install_dir, 'sanity check' + assert_empty @a1.extensions, 'sanity check' + + @a1.build_extensions + + refute_path_exists @a1.extension_install_dir + end + def test_contains_requirable_file_eh code_rb = File.join @a1.gem_dir, 'lib', 'code.rb' FileUtils.mkdir_p File.dirname code_rb -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/