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, #install_if, #path, #platforms, #remove_gem, #ruby, #source, #to_s

Constructor Details

This class inherits a constructor from Appraisal::BundlerDSL

Instance Method Details

#dupObject



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

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

#load(path) ⇒ Object



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

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

#run(definitions, path, line = 1) ⇒ Object



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

def run(definitions, path, line = 1)
  instance_eval(definitions, path, line) if definitions
end