Class: Appraisal::Git

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

Constant Summary

Constants inherited from BundlerDSL

BundlerDSL::PARTS

Instance Attribute Summary

Attributes inherited from BundlerDSL

#dependencies

Instance Method Summary collapse

Methods inherited from BundlerDSL

#eval_gemfile, #gem, #gemspec, #git, #git_source, #group, #install_if, #path, #platforms, #remove_gem, #ruby, #run, #source

Constructor Details

#initialize(source, options = {}) ⇒ Git

Returns a new instance of Git.



8
9
10
11
12
# File 'lib/appraisal/git.rb', line 8

def initialize(source, options = {})
  super()
  @source = source
  @options = options
end

Instance Method Details

#for_dupObject

:nodoc:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/appraisal/git.rb', line 31

def for_dup
  if @options.empty?
    <<-OUTPUT.rstrip
git #{@source.inspect} do
#{indent(super)}
end
    OUTPUT
  else
    <<-OUTPUT.rstrip
git #{@source.inspect}, #{Utils.format_string(@options)} do
#{indent(super)}
end
    OUTPUT
  end
end

#to_sObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/appraisal/git.rb', line 14

def to_s
  if @options.empty?
    <<-OUTPUT.rstrip
git #{Utils.prefix_path(@source).inspect} do
#{indent(super)}
end
    OUTPUT
  else
    <<-OUTPUT.rstrip
git #{Utils.prefix_path(@source).inspect}, #{Utils.format_string(@options)} do
#{indent(super)}
end
    OUTPUT
  end
end