Class: Guard::ZeusClient::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/zeus-client/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Runner

Returns a new instance of Runner.



4
5
6
7
8
9
10
11
12
# File 'lib/guard/zeus-client/runner.rb', line 4

def initialize(options = {})
  @options = {
    :zeus_options => nil,
    :zeus_subcommand => 'test',
    :zeus_subcommand_options => nil,
    :run_all_test_dirs => nil,
    :notification => true
  }.merge(options)
end

Instance Method Details

#run(paths, options = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/guard/zeus-client/runner.rb', line 14

def run(paths, options = {})
  return false if paths.empty?

  message = options[:message] || "Zeus running: #{paths.join(' ')}"
  UI.info(message, :reset => true)

  options = @options.merge(options)

  run_via_shell paths, options
end

#run_allObject



25
26
27
# File 'lib/guard/zeus-client/runner.rb', line 25

def run_all
  run(@options[:run_all_test_dirs] || test_dirs, :message => 'Zeus running all')
end

#zeus_executableObject



29
30
31
# File 'lib/guard/zeus-client/runner.rb', line 29

def zeus_executable
  @zeus_executable ||= 'zeus'
end