tork 18.2.2 → 18.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.markdown CHANGED
@@ -1,3 +1,23 @@
1
+ ## Version 18.2.3 (2012-09-26)
2
+
3
+ Patch:
4
+
5
+ * Restored support for building Tork from its gemspec under Ruby 1.8.
6
+ Thanks to Ohno Shin'ichi for reporting this issue and contributing a
7
+ preliminary fix.
8
+
9
+ * Add resilience against failed command dispatch in `Tork::Server#loop()`.
10
+
11
+ Other:
12
+
13
+ * It's not worth rescuing Interrupt only to exit silently.
14
+ Let the user see stack traces when they press Control-C.
15
+
16
+ * Update old comments about SIGCHLD handler, which was
17
+ replaced by reaping threads quite a few releases ago.
18
+
19
+ * Use $0 instead of hard-coding the program name.
20
+
1
21
  ## Version 18.2.2 (2012-07-11)
2
22
 
3
23
  Patch:
data/LICENSE CHANGED
@@ -18,6 +18,7 @@ Thanks to 2012 David Burrows <david@imergent.com>
18
18
  Thanks to 2012 Bjørn Trondsen <contact@sharagoz.com>
19
19
  Thanks to 2012 NagaChaitanya Vellanki <me@chaitanyavellanki.com>
20
20
  Thanks to 2012 Jesse Cooke <jesse@jc00ke.com>
21
+ Thanks to 2012 Ohno Shin'ichi <shin1ohno@me.com>
21
22
 
22
23
  Permission to use, copy, modify, and/or distribute this software for any
23
24
  purpose with or without fee is hereby granted, provided that the above
data/README.markdown CHANGED
@@ -35,7 +35,7 @@ Tork runs your tests as they change, in parallel:
35
35
 
36
36
  * You can override the modular `tork*` programs with your own in $PATH.
37
37
 
38
- * Its core is written in about 410 lines (SLOC) of pure Ruby code! :-)
38
+ * Its core is written in about 420 lines (SLOC) of pure Ruby code! :-)
39
39
 
40
40
  ### Architecture
41
41
 
@@ -71,7 +71,6 @@ tests in your saved file, simply save the file *again* without changing it.
71
71
  To check if your system qualifies, launch `irb` and enter the following:
72
72
 
73
73
  Process.respond_to? :fork # must be true
74
- Signal.list.key? 'CHLD' # must be true
75
74
  Signal.list.key? 'TERM' # must be true
76
75
 
77
76
  * To make the `tork-herald` program's filesystem monitoring more efficient:
data/bin/tork CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK 1 2012-07-11 18.2.2
4
+ # TORK 1 2012-09-26 18.2.3
5
5
 
6
6
  ## NAME
7
7
 
@@ -44,11 +44,11 @@ ENV['TORK_CONFIGS'] = JSON.dump(ARGV)
44
44
 
45
45
  require 'tork/client'
46
46
 
47
- warn 'tork: Absorbing test execution overhead...'
47
+ warn "#{$0}: Absorbing test execution overhead..."
48
48
  @driver = Tork::Client::Transceiver.new('tork-driver') do |event, *details|
49
49
  case event_sym = event.to_sym
50
- when :load then warn 'tork: Overhead absorbed. Ready for testing!'
51
- when :over then warn 'tork: Reabsorbing changed overhead files...'
50
+ when :load then warn "#{$0}: Overhead absorbed. Ready for testing!"
51
+ when :over then warn "#{$0}: Reabsorbing changed overhead files..."
52
52
  else
53
53
  test_file, line_numbers, log_file, worker_number, exit_status = details
