tork 19.0.0 → 19.0.1

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/HISTORY.markdown CHANGED
@@ -1,3 +1,26 @@
1
+ ## Version 19.0.1 (2012-10-26)
2
+
3
+ Patch:
4
+
5
+ * Support testing projects that have both test/ and spec/ directories.
6
+
7
+ I assumed that users would only have either test/ or spec/ but not both.
8
+ Do you know what happens when a test/ is run by RSpec or vice versa? :-)
9
+
10
+ Thanks to Kyle Peyton for reporting this issue.
11
+
12
+ * Automatically load the "autorun" helpers for RSpec and MiniTest.
13
+
14
+ RSpec users are accustomed to not having `require "rspec/autorun"` in
15
+ their spec/spec_helper.rb file because they use the rspec(1) executable
16
+ to run their tests. This commit makes things Just Work for them again.
17
+
18
+ Other:
19
+
20
+ * test whether input is JSON by actually parsing it
21
+
22
+ * server: use Set instead of Array for faster lookup
23
+
1
24
  ## Version 19.0.0 (2012-10-17)
2
25
 
3
26
  Major:
@@ -68,7 +91,7 @@ Other:
68
91
  Other:
69
92
 
70
93
  * GH-39: upgrade listen gem version to fix a bug in OSX.
71
- Thanks to "harmon" on GitHub for reporting this issue.
94
+ Thanks to Adam Grant for reporting this issue.
72
95
 
73
96
  ## Version 18.2.3 (2012-09-26)
74
97
 
data/LICENSE CHANGED
@@ -1,24 +1,25 @@
1
1
  (the ISC license)
2
2
 
3
- Copyright 2010 Suraj N. Kurapati <sunaku@gmail.com>
4
- Copyright 2011 Brian D. Burns <burns180@gmail.com>
5
- Thanks to 2011 Daniel Pittman <daniel@rimspace.net>
6
- Thanks to 2011 Jacob Helwig <jacob@technosorcery.net>
7
- Thanks to 2011 Corné Verbruggen <corne@g-majeur.nl>
8
- Thanks to 2011 Luke Wendling <luke@lukewendling.com>
9
- Thanks to 2012 Jose Pablo Barrantes <xjpablobrx@gmail.com>
10
- Thanks to 2012 Spencer Steffen <spencer@citrusme.com>
11
- Thanks to 2012 Jesse Cooke <jesse@jc00ke.com>
12
- Thanks to 2012 Benjamin Quorning <benjamin@quorning.net>
13
- Thanks to 2012 Nicolas Fouché <nicolas.fouche@gmail.com>
14
- Thanks to 2012 Mark Hayes <mark@deployfx.com>
15
- Thanks to 2012 Gumaro Melendez <cloudernew@gmail.com>
16
- Thanks to 2012 Scott Radcliff <radcliffsc@gmail.com>
17
- Thanks to 2012 David Burrows <david@imergent.com>
18
- Thanks to 2012 Bjørn Trondsen <contact@sharagoz.com>
19
- Thanks to 2012 NagaChaitanya Vellanki <me@chaitanyavellanki.com>
20
- Thanks to 2012 Jesse Cooke <jesse@jc00ke.com>
21
- Thanks to 2012 Ohno Shin'ichi <shin1ohno@me.com>
3
+ Copyright 2010 Suraj N. Kurapati <https://github.com/sunaku>
4
+ Copyright 2011 Brian D. Burns <https://github.com/burns>
5
+ Thanks to 2011 Daniel Pittman <https://github.com/daniel-pittman>
6
+ Thanks to 2011 Jacob Helwig <https://github.com/jhelwig>
7
+ Thanks to 2011 Corné Verbruggen <https://github.com/corneverbruggen>
8
+ Thanks to 2011 Luke Wendling <https://github.com/lukewendling>
9
+ Thanks to 2012 Jose Pablo Barrantes <https://github.com/jpablobr>
10
+ Thanks to 2012 Spencer Steffen <https://github.com/citrus>
11
+ Thanks to 2012 Jesse Cooke <https://github.com/jc00ke>
12
+ Thanks to 2012 Benjamin Quorning <https://github.com/bquorning>
13
+ Thanks to 2012 Nicolas Fouché <https://github.com/nfo>
14
+ Thanks to 2012 Mark Hayes <https://github.com/mhayes>
15
+ Thanks to 2012 Gumaro Melendez <https://github.com/clouder>
16
+ Thanks to 2012 Scott Radcliff <https://github.com/ScottRadcliff>
17
+ Thanks to 2012 David Burrows <https://github.com/dburrows>
18
+ Thanks to 2012 Bjørn Trondsen <https://github.com/Sharagoz>
19
+ Thanks to 2012 NagaChaitanya Vellanki <https://github.com/chaitanyav>
20
+ Thanks to 2012 Ohno Shin'ichi <https://github.com/shin1ohno>
21
+ Thanks to 2012 Adam Grant <https://github.com/harmon>
22
+ Thanks to 2012 Kyle Peyton <https://github.com/weexpectedthis>
22
23
 
