Class: Cch::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/cch/setup.rb

Constant Summary collapse

ATTRIBUTES =
[:debug, :watcher_commands, :runners]

Class Method Summary collapse

Class Method Details

.add_runner(runner) {|@runners[runner]| ... } ⇒ Object

Yields:

  • (@runners[runner])

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

.configureObject


7
8
9
10
11
# File 'lib/cch/setup.rb', line 7

def configure
  load_setup_files(%w(config/Cchfile Cchfile))
  puts "=> setup\n#{inspect}" if debug
  self
end

.inspectObject


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