Class: JasmineCIRunner

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

Instance Method Summary collapse

Constructor Details

#initialize(dir, js_filter) ⇒ JasmineCIRunner

Returns a new instance of JasmineCIRunner.


3
4
5
6
# File 'lib/tasks/jasmine_ci/jasmine_ci_runner.rb', line 3

def initialize(dir, js_filter)
  @dir = dir
  @js_filter = js_filter
end

Instance Method Details

#executeObject


12
13
14
# File 'lib/tasks/jasmine_ci/jasmine_ci_runner.rb', line 12

def execute
  return `rake jasmine:ci 2>&1`
end

#is_configured?(all_files) ⇒ Boolean

Returns:

  • (Boolean)

16
17
18
# File 'lib/tasks/jasmine_ci/jasmine_ci_runner.rb', line 16

def is_configured?(all_files)
  return all_files.include?(@dir + '/spec/javascripts/support/jasmine.yml')
end

#nameObject


8
9
10
# File 'lib/tasks/jasmine_ci/jasmine_ci_runner.rb', line 8

def name
  return 'Jasmine CI'
end

#should_run?(modified_files) ⇒ Boolean

Returns:

  • (Boolean)

20
21
22
# File 'lib/tasks/jasmine_ci/jasmine_ci_runner.rb', line 20

def should_run?(modified_files)
  return !(modified_files.detect { |file| @js_filter.filter(file) }).nil?
end