Parent

Methods

Class/Module Index [+]

Quicksearch

Bundler::LockfileParser

Attributes

dependencies[R]
platforms[R]
sources[R]
specs[R]

Public Class Methods

new(lockfile) click to toggle source
# File lib/bundler/lockfile_parser.rb, line 25
def initialize(lockfile)
  @platforms    = []
  @sources      = []
  @dependencies = []
  @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."
  end

  lockfile.split(/(?:\r?\n)+/).each do |line|
    if line == DEPENDENCIES
      @state = :dependency
    elsif line == PLATFORMS
      @state = :platform
    else
      send("parse_#{@state}", line)
    end
  end
  @sources << @rubygems_aggregate
  @specs = @specs.values
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.