Class: Cch::Setup
- Inherits:
-
Object
- Object
- Cch::Setup
- Defined in:
- lib/cch/setup.rb
Constant Summary collapse
- ATTRIBUTES =
[:debug, :watcher_commands, :runners]
Class Method Summary collapse
- .add_runner(runner, options = {}) {|| ... } ⇒ Object
- .configure ⇒ Object
- .inspect ⇒ Object
- .run(runner) ⇒ Object
Class Method Details
.add_runner(runner, options = {}) {|| ... } ⇒ Object
17 18 19 20 21 |
# File 'lib/cch/setup.rb', line 17 def add_runner(runner, = {}) @runners ||= {} @runners[runner] = Runner.new(runner, ) yield @runners[runner] if block_given? end |
.configure ⇒ Object
7 8 9 10 11 |
# File 'lib/cch/setup.rb', line 7 def configure load_setup puts "=> setup\n#{inspect}" if debug self end |
.inspect ⇒ Object
13 14 15 |
# File 'lib/cch/setup.rb', line 13 def inspect ATTRIBUTES.map { |f| " #{f} = #{send(f)}" }.join("\n") end |
.run(runner) ⇒ Object
23 24 25 |
# File 'lib/cch/setup.rb', line 23 def run(runner) runners.fetch(runner).on = true end |