Class: Shenandoah::Tasks

Inherits:
Object
  • Object
show all
Defined in:
lib/shenandoah/tasks.rb

Direct Known Subclasses

Rails::Tasks

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Tasks



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

def initialize(options = {})
  @options = options
  @locator =
    if options[:locator]
      options[:locator]
    else
      default_locator_type.new(options)
    end
  @runner = Shenandoah::Runner.new(@locator)
  create_serve_task
  create_shell_task
  create_run_task
end

Instance Attribute Details

#locatorObject

Returns the value of attribute locator.



7
8
9
# File 'lib/shenandoah/tasks.rb', line 7

def locator
  @locator
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/shenandoah/tasks.rb', line 7

def options
  @options
end

#runnerObject

Returns the value of attribute runner.



7
8
9
# File 'lib/shenandoah/tasks.rb', line 7

def runner
  @runner
end

Instance Method Details

#run_specsObject



23
24
25
26
27
28
29
30
31
32
# File 'lib/shenandoah/tasks.rb', line 23

def run_specs
  files = @locator.spec_files
  if ENV['SHEN_SPEC']
    files = files.select { |f| f =~ /#{ENV['SHEN_SPEC']}/ }
  end
  successes = @runner.run_console(files)
  if (successes.size != files.size)
    raise "Shenandoah specs failed!"
  end
end