23
24
  Permission to use, copy, modify, and/or distribute this software for any
24
25
  purpose with or without fee is hereby granted, provided that the above
data/bin/tork CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK 1 2012-10-17 19.0.0
4
+ # TORK 1 2012-10-26 19.0.1
5
5
 
6
6
  ## NAME
7
7
 
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-10-17 19.0.0
4
+ # TORK-DRIVER 1 2012-10-26 19.0.1
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-10-17 19.0.0
4
+ # TORK-ENGINE 1 2012-10-26 19.0.1
5
5
 
6
6
  ## NAME
7
7
 
@@ -32,7 +32,7 @@ from stdin and performs the actions described respectively.
32
32
  that have changed since the last run of *test_file* will be substituted.
33
33
  If any *line_numbers* are zero, then the entire *test_file* will be run.
34
34
 
35
- `["run_test_files"`, *test_files_with_optional_line_numbers*`]`
35
+ `["run_test_files"`, *test\_files\_with\_optional\_line\_numbers*`]`
36
36
  Calls the `run_test_file` command once for each item in the given array.
37
37
 
38
38
  `["stop_running_test_files"`, *signal*`]`
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-10-17 19.0.0
4
+ # TORK-HERALD 1 2012-10-26 19.0.1
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-10-17 19.0.0
4
+ # TORK-MASTER 1 2012-10-26 19.0.1
5
5
 
6
6
  ## NAME
7
7
 
data/bin/tork-notify CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  =begin =======================================================================
3
3
 
4
- # TORK-NOTIFY 1 2012-10-17 19.0.0
4
+ # TORK-NOTIFY 1 2012-10-26 19.0.1
5
5
 
6
6
  ## NAME
7
7
 
data/bin/tork-remote CHANGED
@@ -59,7 +59,13 @@ begin
59
59
  # messages to remote from server
60
60
  Thread.new do
61
61
  while input = socket.gets
62
- stream = input =~ Tork::Server::JSON_REGEXP ? STDOUT : STDERR
62
+ stream =
63
+ begin
64
+ JSON.load input
65
+ STDOUT
66
+ rescue JSON::ParserError
67
+ STDERR
68
+ end
63
69
  stream.puts input
64
70
  stream.flush
65
71
  end
@@ -72,9 +78,7 @@ begin
72
78
  socket.puts output
73
79
  end
74
80
  end
75
- # ECONNREFUSED is for abstract namespace UNIXSocket
76
- rescue Errno::ENOENT, Errno::ECONNREFUSED => error
77
- warn "#{$0}: could not connect to #{program}"
78
- warn "#{error}#{address.inspect}"
81
+ rescue Errno::ENOENT => error
82
+ warn "#{$0}: could not connect to #{program}: #{error}"
79
83
  exit 1
80
84
  end
@@ -1,3 +1,4 @@
1
1
  $LOAD_PATH.unshift 'spec' unless $LOAD_PATH.include? 'spec'
2
2
  $LOAD_PATH.unshift 'lib' unless $LOAD_PATH.include? 'lib'
3
3
  require 'spec_helper' if File.exist? 'spec/spec_helper.rb'
4
+ require 'rspec/autorun' if defined? RSpec
@@ -1,3 +1,5 @@
1
- $tork_line_numbers.each do |line|
2
- ARGV.push '--line_number', line.to_s
1
+ if $tork_test_file.start_with? 'spec/' and $tork_line_numbers.any?
2
+ $tork_line_numbers.each do |line|
3
+ ARGV.push '--line_number', line.to_s
4
+ end
3
5
  end
@@ -1,3 +1,4 @@
1
1
  $LOAD_PATH.unshift 'test' unless $LOAD_PATH.include? 'test'
2
2
  $LOAD_PATH.unshift 'lib' unless $LOAD_PATH.include? 'lib'
3
3
  require 'test_helper' if File.exist? 'test/test_helper.rb'
4
+ require 'minitest/autorun' if defined? MiniTest
@@ -1,4 +1,4 @@
1
- unless $tork_line_numbers.empty?
1
+ if $tork_test_file.start_with? 'test/' and $tork_line_numbers.any?
2
2
  test_file_lines = File.readlines($tork_test_file)
3
3
  test_names = $tork_line_numbers.map do |line|
4
4
  catch :found do
data/lib/tork/server.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'socket'
2
- require 'thread'
3
2
  require 'json'
4
3
  require 'shellwords'
4
+ require 'set'
5
5
 
6
6
  module Tork
7
7
  class Server
@@ -16,20 +16,20 @@ class Server
16
16
  @stdout = STDOUT.dup
17
17
  STDOUT.reopen STDERR
18
18
 
19
- @clients = [STDIN]
20
- @servers = []
19
+ @clients = Set.new.add(STDIN)
20
+ @servers = Set.new
21
21
  end
22
22
 
23
23
  def loop
24
24
  server = UNIXServer.open(Server.address)
25
- @servers << server
25
+ @servers.add server
26
26
  catch :quit do
27
27
  while @clients.include? STDIN
28
- IO.select(@servers + @clients).first.each do |stream|
28
+ IO.select((@servers + @clients).to_a).first.each do |stream|
29
29
  @client = stream
30
30
 
31
31
  if stream == server
32
- @clients << stream.accept
32
+ @clients.add stream.accept
33
33
 
34
34
  elsif (stream.eof? rescue true)
35
35
  @clients.delete stream
@@ -51,32 +51,24 @@ class Server
51
51
 
52
52
  protected
53
53
 
