mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Drop support for old Gem::Specification
versions
`specification_version` method was added before RubyGems 1.0, and `add_runtime_dependency` method was before 1.2. These seem aged enough to remove. https://github.com/rubygems/rubygems/commit/92770c5cd9
This commit is contained in:
parent
6c1d7dab52
commit
5ae83151b1
2 changed files with 10 additions and 41 deletions
|
@ -2518,25 +2518,14 @@ class Gem::Specification < Gem::BasicSpecification
|
|||
|
||||
unless dependencies.empty?
|
||||
result << nil
|
||||
result << " if s.respond_to? :specification_version then"
|
||||
result << " s.specification_version = #{specification_version}"
|
||||
result << " end"
|
||||
result << nil
|
||||
|
||||
result << " if s.respond_to? :add_runtime_dependency then"
|
||||
|
||||
dependencies.each do |dep|
|
||||
req = dep.requirements_list.inspect
|
||||
dep.instance_variable_set :@type, :runtime if dep.type.nil? # HACK
|
||||
result << " s.add_#{dep.type}_dependency(%q<#{dep.name}>.freeze, #{req})"
|
||||
end
|
||||
|
||||
result << " else"
|
||||
dependencies.each do |dep|
|
||||
version_reqs_param = dep.requirements_list.inspect
|
||||
result << " s.add_dependency(%q<#{dep.name}>.freeze, #{version_reqs_param})"
|
||||
end
|
||||
result << " end"
|
||||
end
|
||||
|
||||
result << "end"
|
||||
|
|
|
@ -2267,15 +2267,9 @@ Gem::Specification.new do |s|
|
|||
s.rubygems_version = "#{Gem::VERSION}".freeze
|
||||
s.summary = "this is a summary".freeze
|
||||
|
||||
if s.respond_to? :specification_version then
|
||||
s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
|
||||
end
|
||||
|
||||
if s.respond_to? :add_runtime_dependency then
|
||||
s.add_runtime_dependency(%q<b>.freeze, [\"= 1\"])
|
||||
else
|
||||
s.add_dependency(%q<b>.freeze, [\"= 1\"])
|
||||
end
|
||||
end
|
||||
SPEC
|
||||
|
||||
|
@ -2347,15 +2341,9 @@ Gem::Specification.new do |s|
|
|||
|
||||
s.installed_by_version = "#{Gem::VERSION}" if s.respond_to? :installed_by_version
|
||||
|
||||
if s.respond_to? :specification_version then
|
||||
s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
|
||||
end
|
||||
|
||||
if s.respond_to? :add_runtime_dependency then
|
||||
s.add_runtime_dependency(%q<b>.freeze, [\"= 1\"])
|
||||
else
|
||||
s.add_dependency(%q<b>.freeze, [\"= 1\"])
|
||||
end
|
||||
end
|
||||
SPEC
|
||||
|
||||
|
@ -2406,19 +2394,11 @@ Gem::Specification.new do |s|
|
|||
s.summary = "this is a summary".freeze
|
||||
s.test_files = ["test/suite.rb".freeze]
|
||||
|
||||
if s.respond_to? :specification_version then
|
||||
s.specification_version = 4
|
||||
end
|
||||
|
||||
if s.respond_to? :add_runtime_dependency then
|
||||
s.add_runtime_dependency(%q<rake>.freeze, [\"> 0.4\"])
|
||||
s.add_runtime_dependency(%q<jabber4r>.freeze, [\"> 0.0.0\"])
|
||||
s.add_runtime_dependency(%q<pqa>.freeze, [\"> 0.4\", \"<= 0.6\"])
|
||||
else
|
||||
s.add_dependency(%q<rake>.freeze, [\"> 0.4\"])
|
||||
s.add_dependency(%q<jabber4r>.freeze, [\"> 0.0.0\"])
|
||||
s.add_dependency(%q<pqa>.freeze, [\"> 0.4\", \"<= 0.6\"])
|
||||
end
|
||||
end
|
||||
SPEC
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue