[rubygems/rubygems] Consolidated the Ruby version list:
- We keep 2 list of supported ruby versions and each time a new ruby version is released we need to maintain both list. Forgetting to update one would prevent users from adding gem for a specific plaftorm (i.e. https://github.com/rubygems/rubygems/commit/7cd19d824d17 and https://github.com/rubygems/rubygems/commit/5462322f8f0c). Extracted the list from the Dependency class and moved it to the CurrentRuby class (which I believe was originally added for that reason). https://github.com/rubygems/rubygems/commit/a91edd6c1f
This commit is contained in:
parent
57fec1e85f
commit
dc7c665105
@ -9,26 +9,9 @@ module Bundler
|
||||
end
|
||||
|
||||
class CurrentRuby
|
||||
KNOWN_MINOR_VERSIONS = %w[
|
||||
1.8
|
||||
1.9
|
||||
2.0
|
||||
2.1
|
||||
2.2
|
||||
2.3
|
||||
2.4
|
||||
2.5
|
||||
2.6
|
||||
2.7
|
||||
3.0
|
||||
3.1
|
||||
3.2
|
||||
3.3
|
||||
3.4
|
||||
3.5
|
||||
].freeze
|
||||
|
||||
KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
|
||||
ALL_RUBY_VERSIONS = (18..27).to_a.concat((30..35).to_a).freeze
|
||||
KNOWN_MINOR_VERSIONS = ALL_RUBY_VERSIONS.map {|v| v.digits.reverse.join(".") }.freeze
|
||||
KNOWN_MAJOR_VERSIONS = ALL_RUBY_VERSIONS.map {|v| v.digits.last.to_s }.uniq.freeze
|
||||
|
||||
KNOWN_PLATFORMS = %w[
|
||||
jruby
|
||||
|
@ -9,19 +9,18 @@ module Bundler
|
||||
attr_reader :autorequire
|
||||
attr_reader :groups, :platforms, :gemfile, :path, :git, :github, :branch, :ref, :glob
|
||||
|
||||
ALL_RUBY_VERSIONS = (18..27).to_a.concat((30..35).to_a).freeze
|
||||
PLATFORM_MAP = {
|
||||
ruby: [Gem::Platform::RUBY, ALL_RUBY_VERSIONS],
|
||||
mri: [Gem::Platform::RUBY, ALL_RUBY_VERSIONS],
|
||||
ruby: [Gem::Platform::RUBY, CurrentRuby::ALL_RUBY_VERSIONS],
|
||||
mri: [Gem::Platform::RUBY, CurrentRuby::ALL_RUBY_VERSIONS],
|
||||
rbx: [Gem::Platform::RUBY],
|
||||
truffleruby: [Gem::Platform::RUBY],
|
||||
jruby: [Gem::Platform::JAVA, [18, 19]],
|
||||
windows: [Gem::Platform::WINDOWS, ALL_RUBY_VERSIONS],
|
||||
windows: [Gem::Platform::WINDOWS, CurrentRuby::ALL_RUBY_VERSIONS],
|
||||
# deprecated
|
||||
mswin: [Gem::Platform::MSWIN, ALL_RUBY_VERSIONS],
|
||||
mswin64: [Gem::Platform::MSWIN64, ALL_RUBY_VERSIONS - [18]],
|
||||
mingw: [Gem::Platform::MINGW, ALL_RUBY_VERSIONS],
|
||||
x64_mingw: [Gem::Platform::X64_MINGW, ALL_RUBY_VERSIONS - [18, 19]],
|
||||
mswin: [Gem::Platform::MSWIN, CurrentRuby::ALL_RUBY_VERSIONS],
|
||||
mswin64: [Gem::Platform::MSWIN64, CurrentRuby::ALL_RUBY_VERSIONS - [18]],
|
||||
mingw: [Gem::Platform::MINGW, CurrentRuby::ALL_RUBY_VERSIONS],
|
||||
x64_mingw: [Gem::Platform::X64_MINGW, CurrentRuby::ALL_RUBY_VERSIONS - [18, 19]],
|
||||
}.each_with_object({}) do |(platform, spec), hash|
|
||||
hash[platform] = spec[0]
|
||||
spec[1]&.each {|version| hash[:"#{platform}_#{version}"] = spec[0] }
|
||||
|
Loading…
x
Reference in New Issue
Block a user