54
- JSON_REGEXP = /\A\s*[\[\{]/.freeze
55
-
56
- # On failure to decode the message, warns the sender and returns nil.
54
+ # Returns nil if the message received was not meant for processing.
57
55
  def hear sender, message
58
- if message =~ JSON_REGEXP
59
- JSON.load message
60
-
61
- # accept non-JSON "command lines" from clients
62
- elsif @clients.include? sender
56
+ JSON.load message
57
+ rescue JSON::ParserError => error
58
+ if @clients.include? sender
59
+ # accept non-JSON "command lines" from clients
63
60
  Shellwords.split message
64
-
65
- # forward tell() output from children to clients
66
- elsif @servers.include? sender
61
+ else
62
+ # forward tell() output from servers to clients
67
63
  tell @clients, message, false
68
64
  nil
69
65
  end
70
- rescue JSON::ParserError => error
71
- tell sender, error
72
- nil
73
66
  end
74
67
 
75
68
  def recv client, command
76
69
  __send__(*command)
77
70
  rescue => error
78
71
  tell client, error
79
- nil
80
72
  end
81
73
 
82
74
  def send one_or_more_clients, message
@@ -108,19 +100,19 @@ protected
108
100
 
109
101
  def popen command
110
102
  child = IO.popen(command, 'r+')
111
- @servers << child
103
+ @servers.add child
112
104
  child
113
105
  end
114
106
 
115
107
  def pclose child
116
- return unless @servers.delete child
108
+ return unless @servers.delete? child
117
109
 
118
110
  # this should be enough to stop programs that use Tork::Server#loop
119
111
  # because their IO.select() loop terminates on the closing of STDIN
120
112
  child.close_write
121
113
 
122
114
  # but some programs like tork-herald(1) need to be killed explicitly
123
- # because they do not follow this convention of exiting on STDIN close
115
+ # because they do not follow our convention of exiting on STDIN close
124
116
  Process.kill :SIGTERM, child.pid
125
117
  Process.waitpid child.pid
126
118
 
data/lib/tork/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tork
2
- VERSION = "19.0.0"
2
+ VERSION = "19.0.1"
3
3
  end
@@ -1,4 +1,4 @@
1
- .TH TORK\-DRIVER 1 2012\-10\-17 19.0.0
1
+ .TH TORK\-DRIVER 1 2012\-10\-26 19.0.1
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-driver \- drives
@@ -1,4 +1,4 @@
1
- .TH TORK\-ENGINE 1 2012\-10\-17 19.0.0
1
+ .TH TORK\-ENGINE 1 2012\-10\-26 19.0.1
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-engine \- wraps
@@ -31,7 +31,7 @@ given \fItest_file\fP. If no \fIline_numbers\fP are given, then only those line
31
31
  that have changed since the last run of \fItest_file\fP will be substituted.
32
32
  If any \fIline_numbers\fP are zero, then the entire \fItest_file\fP will be run.
33
33
  .TP
34
- \fB\fC["run_test_files"\fR, \fItest\fIfiles\fPwith\fIoptional\fPline_numbers\fP\fB\fC]\fR
34
+ \fB\fC["run_test_files"\fR, \fItest_files_with_optional_line_numbers\fP\fB\fC]\fR
35
35
  Calls the \fB\fCrun_test_file\fR command once for each item in the given array.
36
36
  .TP
37
37
  \fB\fC["stop_running_test_files"\fR, \fIsignal\fP\fB\fC]\fR
@@ -1,4 +1,4 @@
1
- .TH TORK\-HERALD 1 2012\-10\-17 19.0.0
1
+ .TH TORK\-HERALD 1 2012\-10\-26 19.0.1
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-herald \- reports modified files
@@ -1,4 +1,4 @@
1
- .TH TORK\-MASTER 1 2012\-10\-17 19.0.0
1
+ .TH TORK\-MASTER 1 2012\-10\-26 19.0.1
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-master \- absorbs overhead and runs tests
@@ -1,4 +1,4 @@
1
- .TH TORK\-NOTIFY 1 2012\-10\-17 19.0.0
1
+ .TH TORK\-NOTIFY 1 2012\-10\-26 19.0.1
2
2
  .SH NAME
3
3
  .PP
4
4
  tork\-notify \- notifies you of test status changes
data/man/man1/tork.1 CHANGED
@@ -1,4 +1,4 @@
1
- .TH TORK 1 2012\-10\-17 19.0.0
1
+ .TH TORK 1 2012\-10\-26 19.0.1
2
2
  .SH NAME
3
3
  .PP
4
4
  tork \- Continuous testing tool for Ruby
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: 19.0.0
4
+ version: 19.0.1
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-10-18 00:00:00.000000000 Z
13
+ date: 2012-10-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: binman
@@ -110,8 +110,8 @@ dependencies:
110
110
  version: 0.9.2.2
111
111
  description: Runs your tests as they change, in parallel.
112
112
  email:
113
- - sunaku@gmail.com
114
- - burns180@gmail.com
113
+ - https://github.com/sunaku
114
+ - https://github.com/burns
115
115
  executables:
116
116
  - tork
117
117
  - tork-driver
@@ -164,12 +164,12 @@ files:
164
164
  - lib/tork/version.rb
165
165
  - tork.gemspec
166
166
  - man/man1/tork-notify.1
167
- - man/man1/tork-remote.1
168
- - man/man1/tork-herald.1
169
- - man/man1/tork-engine.1
170
167
  - man/man1/tork-master.1
171
- - man/man1/tork-driver.1
172
168
  - man/man1/tork.1
169
+ - man/man1/tork-engine.1
170
+ - man/man1/tork-herald.1
171
+ - man/man1/tork-driver.1
172
+ - man/man1/tork-remote.1
173
173
  homepage: http://github.com/sunaku/tork
174
174
  licenses: []
175
175
  post_install_message:
@@ -184,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
184
184
  version: '0'
185
185
  segments:
186
186
  - 0
187
- hash: 3513287657673218143
187
+ hash: -245551711122952859
188
188
  required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  none: false
190
190
  requirements:
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  version: '0'
194
194
  segments:
195
195
  - 0
196
- hash: 3513287657673218143
196
+ hash: -245551711122952859
197
197
  requirements: []
198
198
  rubyforge_project:
199
199
  rubygems_version: 1.8.23