Class: Guard::RSpec::Runner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Runner

Returns a new instance of Runner


13
14
15
16
17
# File 'lib/guard/rspec/runner.rb', line 13

def initialize(options = {})
  @options = options
  @inspector = Inspectors::Factory.create(@options)
  @notifier = Notifier.new(@options)
end

Instance Attribute Details

#inspectorObject

Returns the value of attribute inspector


11
12
13
# File 'lib/guard/rspec/runner.rb', line 11

def inspector
  @inspector
end

#notifierObject

Returns the value of attribute notifier


11
12
13
# File 'lib/guard/rspec/runner.rb', line 11

def notifier
  @notifier
end

#optionsObject

Returns the value of attribute options


11
12
13
# File 'lib/guard/rspec/runner.rb', line 11

def options
  @options
end

Instance Method Details

#reloadObject


34
35
36
# File 'lib/guard/rspec/runner.rb', line 34

def reload
  inspector.reload
end

#run(paths) ⇒ Object


27
28
29
30
31
32
# File 'lib/guard/rspec/runner.rb', line 27

def run(paths)
  paths = inspector.paths(paths)
  return true if paths.empty?
  Compat::UI.info("Running: #{paths.join(" ")}", reset: true)
  _run(false, paths, options)
end

#run_allObject


19
20
21
22
23
24
25
# File 'lib/guard/rspec/runner.rb', line 19

def run_all
  paths = options[:spec_paths]
  options = @options.merge(@options[:run_all])
  return true if paths.empty?
  Compat::UI.info(options[:message], reset: true)
  _run(true, paths, options)
end