* lib/rubygems/specification.rb: Restore behavior of

Gem::Specification#loaded.  [Ruby 1.9 - Bug #5032]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2011-07-23 16:05:19 +00:00
Родитель 1e52e56037
Коммит 6b3ec75c7f
3 изменённых файлов: 21 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sun Jul 24 01:04:50 2011 Eric Hodel <drbrain@segment7.net>
* 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@jeremyevans.net>
* error.c (rb_name_error_str): new function to raise NameError

Просмотреть файл

@ -219,9 +219,9 @@ class Gem::Specification
##
# 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 @@ class Gem::Specification
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 @@ class Gem::Specification
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 @@ class Gem::Specification
def initialize name = nil, version = nil
@loaded = false
@activated = false
@loaded_from = nil
@original_platform = nil

Просмотреть файл

@ -325,6 +325,16 @@ end
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"