class GemfileInterpreter

Constants

ReadonlyBundler
VERSION

Attributes

dependencies[R]
gems[R]

Public Class Methods

new(dir, gemfile: 'Gemfile', lockfile: nil) click to toggle source
# File lib/gemfile_interpreter.rb, line 8
def initialize dir, gemfile: 'Gemfile', lockfile: nil
  gemfile_path = File.join dir, gemfile
  lockfile_path = File.join dir, (lockfile || "#{gemfile}.lock")
  @parsed = nil
  @gems, @dependencies = ReadonlyBundler.load_gemfile gemfile_path, lockfile_path
  true
end

Public Instance Methods

parsed() click to toggle source
# File lib/gemfile_interpreter.rb, line 18
def parsed
  @parsed = Parser.parse gems, dependencies
end
to_json() click to toggle source
# File lib/gemfile_interpreter.rb, line 22
def to_json
  parsed.to_json
end
to_yaml() click to toggle source
# File lib/gemfile_interpreter.rb, line 26
def to_yaml
  parsed.to_yaml
end