mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Rename Gem::Package.metadata to Gem::Package.raw_spec
https://github.com/rubygems/rubygems/commit/a76f25dff0
This commit is contained in:
parent
38daeded66
commit
6bd7772361
3 changed files with 6 additions and 4 deletions
|
@ -85,7 +85,7 @@ command help for an example.
|
|||
end
|
||||
|
||||
if @options[:spec]
|
||||
spec, metadata = Gem::Package.metadata(path, security_policy)
|
||||
spec, metadata = Gem::Package.raw_spec(path, security_policy)
|
||||
|
||||
if metadata.nil?
|
||||
alert_error "--spec is unsupported on '#{name}' (old format gem)"
|
||||
|
@ -173,4 +173,5 @@ command help for an example.
|
|||
|
||||
path
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -161,7 +161,7 @@ class Gem::Package
|
|||
# +path+.
|
||||
#--
|
||||
|
||||
def self.metadata(path, security_policy = nil)
|
||||
def self.raw_spec(path, security_policy = nil)
|
||||
format = new(path, security_policy)
|
||||
spec = format.spec
|
||||
|
||||
|
@ -716,6 +716,7 @@ EOM
|
|||
rescue Zlib::GzipFile::Error => e
|
||||
raise Gem::Package::FormatError.new(e.message, entry.full_name)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
require 'rubygems/package/digest_io'
|
||||
|
|
|
@ -420,7 +420,7 @@ class TestGemPackage < Gem::Package::TarTestCase
|
|||
assert_equal %w[lib/code.rb], reader.contents
|
||||
end
|
||||
|
||||
def test_metadata
|
||||
def test_raw_spec
|
||||
data_tgz = util_tar_gz { }
|
||||
|
||||
gem = util_tar do |tar|
|
||||
|
@ -441,7 +441,7 @@ class TestGemPackage < Gem::Package::TarTestCase
|
|||
io.write gem.string
|
||||
end
|
||||
|
||||
spec, metadata = Gem::Package.metadata(gem_path)
|
||||
spec, metadata = Gem::Package.raw_spec(gem_path)
|
||||
|
||||
assert_equal @spec, spec
|
||||
assert_match @spec.to_yaml, metadata.force_encoding("UTF-8")
|
||||
|
|
Loading…
Reference in a new issue