From 1639a9763a94af23e77a179f936069ddd13ebc52 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Tue, 1 Jun 2010 13:28:03 -0700 Subject: Persist Gem::Platform.local to the lockfile --- lib/bundler/lockfile_parser.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/bundler/lockfile_parser.rb') 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 -- cgit v1.2.3