Class: Appraisal::Gemfile

Inherits:
BundlerDSL show all
Defined in:
lib/appraisal/gemfile.rb

Overview

Load bundler Gemfiles and merge dependencies

Constant Summary

Constants inherited from BundlerDSL

BundlerDSL::PARTS

Instance Attribute Summary

Attributes inherited from BundlerDSL

#dependencies

Instance Method Summary collapse

Methods inherited from BundlerDSL

#for_dup, #gem, #gemspec, #git, #git_source, #group, #initialize, #path, #platforms, #ruby, #source, #to_s

Constructor Details

This class inherits a constructor from Appraisal::BundlerDSL

Instance Method Details

#dupObject


23
24
25
26
27
28
# File 'lib/appraisal/gemfile.rb', line 23

def dup
  Gemfile.new.tap do |gemfile|
    gemfile.git_sources = @git_sources
    gemfile.run(for_dup)
  end
end

#load(path) ⇒ Object


13
14
15
16
17
# File 'lib/appraisal/gemfile.rb', line 13

def load(path)
  if File.exist?(path)
    run(IO.read(path))
  end
end

#run(definitions) ⇒ Object


19
20
21
# File 'lib/appraisal/gemfile.rb', line 19

def run(definitions)
  instance_eval(definitions, __FILE__, __LINE__) if definitions
end