Bug #3102 ยป rgems.patch
| lib/rubygems/specification.rb | ||
|---|---|---|
|
}
|
||
|
end
|
||
|
def to_yaml(opts = {}) # :nodoc:
|
||
|
def encode_with coder # :nodoc:
|
||
|
mark_version
|
||
|
attributes = @@attributes.map { |name,| name.to_s }.sort
|
||
|
attributes = attributes - %w[name version platform]
|
||
|
coder.add 'name', @name
|
||
|
coder.add 'version', @version
|
||
|
platform = case @original_platform
|
||
|
when nil, '' then
|
||
|
'ruby'
|
||
|
when String then
|
||
|
@original_platform
|
||
|
else
|
||
|
@original_platform.to_s
|
||
|
end
|
||
|
coder.add 'platform', platform
|
||
|
attributes.each do |name|
|
||
|
coder.add name, instance_variable_get("@#{name}")
|
||
|
end
|
||
|
end
|
||
|
def to_yaml(opts = {}) # :nodoc:
|
||
|
unless YAML.const_defined?(:ENGINE) && YAML::ENGINE.syck?
|
||
|
return super
|
||
|
end
|
||
|
yaml = YAML.quick_emit object_id, opts do |out|
|
||
|
out.map taguri, to_yaml_style do |map|
|
||
|
map.add 'name', @name
|
||
|
map.add 'version', @version
|
||
|
platform = case @original_platform
|
||
|
when nil, '' then
|
||
|
'ruby'
|
||
|
when String then
|
||
|
@original_platform
|
||
|
else
|
||
|
@original_platform.to_s
|
||
|
end
|
||
|
map.add 'platform', platform
|
||
|
attributes.each do |name|
|
||
|
map.add name, instance_variable_get("@#{name}")
|
||
|
end
|
||
|
encode_with map
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
def init_with coder # :nodoc:
|
||
|
yaml_initialize coder.tag, coder.map
|
||
|
end
|
||
|
def yaml_initialize(tag, vals) # :nodoc:
|
||
|
vals.each do |ivar, val|
|
||
|
instance_variable_set "@#{ivar}", val
|
||
| test/rubygems/gemutilities.rb | ||
|---|---|---|
|
require 'rubygems'
|
||
|
end
|
||
|
require 'fileutils'
|
||
|
begin
|
||
|
gem 'minitest', '>= 1.3.1'
|
||
|
require 'minitest/unit'
|
||
|
rescue Gem::LoadError
|
||
|
warn "Install minitest gem >= 1.3.1"
|
||
|
raise
|
||
|
end
|
||
|
require 'minitest/unit'
|
||
|
require 'tmpdir'
|
||
|
require 'uri'
|
||
|
require 'rubygems/package'
|
||
|
require 'rubygems/test_utilities'
|
||
|
require 'pp'
|
||
|
require 'yaml'
|
||
|
YAML::ENGINE.yamler = 'psych'
|
||
|
begin
|
||
|
gem 'rdoc'
|
||