sauron 0.1.10 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.10
1
+ 0.1.17
@@ -1,3 +1,3 @@
1
1
  workers:
2
2
  - type: local
3
- runners: <%%= ENV['SAURON_WORKERS'] %>
3
+ runners: <%= ENV['SAURON_WORKERS'] %>
@@ -5,10 +5,12 @@ class SauronTemplate
5
5
  attr_accessor :framework, :workers, :hydra
6
6
 
7
7
  def initialize
8
- config = YAML::load(ERB.new(IO.read(config_file)).result)
8
+ if File.exists? config_file
9
+ config = YAML::load(ERB.new(IO.read(config_file)).result)
9
10
 
10
- framework = config[:framework]
11
- workers = config[:workers]
11
+ self.framework = config[:framework]
12
+ self.workers = config[:workers]
13
+ end
12
14
  end
13
15
 
14
16
  def config_file
@@ -16,7 +18,7 @@ class SauronTemplate
16
18
  end
17
19
 
18
20
  def set_hydra
19
- if hydra = !!(`rake -T hydra:sauron` =~ /hydra:sauron/)
21
+ if self.hydra = !!(`rake -T hydra:sauron` =~ /hydra:sauron/)
20
22
  message "Using hydra to run multiple tests in parallel"
21
23
  else
22
24
  message "You don't have hydra properly setup. All tests will be run in single-threaded mode."
@@ -35,7 +37,7 @@ class SauronTemplate
35
37
  when 'testunit'
36
38
  system "time ruby -I.:lib:test -rubygems -e \"require '#{file}'\""
37
39
  when 'rspec'
38
- system "time ruby script/spec -O spec/spect.opts #{file}"
40
+ system "time ruby script/spec -O spec/spec.opts #{file}"
39
41
  end
40
42
  end
41
43
 
@@ -45,13 +47,13 @@ class SauronTemplate
45
47
  message "running #{files.first.size} tests: #{joined_files}"
46
48
 
47
49
  if hydra
48
- system "time rake hydra:sauron RAILS_ENV=test FILE_LIST=#{joined_files} SAURON_WORKERS=#{$sauron.workers}"
50
+ system "time rake hydra:sauron RAILS_ENV=test FILE_LIST=#{joined_files} SAURON_WORKERS=#{workers}"
49
51
  else
50
52
  case framework
51
53
  when 'testunit'
52
54
  system "time ruby -I.:lib:test -rubygems -e \"%w[#{files.join(' ')}].each {|f| require f}\""
53
55
  when 'rspec'
54
- system "time ruby script/spec -O spec/spect.opts #{files.join(' ')}"
56
+ system "time ruby script/spec -O spec/spec.opts #{files.join(' ')}"
55
57
  end
56
58
  end
57
59
  end
data/lib/sauron.rb CHANGED
@@ -1,3 +1,3 @@
1
- require 'lib/sauron_template'
1
+ require 'sauron/sauron_template'
2
2
 
3
- Sauron = SauronTemplate
3
+ Sauron = SauronTemplate.new
data/sauron.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sauron}
8
- s.version = "0.1.10"
8
+ s.version = "0.1.17"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jaime Bellmyer"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauron
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 57
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 10
10
- version: 0.1.10
9
+ - 17
10
+ version: 0.1.17
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jaime Bellmyer