Class: Crosstest::Psychic::Factories::HotReadScriptFactory

Inherits:
ScriptFactory show all
Defined in:
lib/crosstest/psychic/factories/hot_read_task_factory.rb

Constant Summary

Constants inherited from ScriptFactory

ScriptFactory::TASK_PRIORITY

Constants inherited from Crosstest::Psychic::FactoryManager

Crosstest::Psychic::FactoryManager::BUILT_IN_DIR

Instance Attribute Summary

Attributes inherited from ScriptFactory

#priority, #psychic, #run_patterns

Attributes inherited from Crosstest::Psychic::FactoryManager

#factories

Instance Method Summary collapse

Methods inherited from ScriptFactory

#active?, #cwd, #initialize, #known_scripts, priority_for_script, register_script_factory, run_patterns, runs

Methods inherited from Crosstest::Psychic::FactoryManager

#active?, #active_factories, autoload_factories!, clear, factory_classes, #initialize, register_factory

Constructor Details

This class inherits a constructor from Crosstest::Psychic::ScriptFactory

Instance Method Details

#command_for_script(script) ⇒ Object


48
49
50
# File 'lib/crosstest/psychic/factories/hot_read_task_factory.rb', line 48

def command_for_script(script)
  script_hints[script] || hot_task_factory.command_for_task(:run_script)
end

#hot_task_factoryObject


34
35
36
# File 'lib/crosstest/psychic/factories/hot_read_task_factory.rb', line 34

def hot_task_factory
  psychic.task_factory_manager.active? HotReadTaskFactory
end

#known_script?(script) ⇒ Boolean

Returns:

  • (Boolean)

30
31
32
# File 'lib/crosstest/psychic/factories/hot_read_task_factory.rb', line 30

def known_script?(script)
  script_hints.key? script
end

#priority_for_script(script) ⇒ Object


38
39
40
41
42
43
44
45
46
# File 'lib/crosstest/psychic/factories/hot_read_task_factory.rb', line 38

def priority_for_script(script)
  if known_script? script
    9
  elsif hot_task_factory.known_task? :run_script
    7
  else
    nil
  end
end

#script_hintsObject


26
27
28
# File 'lib/crosstest/psychic/factories/hot_read_task_factory.rb', line 26

def script_hints
  psychic.hints.scripts
end