ruby-changes:57951
From: Daniel <ko1@a...>
Date: Fri, 27 Sep 2019 01:17:51 +0900 (JST)
Subject: [ruby-changes:57951] 8436b2717c (master): [rubygems/rubygems] Add a gem attr to the Gem::Package class.
https://git.ruby-lang.org/ruby.git/commit/?id=8436b2717c From 8436b2717c458a554dd81456a8e6e030e2c3e038 Mon Sep 17 00:00:00 2001 From: Daniel Berger <dberger@r...> Date: Thu, 11 Jul 2019 09:20:43 -0400 Subject: [rubygems/rubygems] Add a gem attr to the Gem::Package class. https://github.com/rubygems/rubygems/commit/5b81f364ae diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index 49cdf98..16cda5a 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -100,6 +100,11 @@ class Gem::Package https://github.com/ruby/ruby/blob/trunk/lib/rubygems/package.rb#L100 attr_reader :files ## + # Reference to the gem being packaged. + + attr_reader :gem + + ## # The security policy used for verifying the contents of this package. attr_accessor :security_policy diff --git a/test/rubygems/test_gem_package.rb b/test/rubygems/test_gem_package.rb index e07304e..f2f712e 100644 --- a/test/rubygems/test_gem_package.rb +++ b/test/rubygems/test_gem_package.rb @@ -1093,6 +1093,11 @@ class TestGemPackage < Gem::Package::TarTestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_package.rb#L1093 assert_equal @spec, package.spec end + def test_gem_attr + package = Gem::Package.new(@gem) + assert_equal(package.gem, @gem) + end + def test_spec_from_io # This functionality is used by rubygems.org to extract spec data from an # uploaded gem before it is written to storage. -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/