summaryrefslogtreecommitdiff
path: root/lib/rubygems/specification.rb
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems/specification.rb52
1 files changed, 38 insertions, 14 deletions
@@ -1,3 +1,9 @@
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
@@ -498,17 +504,37 @@ class Gem::Specification
end
##
- # Loads ruby format gemspec from +filename+
- def self.load(filename)
- gemspec = nil
- raise "NESTED Specification.load calls not allowed!" if @@gather
- @@gather = proc { |gs| gemspec = gs }
- data = File.read filename
- eval data, nil, filename
- gemspec
- ensure
- @@gather = nil
end
##
@@ -672,8 +698,7 @@ class Gem::Specification
def hash # :nodoc:
@@attributes.inject(0) { |hash_code, (name, _)|
- n = self.send(name).hash
- hash_code + n
}
end
@@ -765,7 +790,6 @@ class Gem::Specification
result << nil
result << " if s.respond_to? :specification_version then"
- result << " current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION"
result << " s.specification_version = #{specification_version}"
result << nil
@@ -909,7 +933,7 @@ class Gem::Specification
# Warnings
- %w[author description email homepage rubyforge_project summary].each do |attribute|
value = self.send attribute
alert_warning "no #{attribute} specified" if value.nil? or value.empty?
end