ruby-changes:20604
From: drbrain <ko1@a...>
Date: Sun, 24 Jul 2011 01:11:24 +0900 (JST)
Subject: [ruby-changes:20604] drbrain:r32652 (trunk): * lib/rubygems/specification.rb: Restore behavior of
drbrain 2011-07-24 01:05:19 +0900 (Sun, 24 Jul 2011) New Revision: 32652 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32652 Log: * lib/rubygems/specification.rb: Restore behavior of Gem::Specification#loaded. [Ruby 1.9 - Bug #5032] Modified files: trunk/ChangeLog trunk/lib/rubygems/specification.rb trunk/test/rubygems/test_gem_specification.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 32651) +++ ChangeLog (revision 32652) @@ -1,3 +1,8 @@ +Sun Jul 24 01:04:50 2011 Eric Hodel <drbrain@s...> + + * lib/rubygems/specification.rb: Restore behavior of + Gem::Specification#loaded. [Ruby 1.9 - Bug #5032] + Sun Jul 24 00:05:00 2011 Jeremy Evans <merch-redmine@j...> * error.c (rb_name_error_str): new function to raise NameError Index: lib/rubygems/specification.rb =================================================================== --- lib/rubygems/specification.rb (revision 32651) +++ lib/rubygems/specification.rb (revision 32652) @@ -219,9 +219,9 @@ ## # True when this gemspec has been activated. This attribute is not persisted. - attr_accessor :loaded + attr_accessor :loaded # :nodoc: - alias :loaded? :loaded + alias :loaded? :loaded # :nodoc: ## # True when this gemspec has been activated. This attribute is not persisted. @@ -689,6 +689,7 @@ spec.instance_variable_set :@platform, array[16].to_s spec.instance_variable_set :@license, array[17] spec.instance_variable_set :@loaded, false + spec.instance_variable_set :@activated, false spec end @@ -748,7 +749,8 @@ add_self_to_load_path Gem.loaded_specs[self.name] = self - self.activated = true + @activated = true + @loaded = true return true end @@ -1324,6 +1326,7 @@ def initialize name = nil, version = nil @loaded = false + @activated = false @loaded_from = nil @original_platform = nil Index: test/rubygems/test_gem_specification.rb =================================================================== --- test/rubygems/test_gem_specification.rb (revision 32651) +++ test/rubygems/test_gem_specification.rb (revision 32652) @@ -325,6 +325,16 @@ assert_equal 'old_platform', same_spec.original_platform end + def test_activate + @a2.activate + + assert @a2.activated? + + Deprecate.skip_during do + assert @a2.loaded? + end + end + def test_add_dependency_with_explicit_type gem = quick_spec "awesome", "1.0" do |awesome| awesome.add_development_dependency "monkey" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/