mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[rubygems/rubygems] Unconditionally set installed_by_version
It has been supported since RubyGems 2.2.0 via4525e45a4d
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>bf39c583e8
This commit is contained in:
parent
7836626f92
commit
43e3416b70
6 changed files with 5 additions and 10 deletions
|
@ -131,7 +131,7 @@ module Bundler
|
|||
Bundler::Index.build do |index|
|
||||
files.each do |file|
|
||||
next unless spec = Bundler.load_gemspec(file)
|
||||
Bundler.rubygems.set_installed_by_version(spec)
|
||||
spec.installed_by_version = Gem::VERSION
|
||||
|
||||
spec.source = self
|
||||
Bundler.rubygems.validate(spec)
|
||||
|
|
|
@ -61,11 +61,6 @@ module Bundler
|
|||
nil
|
||||
end
|
||||
|
||||
def set_installed_by_version(spec, installed_by_version = Gem::VERSION)
|
||||
return unless spec.respond_to?(:installed_by_version=)
|
||||
spec.installed_by_version = Gem::Version.create(installed_by_version)
|
||||
end
|
||||
|
||||
def spec_missing_extensions?(spec, default = true)
|
||||
return spec.missing_extensions? if spec.respond_to?(:missing_extensions?)
|
||||
|
||||
|
|
|
@ -299,7 +299,7 @@ module Bundler
|
|||
# The gemspecs we cache should already be evaluated.
|
||||
spec = Bundler.load_gemspec(spec_path)
|
||||
next unless spec
|
||||
Bundler.rubygems.set_installed_by_version(spec)
|
||||
spec.installed_by_version = Gem::VERSION
|
||||
Bundler.rubygems.validate(spec)
|
||||
File.open(spec_path, "wb") {|file| file.write(spec.to_ruby) }
|
||||
end
|
||||
|
|
|
@ -148,7 +148,7 @@ module Bundler
|
|||
|
||||
def load_gemspec(file)
|
||||
return unless spec = Bundler.load_gemspec(file)
|
||||
Bundler.rubygems.set_installed_by_version(spec)
|
||||
spec.installed_by_version = Gem::VERSION
|
||||
spec
|
||||
end
|
||||
|
||||
|
|
|
@ -2472,7 +2472,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||
|
||||
if @installed_by_version
|
||||
result << nil
|
||||
result << " s.installed_by_version = #{ruby_code Gem::VERSION} if s.respond_to? :installed_by_version"
|
||||
result << " s.installed_by_version = #{ruby_code Gem::VERSION}"
|
||||
end
|
||||
|
||||
unless dependencies.empty?
|
||||
|
|
|
@ -2368,7 +2368,7 @@ Gem::Specification.new do |s|
|
|||
s.rubygems_version = "#{Gem::VERSION}".freeze
|
||||
s.summary = "this is a summary".freeze
|
||||
|
||||
s.installed_by_version = "#{Gem::VERSION}".freeze if s.respond_to? :installed_by_version
|
||||
s.installed_by_version = "#{Gem::VERSION}".freeze
|
||||
|
||||
s.specification_version = #{Gem::Specification::CURRENT_SPECIFICATION_VERSION}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue