Module: Perkins::Build::Script::Helpers

Included in:
Perkins::Build::Script
Defined in:
lib/perkins/build/script/helpers.rb

Instance Method Summary collapse

Instance Method Details

#announce?(stage) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/perkins/build/script/helpers.rb', line 33

def announce?(stage)
  stage && stage != :after_result
end

#before_installObject



29
30
31
# File 'lib/perkins/build/script/helpers.rb', line 29

def before_install
  puts "before install"
end

#failure(message) ⇒ Object



16
17
18
19
# File 'lib/perkins/build/script/helpers.rb', line 16

def failure(message)
  echo message
  raw 'false'
end

#shObject



12
13
14
# File 'lib/perkins/build/script/helpers.rb', line 12

def sh
  stack.last
end

#stackingObject



21
22
23
24
25
26
27
# File 'lib/perkins/build/script/helpers.rb', line 21

def stacking
  ->(sh) {
    stack.push(sh)
    yield(sh) if block_given?
    stack.pop
  }
end