Class: Appraisal::Conditional

Inherits:
BundlerDSL show all
Defined in:
lib/appraisal/conditional.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

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

Constructor Details

#initialize(condition) ⇒ Conditional

Returns a new instance of Conditional.



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

def initialize(condition)
  super()
  @condition = condition
end

Instance Method Details

#for_dupObject

:nodoc:



18
19
20
21
22
# File 'lib/appraisal/conditional.rb', line 18

def for_dup
  return unless @condition.is_a?(String)

  "install_if #{@condition} do\n#{indent(super)}\nend"
end

#to_sObject



13
14
15
# File 'lib/appraisal/conditional.rb', line 13

def to_s
  "install_if #{@condition} do\n#{indent(super)}\nend"
end