aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/lockfile_parser.rb
diff options
context:
space:
mode:
authorTim Moore <tmoore@incrementalism.net>2014-08-24 13:43:01 +1000
committerTim Moore <tmoore@incrementalism.net>2014-08-24 13:43:01 +1000
commit1ce22ac8e0f3417f3ac89f799a1b80751ac7afe4 (patch)
tree3dc21055135f7d8f47ecc52ef2b6e1509aa4e8aa /lib/bundler/lockfile_parser.rb
parent473770c143ac720f5b115d3e82d395b01f12cb93 (diff)
parentea143105677c4e38a2ce57bf6faa3cb8b782ef68 (diff)
downloadbundler-1ce22ac8e0f3417f3ac89f799a1b80751ac7afe4.tar.gz
Merge tag 'v1.7.1'
Version 1.7.1 Conflicts: CHANGELOG.md lib/bundler/dsl.rb lib/bundler/index.rb lib/bundler/lockfile_parser.rb lib/bundler/source/rubygems.rb man/gemfile.5.ronn
Diffstat (limited to 'lib/bundler/lockfile_parser.rb')
-rw-r--r--lib/bundler/lockfile_parser.rb27
1 files changed, 20 insertions, 7 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index 59e97965..0511f0fc 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -30,6 +30,8 @@ module Bundler
@state = :source
@specs = {}
+ @rubygems_aggregate = Source::Rubygems.new
+
if lockfile.match(/<<<<<<<|=======|>>>>>>>|\|\|\|\|\|\|\|/)
raise LockfileError, "Your Gemfile.lock contains merge conflicts.\n" \
"Run `git checkout HEAD -- Gemfile.lock` first to get a clean lock."
@@ -44,6 +46,7 @@ module Bundler
send("parse_#{@state}", line)
end
end
+ @sources << @rubygems_aggregate
@specs = @specs.values
end
@@ -62,14 +65,24 @@ module Bundler
@current_source = nil
@opts, @type = {}, line
when SPECS
- @current_source = TYPES[@type].from_lock(@opts)
-
- # Strip out duplicate GIT / SVN sections
- if @sources.include?(@current_source) && (@current_source.is_a?(Bundler::Source::Git) || @current_source.is_a?(Bundler::Source::SVN))
- @current_source = @sources.find { |s| s == @current_source }
+ case @type
+ when "PATH"
+ @current_source = TYPES[@type].from_lock(@opts)
+ @sources << @current_source
+ when "GIT", "SVN"
+ @current_source = TYPES[@type].from_lock(@opts)
+ # Strip out duplicate GIT / SVN sections
+ if @sources.include?(@current_source)
+ @current_source = @sources.find { |s| s == @current_source }
+ else
+ @sources << @current_source
+ end
+ when "GEM"
+ Array(@opts["remote"]).each do |url|
+ @rubygems_aggregate.add_remote(url)
+ end
+ @current_source = @rubygems_aggregate
end
-
- @sources << @current_source
when OPTIONS
value = $2
value = true if value == "true"