Class: BrwyRails::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/brwy_rails/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Runner

Returns a new instance of Runner.



5
6
7
# File 'lib/brwy_rails/runner.rb', line 5

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



3
4
5
# File 'lib/brwy_rails/runner.rb', line 3

def config
  @config
end

Instance Method Details

#runObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/brwy_rails/runner.rb', line 9

def run
  if watching?
    pids = @config.targets.map {|target|
      run_with_watchify(target)
    }
    at_exit do
      pids.each {|pid| Process.exit(pid)}
    end
  else
    @config.targets.map {|target|
      run_with_browserify(target)
    }
  end
end