class Crabfarm::Live::NavigatorRunner

Public Class Methods

new(_manager, _target) click to toggle source
# File lib/crabfarm/live/navigator_runner.rb, line 9
def initialize(_manager, _target)
  @manager = _manager
  @target = _target
  @rspec = true
  @params = {}
end

Public Instance Methods

clear_params() click to toggle source
# File lib/crabfarm/live/navigator_runner.rb, line 30
def clear_params
  @params = {}
  @rspec = false
end
dsl() click to toggle source
# File lib/crabfarm/live/navigator_runner.rb, line 16
def dsl
  @dsl ||= Dsl.new self
end
execute() click to toggle source
# File lib/crabfarm/live/navigator_runner.rb, line 39
def execute
  strategy = if @rspec
    NavigatorRunnerRSpec.new @manager, @target
  else
    NavigatorRunnerDirect.new @manager, memento, @target, @params
  end

  begin
    Factories::Context.with_decorator navigator_decorator do
      strategy.execute
    end

    @manager.show_primary_contents
    strategy.show_results
  rescue Crabfarm::LiveInterrupted
    Utils::Console.info "Execution interrupted"
  end
end
use_memento(_memento) click to toggle source
# File lib/crabfarm/live/navigator_runner.rb, line 20
def use_memento(_memento)
  @memento = _memento
  @rspec = false
end
use_params(_params={}) click to toggle source
# File lib/crabfarm/live/navigator_runner.rb, line 25
def use_params(_params={})
  @params = @params.merge _params
  @rspec = false
end
use_rspec() click to toggle source
# File lib/crabfarm/live/navigator_runner.rb, line 35
def use_rspec
  @rspec = true
end

Private Instance Methods

memento() click to toggle source
# File lib/crabfarm/live/navigator_runner.rb, line 60
def memento
  if @memento.nil? then memento_for(@target) else @memento end
end
memento_for(_class) click to toggle source
# File lib/crabfarm/live/navigator_runner.rb, line 64
def memento_for(_class)
  Utils::Naming.route_from_constant(_class.to_s).join File::SEPARATOR
end
navigator_decorator() click to toggle source