Class: Degem::ParseGemfile

Inherits:
Object
  • Object
show all
Defined in:
lib/degem/parse_gemfile.rb

Instance Method Summary collapse

Constructor Details

#initialize(gem_specification = Gem::Specification) ⇒ ParseGemfile

Returns a new instance of ParseGemfile.



5
6
7
# File 'lib/degem/parse_gemfile.rb', line 5

def initialize(gem_specification = Gem::Specification)
  @gem_specification = gem_specification
end

Instance Method Details

#call(gemfile_path) ⇒ Object



9
10
11
12
13
# File 'lib/degem/parse_gemfile.rb', line 9

def call(gemfile_path)
  dsl = Bundler::Dsl.new
  dsl.eval_gemfile(gemfile_path)
  Gemfile.new(dsl: dsl, gem_specification: @gem_specification)
end