justinf-hydra 0.23.6 → 0.23.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.23.6
1
+ 0.23.7
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{justinf-hydra}
8
- s.version = "0.23.6"
8
+ s.version = "0.23.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nick Gauthier", "Justin Fitzsimmons"]
12
- s.date = %q{2011-07-08}
12
+ s.date = %q{2011-07-12}
13
13
  s.description = %q{Spread your tests over multiple machines to test your code faster.}
14
14
  s.email = %q{justin@fitzsimmons.ca}
15
15
  s.extra_rdoc_files = [
@@ -55,6 +55,7 @@ Gem::Specification.new do |s|
55
55
  "lib/hydra/stdio.rb",
56
56
  "lib/hydra/sync.rb",
57
57
  "lib/hydra/tasks.rb",
58
+ "lib/hydra/threadsafe_io.rb",
58
59
  "lib/hydra/tmpdir.rb",
59
60
  "lib/hydra/trace.rb",
60
61
  "lib/hydra/worker.rb",
data/lib/hydra/master.rb CHANGED
@@ -4,6 +4,7 @@ require 'hydra/tmpdir'
4
4
  require 'hydra/proxy_config'
5
5
  require 'erb'
6
6
  require 'yaml'
7
+ require 'hydra/threadsafe_io'
7
8
 
8
9
  module Hydra #:nodoc:
9
10
  # Hydra class responsible for delegate work down to workers.
@@ -35,6 +36,9 @@ module Hydra #:nodoc:
35
36
  # * :autosort
36
37
  # * Set to false to disable automatic sorting by historical run-time per file
37
38
  def initialize(opts = { })
39
+
40
+ $stdout = ThreadsafeIO.new($stdout)
41
+
38
42
  opts.stringify_keys!
39
43
  config_file = opts.delete('config') { nil }
40
44
  if config_file
@@ -0,0 +1,18 @@
1
+ require 'thread'
2
+ require 'fcntl'
3
+
4
+ module Hydra
5
+ class ThreadsafeIO < IO
6
+ def initialize(existing_io)
7
+ fd = existing_io.fcntl(Fcntl::F_DUPFD)
8
+ super(fd)
9
+ @mutex = Mutex.new
10
+ end
11
+
12
+ def write(*args)
13
+ @mutex.synchronize do
14
+ super(*args)
15
+ end
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: justinf-hydra
3
3
  version: !ruby/object:Gem::Version
4
- hash: 79
4
+ hash: 77
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 23
9
- - 6
10
- version: 0.23.6
9
+ - 7
10
+ version: 0.23.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nick Gauthier
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-07-08 00:00:00 -04:00
19
+ date: 2011-07-12 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -133,6 +133,7 @@ files:
133
133
  - lib/hydra/stdio.rb
134
134
  - lib/hydra/sync.rb
135
135
  - lib/hydra/tasks.rb
136
+ - lib/hydra/threadsafe_io.rb
136
137
  - lib/hydra/tmpdir.rb
137
138
  - lib/hydra/trace.rb
138
139
  - lib/hydra/worker.rb