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

ruby-changes:20606

From: drbrain <ko1@a...>
Date: Sun, 24 Jul 2011 01:25:02 +0900 (JST)
Subject: [ruby-changes:20606] drbrain:r32654 (ruby_1_9_3): * lib/rubygems/specification.rb: Restore behavior of

drbrain	2011-07-24 01:24:50 +0900 (Sun, 24 Jul 2011)

  New Revision: 32654

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

  Log:
    * lib/rubygems/specification.rb:  Restore behavior of
      Gem::Specification#loaded.  [Ruby 1.9 - Bug #5032]

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/lib/rubygems/specification.rb
    branches/ruby_1_9_3/test/rubygems/test_gem_specification.rb

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 32653)
+++ ruby_1_9_3/ChangeLog	(revision 32654)
@@ -1,3 +1,8 @@
+Sun Jul 24 01:24:31 2011  Eric Hodel  <drbrain@s...>
+
+	* lib/rubygems/specification.rb:  Restore behavior of
+	  Gem::Specification#loaded.  [Ruby 1.9 - Bug #5032]
+
 Sun Jul 24 01:14:49 2011  NARUSE, Yui  <naruse@r...>
 
 	* test/rake/test_rake_functional.rb (setup): Use __FILE__ for the base
Index: ruby_1_9_3/lib/rubygems/specification.rb
===================================================================
--- ruby_1_9_3/lib/rubygems/specification.rb	(revision 32653)
+++ ruby_1_9_3/lib/rubygems/specification.rb	(revision 32654)
@@ -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: ruby_1_9_3/test/rubygems/test_gem_specification.rb
===================================================================
--- ruby_1_9_3/test/rubygems/test_gem_specification.rb	(revision 32653)
+++ ruby_1_9_3/test/rubygems/test_gem_specification.rb	(revision 32654)
@@ -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/

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