diff options
author | Carl Lerche <carllerche@mac.com> | 2010-06-01 13:28:03 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-06-01 13:28:03 -0700 |
commit | 1639a9763a94af23e77a179f936069ddd13ebc52 (patch) | |
tree | e6db8b1917b471627dd8992d24c440a3c74e04d5 /lib/bundler/lockfile_parser.rb | |
parent | 4bc9f4fbef551ec2da7cb08db85e2ad1d988e634 (diff) | |
download | bundler-1639a9763a94af23e77a179f936069ddd13ebc52.tar.gz |
Persist Gem::Platform.local to the lockfile
Diffstat (limited to 'lib/bundler/lockfile_parser.rb')
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index edfa0430..2178939a 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -2,9 +2,10 @@ require "strscan" module Bundler class LockfileParser - attr_reader :sources, :dependencies, :specs + attr_reader :sources, :dependencies, :specs, :platforms def initialize(lockfile) + @platforms = [] @sources = [] @dependencies = [] @specs = [] @@ -13,6 +14,8 @@ module Bundler lockfile.split(/\n+/).each do |line| if line == "DEPENDENCIES" @state = :dependency + elsif line == "PLATFORMS" + @state = :platform else send("parse_#{@state}", line) end @@ -81,5 +84,11 @@ module Bundler @current_spec.dependencies << Gem::Dependency.new($1, $2) end end + + def parse_platform(line) + if line =~ /^ (.*)$/ + @platforms << Gem::Platform.new($1) + end + end end end
\ No newline at end of file |