Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
[LockfileParser] Support for old RG on Ruby 2.3+
Browse files Browse the repository at this point in the history
  • Loading branch information
segiddins committed Jun 22, 2016
1 parent 958d78f commit 0994045
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/bundler/lockfile_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ class LockfileParser
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
Expand All @@ -46,7 +48,7 @@ def self.unknown_sections_in_lockfile(lockfile_contents)

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
Expand Down

0 comments on commit 0994045

Please sign in to comment.