54
54
  message = [event.upcase, [test_file, *line_numbers].join(':'),
@@ -78,20 +78,16 @@ COMMANDS = {
78
78
  'q' => :quit,
79
79
  }
80
80
 
81
- begin
82
- while key = STDIN.gets
83
- if command = COMMANDS[key.strip]
84
- warn "tork: Sending #{command.to_s.inspect} command..."
85
- @driver.send [command]
86
- break if command == :quit
87
- else # invalid command
88
- COMMANDS.each do |k, cmd|
89
- warn "tork: Type #{k} then ENTER to #{cmd.to_s.tr('_', ' ')}."
90
- end
81
+ while key = STDIN.gets
82
+ if command = COMMANDS[key.strip]
83
+ warn "#{$0}: Sending #{command.to_s.inspect} command..."
84
+ @driver.send [command]
85
+ break if command == :quit
86
+ else # invalid command
87
+ COMMANDS.each do |key, cmd|
88
+ warn "#{$0}: Type #{key} then ENTER to #{cmd.to_s.tr('_', ' ')}."
91
89
  end
92
90
  end
93
- rescue Interrupt
94
- # forced quit
95
91
  end
96
92
 
97
93
  Process.waitall
data/bin/tork-driver CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK-DRIVER 1 2012-07-11 18.2.2
4
+ # TORK-DRIVER 1 2012-09-26 18.2.3
5
5
 
6
6
  ## NAME
7
7
 
data/bin/tork-engine CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK-ENGINE 1 2012-07-11 18.2.2
4
+ # TORK-ENGINE 1 2012-09-26 18.2.3
5
5
 
6
6
  ## NAME
7
7
 
data/bin/tork-herald CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK-HERALD 1 2012-07-11 18.2.2
4
+ # TORK-HERALD 1 2012-09-26 18.2.3
5
5
 
6
6
  ## NAME
7
7
 
data/bin/tork-master CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK-MASTER 1 2012-07-11 18.2.2
4
+ # TORK-MASTER 1 2012-09-26 18.2.3
5
5
 
6
6
  ## NAME
7
7
 
data/lib/tork/master.rb CHANGED
@@ -57,7 +57,7 @@ class Master < Server
57
57
  # after loading the user's test file, the at_exit() hook of the user's
58
58
  # testing framework will take care of running the tests and reflecting
59
59
  # any failures in the worker process' exit status, which will then be
60
- # handled by the SIGCHLD trap registered in the master process (below)
60
+ # handled by the reaping thread registered in the master process (below)
61
61
  Kernel.load test_file if test_file.end_with? '.rb'
62
62
  end
63
63
 
@@ -65,7 +65,7 @@ class Master < Server
65
65
  @client.send @command
66
66
 
67
67
  # wait for the worker to finish and report its status to the client
68
- Thread.new do
68
+ Thread.new do # the reaping thread
69
69
  worker_status = Process.wait2(worker_pid).last
70
70
  command = @command_by_worker_pid.delete(worker_pid)
71
71
  @worker_number_pool.push command.last
@@ -75,7 +75,7 @@ class Master < Server
75
75
  end
76
76
 
77
77
  def stop
78
- # NOTE: the SIGCHLD handler will reap these killed worker processes
78
+ # the reaping threads registered above will reap these killed workers
79
79
  Process.kill :SIGTERM, *@command_by_worker_pid.keys.map {|pid| -pid }
80
80
  rescue ArgumentError, SystemCallError
81
81
  # some workers might have already exited before we sent them the signal
data/lib/tork/server.rb CHANGED
@@ -16,18 +16,16 @@ class Server
16
16
  STDOUT.reopen(STDERR).sync = true
17
17
 
18
18
  Client::Receiver.new(STDIN) do |command|
19
- method = command.first
20
- if respond_to? method and method != __method__ # prevent loops
19
+ if command.first != __method__ # prevent loops
21
20
  @command = command
22
- __send__(*command)
23
- else
24
- warn "#{self}: invalid command: #{method}"
21
+ begin
22
+ __send__(*command)
23
+ rescue => error
24
+ warn "#{$0}: #{error}"
25
+ warn error.backtrace.join("\n")
26
+ end
25
27
  end
26
28
  end.join
27
- rescue Interrupt
28
- # forced quit
29
- ensure
30
- Process.waitall
31
29
  end
32
30
 
33
31
  end
data/lib/tork/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tork
2
- VERSION = "18.2.2"
2
+ VERSION = "18.2.3"
3
3
  end
@@ -1,4 +1,4 @@
1
- .TH TORK\-DRIVER 1 2012\-07\-11 18.2.2
1
+ .TH TORK\-DRIVER 1 2012\-09\-26 18.2.3
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-driver \- drives
@@ -1,4 +1,4 @@
1
- .TH TORK\-ENGINE 1 2012\-07\-11 18.2.2
1
+ .TH TORK\-ENGINE 1 2012\-09\-26 18.2.3
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-engine \- wraps
@@ -1,4 +1,4 @@
1
- .TH TORK\-HERALD 1 2012\-07\-11 18.2.2
1
+ .TH TORK\-HERALD 1 2012\-09\-26 18.2.3
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-herald \- reports modified files
@@ -1,4 +1,4 @@
1
- .TH TORK\-MASTER 1 2012\-07\-11 18.2.2
1
+ .TH TORK\-MASTER 1 2012\-09\-26 18.2.3
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-master \- absorbs overhead and runs tests
data/man/man1/tork.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH TORK 1 2012\-07\-11 18.2.2
1
+ .TH TORK 1 2012\-09\-26 18.2.3
2
2
  .SH NAME
3
3
  .PP
4
4
  tork \- Continuous testing tool for Ruby
data/tork.gemspec CHANGED
@@ -6,8 +6,9 @@ Gem::Specification.new do |s|
6
6
  s.name = 'tork'
7
7
  s.version = Tork::VERSION
8
8
  s.authors,
9
- s.email = File.read('LICENSE').force_encoding('UTF-8').
10
- scan(/Copyright \d+ (.+) <(.+?)>/).transpose
9
+ s.email = File.read(*['LICENSE',
10
+ ({:encoding => 'utf-8'} if RUBY_VERSION >= '1.9')
11
+ ].compact).scan(/Copyright \d+ (.+) <(.+?)>/).transpose
11
12
  s.homepage = 'http://github.com/sunaku/tork'
12
13
  s.summary = 'test with fork'
13
14
  s.description = 'Runs your tests as they change, in parallel.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tork
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.2.2
4
+ version: 18.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-07-12 00:00:00.000000000 Z
13
+ date: 2012-09-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: binman
@@ -166,11 +166,11 @@ files:
166
166
  - lib/tork/server.rb
167
167
  - lib/tork/version.rb
168
168
  - tork.gemspec
169
- - man/man1/tork-master.1
170
- - man/man1/tork.1
171
- - man/man1/tork-engine.1
172
169
  - man/man1/tork-herald.1
170
+ - man/man1/tork-engine.1
171
+ - man/man1/tork-master.1
173
172
  - man/man1/tork-driver.1
173
+ - man/man1/tork.1
174
174
  homepage: http://github.com/sunaku/tork
175
175
  licenses: []
176
176
  post_install_message:
@@ -185,7 +185,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
185
185
  version: '0'
186
186
  segments:
187
187
  - 0
188
- hash: 3126932301270225000
188
+ hash: 2002680833994737282
189
189
  required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  none: false
191
191
  requirements:
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  version: '0'
195
195
  segments:
196
196
  - 0
197
- hash: 3126932301270225000
197
+ hash: 2002680833994737282
198
198
  requirements: []
199
199
  rubyforge_project:
200
200
  rubygems_version: 1.8.23