diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-06-24 11:19:04 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-06-24 11:19:04 -0500 |
commit | 6942878fdd3adf976cf420dcf0d370c08dc86528 (patch) | |
tree | 7218250536a4322695c5dd2186d7aaca52b65b21 | |
parent | 1615871d0797bd664769d6a85a7e97c0fa76ebc0 (diff) | |
download | bundler-6942878fdd3adf976cf420dcf0d370c08dc86528.tar.gz |
[LockfileParser] Keep duplicate path sources
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index db977a8db6..57e6372f02 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -129,13 +129,7 @@ module Bundler when GEM @opts["remotes"] = @opts.delete("remote") end - @current_source = TYPES[@type].from_lock(@opts) - # Strip out duplicate sections - if @sources.include?(@current_source) - @current_source = @sources.find {|s| s == @current_source } - else - @sources << @current_source - end + add_source(TYPES[@type].from_lock(@opts)) when OPTIONS value = $2 value = true if value == "true" @@ -154,6 +148,16 @@ module Bundler end end + def add_source(source) + # Strip out duplicate sections + if @sources.include?(source) && !source.instance_of?(Bundler::Source::Path) + @current_source = @sources.find {|s| s == @current_source } + else + @current_source = source + @sources << @current_source + end + end + NAME_VERSION = '(?! )(.*?)(?: \(([^-]*)(?:-(.*))?\))?'.freeze NAME_VERSION_2 = /^ {2}#{NAME_VERSION}(!)?$/ NAME_VERSION_4 = /^ {4}#{NAME_VERSION}$/ |