spec()public
The specification for this gem
# File lib/rubygems/package/old.rb, line 133
def spec
verify
return @spec if @spec
yaml = String.new
@gem.with_read_io do |io|
skip_ruby io
read_until_dashes io do |line|
yaml << line
end
end
yaml_error = if RUBY_VERSION < '1.9' then
YAML::ParseError
elsif YAML.const_defined?(:ENGINE) && YAML::ENGINE.yamler == 'syck' then
YAML::ParseError
else
YAML::SyntaxError
end
begin
@spec = Gem::Specification.from_yaml yaml
rescue yaml_error
raise Gem::Exception, "Failed to parse gem specification out of gem file"
end
rescue ArgumentError
raise Gem::Exception, "Failed to parse gem specification out of gem file"
end Related methods
- Instance methods
- contents
- extract_files
- file_list
- read_until_dashes
- skip_ruby
- spec
- verify
- Class methods
- new