aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJosef Šimánek <josef.simanek@gmail.com>2020-04-10 18:58:04 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 07:38:50 +0900
commit4dd46dbad046c0c5902f0217243c3207dbb274b5 (patch)
tree6ae464b5414df81473bf67780895ace9672d5f34 /lib
parent60cafe8ea95cd86bbb7099aaddb934bee3a13781 (diff)
downloadruby-4dd46dbad046c0c5902f0217243c3207dbb274b5.tar.gz
[rubygems/rubygems] Deprecate rubyforge_project attribute only during build time.
https://github.com/rubygems/rubygems/commit/c44eb21648
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/specification.rb5
-rw-r--r--lib/rubygems/specification_policy.rb10
2 files changed, 12 insertions, 3 deletions
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 18e3f2d20d..6ff9a89699 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -728,12 +728,11 @@ class Gem::Specification < Gem::BasicSpecification
attr_writer :original_platform # :nodoc:
##
- # Deprecated and ignored.
+ # Deprecated via specification policy and ignored during runtime.
#
# Formerly used to set rubyforge project.
- attr_writer :rubyforge_project
- rubygems_deprecate :rubyforge_project=
+ attr_accessor :rubyforge_project
##
# The Gem::Specification version of this gemspec.
diff --git a/lib/rubygems/specification_policy.rb b/lib/rubygems/specification_policy.rb
index d9f415d25f..8d4958c001 100644
--- a/lib/rubygems/specification_policy.rb
+++ b/lib/rubygems/specification_policy.rb
@@ -21,6 +21,8 @@ class Gem::SpecificationPolicy
funding_uri
].freeze # :nodoc:
+ DEPRECATED_ATTRIBUTES = [:rubyforge_project].freeze #:nodoc:
+
def initialize(specification)
@warnings = 0
@@ -76,6 +78,8 @@ class Gem::SpecificationPolicy
validate_dependencies
+ validate_deprecated_attributes
+
if @warnings > 0
if strict
error "specification has warnings"
@@ -409,6 +413,12 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
warning "#{executable_path} is missing #! line"
end
+ def validate_deprecated_attributes # :nodoc:
+ DEPRECATED_ATTRIBUTES.each do |attr|
+ warning("#{attr} is deprecated") unless @specification.send(attr).nil?
+ end
+ end
+
def warning(statement) # :nodoc:
@warnings += 1