class Rake::Task

Constants

ALLOWED_FLOW_RULES

Public Instance Methods

add_flow_rule(rule, val) click to toggle source
# File lib/bow/rake.rb, line 116
def add_flow_rule(rule, val)
  return unless ALLOWED_FLOW_RULES.include? rule
  flow[rule.to_sym] = val
end
apply_revert_task() click to toggle source
# File lib/bow/rake.rb, line 69
def apply_revert_task
  revert_task = find_revert_task
  return if reverted? || !revert_task || revert_task.applied?
  result = revert_task.execute
  revert_task.apply if revert_task.run_once?
  revert
  flush_history
  result
end
clear() click to toggle source
# File lib/bow/rake.rb, line 79
def clear
  clear_flow
  orig__clear
end
Also aliased as: orig__clear
clear_flow() click to toggle source
# File lib/bow/rake.rb, line 84
def clear_flow
  @flow = {}
  self
end
disabled?() click to toggle source
# File lib/bow/rake.rb, line 89
def disabled?
  !enabled?
end
enabled?() click to toggle source
# File lib/bow/rake.rb, line 97
def enabled?
  !!flow[:enabled]
end
find_revert_task() click to toggle source
# File lib/bow/rake.rb, line 105
def find_revert_task
  return unless flow[:revert]
  application.lookup(flow[:revert], @scope)
end
flow() click to toggle source
# File lib/bow/rake.rb, line 101
def flow
  @flow ||= { enabled: true, run: :always, revert: nil }
end
orig__clear()
Alias for: clear
run_once?() click to toggle source
# File lib/bow/rake.rb, line 93
def run_once?
  flow[:run] == :once
end
unpack_flow(init_flow) click to toggle source

Add flow to the task.

# File lib/bow/rake.rb, line 111
def unpack_flow(init_flow)
  return unless init_flow
  init_flow.each { |rule, val| add_flow_rule(rule, val) }
end