specjour 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -30,8 +30,6 @@ Run the rake task in your project directory to start the test suite.
30
30
 
31
31
  $ rake specjour
32
32
 
33
- The worker reports passes/failures in batches of 25 so you won't get immediate feedback, override the batch size via `specjour --batch-size 1`
34
-
35
33
  ## Note on Patches/Pull Requests
36
34
 
37
35
  * Fork the project.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
data/bin/specjour CHANGED
@@ -2,7 +2,7 @@
2
2
  require 'optparse'
3
3
  require 'specjour'
4
4
 
5
- options = {:worker_size => 1, :batch_size => 25}
5
+ options = {:worker_size => 1, :batch_size => 1}
6
6
 
7
7
  optparse = OptionParser.new do |opts|
8
8
  opts.banner = "Usage: specjour [options]"
@@ -17,6 +17,7 @@ module Specjour
17
17
  rsync_daemon.start
18
18
  gather_managers
19
19
  sync_managers
20
+ bundle_install_managers
20
21
  dispatch_work
21
22
  printer.join
22
23
  end
@@ -29,6 +30,17 @@ module Specjour
29
30
  end
30
31
  end
31
32
 
33
+ def bundle_install_managers
34
+ command_managers {|manager| manager.bundle_install }
35
+ end
36
+
37
+ def command_managers(async = false, &block)
38
+ managers.each do |manager|
39
+ manager_threads << Thread.new(manager, &block)
40
+ end
41
+ wait_on_managers unless async
42
+ end
43
+
32
44
  def dispatch_work
33
45
  distributable_specs = all_specs.among(worker_size)
34
46
  last_index = 0
@@ -99,10 +111,7 @@ module Specjour
99
111
  end
100
112
 
101
113
  def sync_managers
102
- managers.each do |manager|
103
- manager_threads << Thread.new(manager) { |manager| manager.sync }
104
- end
105
- wait_on_managers
114
+ command_managers { |manager| manager.sync }
106
115
  end
107
116
 
108
117
  def wait_on_managers
@@ -5,9 +5,17 @@ module Specjour
5
5
 
6
6
  attr_accessor :project_name, :specs_to_run, :dispatcher_uri, :worker_size, :bonjour_service, :batch_size
7
7
 
8
- def initialize(worker_size = 1, batch_size = 25)
8
+ def initialize(worker_size = 1, batch_size = 1)
9
9
  @worker_size = worker_size
10
- @batch_size = 25
10
+ @batch_size = batch_size
11
+ end
12
+
13
+ def bundle_install
14
+ Dir.chdir(project_path) do
15
+ unless system('bundle check > /dev/null')
16
+ system("bundle install --relock > /dev/null")
17
+ end
18
+ end
11
19
  end
12
20
 
13
21
  def project_path
@@ -53,7 +53,7 @@ pid file = #{pid_file}
53
53
 
54
54
  [#{project_name}]
55
55
  path = #{project_path}
56
- exclude = .git* doc tmp/* public log script
56
+ exclude = .git* doc tmp/* log script
57
57
  CONFIG
58
58
  end
59
59
  end
@@ -7,7 +7,5 @@ namespace :specjour do
7
7
  end
8
8
  end
9
9
 
10
- desc "Dispatch the [project_path] to listening managers"
11
- task :specjour, [:project_path] do |task, args|
12
- Rake::Task['specjour:dispatch'].invoke(args[:project_path])
13
- end
10
+ desc "Dispatch the project to listening managers"
11
+ task :specjour => "specjour:dispatch"
data/lib/specjour.rb CHANGED
@@ -18,5 +18,5 @@ module Specjour
18
18
  autoload :RsyncDaemon, 'specjour/rsync_daemon'
19
19
  autoload :Worker, 'specjour/worker'
20
20
 
21
- VERSION = "0.1.4".freeze
21
+ VERSION = "0.1.5".freeze
22
22
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sandro Turriate
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-20 00:00:00 -04:00
17
+ date: 2010-03-21 00:00:00 -04:00
18
18
  default_executable: specjour
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency