aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/lockfile_parser.rb
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-05-16 22:50:09 -0700
committerAndre Arko <andre@arko.net>2015-05-16 22:50:09 -0700
commit86c0b7775690f5b00fe3f3f73ae407b2fa6db875 (patch)
tree54e974cb12ed5148f35b8d1213b1a9d7b08a4273 /lib/bundler/lockfile_parser.rb
parent7536f442674f3a8d8407fdf72719559340783a77 (diff)
parentbe432f5bceacf37e08d4dc8e3a727717260f18f7 (diff)
downloadbundler-86c0b7775690f5b00fe3f3f73ae407b2fa6db875.tar.gz
Merge tag 'v1.9.9' into 1-10-stable
Version 1.9.9 Conflicts: CHANGELOG.md lib/bundler/fetcher.rb lib/bundler/lockfile_parser.rb lib/bundler/version.rb
Diffstat (limited to 'lib/bundler/lockfile_parser.rb')
-rw-r--r--lib/bundler/lockfile_parser.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb
index 21367fe7..c499d9a0 100644
--- a/lib/bundler/lockfile_parser.rb
+++ b/lib/bundler/lockfile_parser.rb
@@ -22,12 +22,13 @@ module Bundler
PATH = "PATH"
SPECS = " specs:"
OPTIONS = /^ ([a-z]+): (.*)$/i
+ SOURCE = [GIT, GEM, PATH]
def initialize(lockfile)
@platforms = []
@sources = []
@dependencies = []
- @state = :source
+ @state = nil
@specs = {}
@rubygems_aggregate = Source::Rubygems.new
@@ -38,13 +39,18 @@ module Bundler
end
lockfile.split(/(?:\r?\n)+/).each do |line|
- if line == DEPENDENCIES
+ if SOURCE.include?(line)
+ @state = :source
+ parse_source(line)
+ elsif line == DEPENDENCIES
@state = :dependency
elsif line == PLATFORMS
@state = :platform
elsif line == BUNDLED
@state = :bundled_with
- else
+ elsif line =~ /^[^\s]/
+ @state = nil
+ elsif @state
send("parse_#{@state}", line)
end
end