End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::Specification.from_yaml
from_yaml(input)
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/specification.rb, line 1064
def self.from_yaml(input)
Gem.load_yaml
input = normalize_yaml_input input
spec = Gem::SafeYAML.safe_load input
if spec && spec.class == FalseClass
raise Gem::EndOfYAMLException
end
unless Gem::Specification === spec
raise Gem::Exception, "YAML data doesn't evaluate to gem specification"
end
spec.specification_version ||= NONEXISTENT_SPECIFICATION_VERSION
spec.reset_nil_attributes_to_default
spec
end
Special loader for YAML files. When a Specification object is loaded from a YAML file, it bypasses the normal Ruby object initialization routine (initialize). This method makes up for that and deals with gems of different ages.
input can be anything that YAML.load() accepts: String or IO.
See also
.find_in_unresolved_tree
.gemspec_stubs_in
.find_in_unresolved
.installed_stubs
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1