diff options
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index e0c6dd1c..a57dbcac 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -27,9 +27,11 @@ module Bundler SOURCE = [GIT, GEM, PATH].freeze SECTIONS_BY_VERSION_INTRODUCED = { - Gem::Version.create("1.0") => [DEPENDENCIES, PLATFORMS, GIT, GEM, PATH].freeze, - Gem::Version.create("1.10") => [BUNDLED].freeze, - Gem::Version.create("1.12") => [RUBY].freeze, + # The strings have to be dup'ed for old RG on Ruby 2.3+ + # TODO: remove dup in Bundler 2.0 + Gem::Version.create("1.0".dup) => [DEPENDENCIES, PLATFORMS, GIT, GEM, PATH].freeze, + Gem::Version.create("1.10".dup) => [BUNDLED].freeze, + Gem::Version.create("1.12".dup) => [RUBY].freeze, }.freeze KNOWN_SECTIONS = SECTIONS_BY_VERSION_INTRODUCED.values.flatten.freeze @@ -46,7 +48,7 @@ module Bundler def self.sections_to_ignore(base_version = nil) base_version &&= base_version.release - base_version ||= Gem::Version.create("1.0") + base_version ||= Gem::Version.create("1.0".dup) attributes = [] SECTIONS_BY_VERSION_INTRODUCED.each do |version, introduced| next if version <= base_version |