guard-spork 1.5.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/guard/spork.rb +17 -13
- data/lib/guard/spork/spork_instance.rb +9 -9
- data/lib/guard/spork/spork_windows_instance.rb +3 -3
- data/lib/guard/spork/templates/Guardfile +1 -1
- data/lib/guard/spork/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9607aff089d2218ec5bd8ef732e5755c4316413e
|
4
|
+
data.tar.gz: 17d917b9879e2ab9cb55289be91d60bf93982d17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e93ea8d5ce42791574976fb75dcd7c37e06f61d57b654a02c07e350d9aeb060296ff971285f75e079a48e1b2e5dd20f25f51de599385cb3acb1377dfff37e8d3
|
7
|
+
data.tar.gz: 96ca4637dc1bd4c74b4e2525088d91336ae426eb4ca7778ab0004944f677a2375450fb865b38b8985c948d0d98812e48f57ac4627414aba7b7870d2bbd443a71
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Guard::Spork allows to automatically & intelligently start/reload your RSpec/Cucumber/Test::Unit [Spork](https://github.com/sporkrb/spork) server(s).
|
4
4
|
|
5
5
|
* Compatible with Spork 0.8.4 & 0.9.0.rcX.
|
6
|
-
* Tested against Ruby 1.
|
6
|
+
* Tested against Ruby 1.9.3, 2.0.0, 2.1.2, and JRuby.
|
7
7
|
|
8
8
|
## Install
|
9
9
|
|
data/lib/guard/spork.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
require 'guard'
|
2
|
-
require 'guard/
|
2
|
+
require 'guard/plugin'
|
3
3
|
require 'childprocess'
|
4
4
|
|
5
5
|
module Guard
|
6
|
-
class Spork <
|
6
|
+
class Spork < Plugin
|
7
7
|
|
8
8
|
autoload :Runner, 'guard/spork/runner'
|
9
9
|
autoload :SporkInstance, 'guard/spork/spork_instance'
|
10
10
|
autoload :SporkWindowsInstance, 'guard/spork/spork_windows_instance'
|
11
11
|
attr_accessor :runner
|
12
12
|
|
13
|
-
def initialize(
|
13
|
+
def initialize(options={})
|
14
14
|
super
|
15
15
|
@runner = Runner.new(options)
|
16
16
|
end
|
@@ -21,23 +21,27 @@ module Guard
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def reload
|
24
|
-
|
25
|
-
runner.launch_sporks("reload")
|
24
|
+
relaunch_sporks
|
26
25
|
end
|
27
26
|
|
28
|
-
def
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
runner.launch_sporks("reload")
|
35
|
-
end
|
27
|
+
def run_on_additions(paths)
|
28
|
+
relaunch_sporks
|
29
|
+
end
|
30
|
+
|
31
|
+
def run_on_modifications(paths)
|
32
|
+
relaunch_sporks
|
36
33
|
end
|
37
34
|
|
38
35
|
def stop
|
39
36
|
runner.kill_sporks
|
40
37
|
end
|
41
38
|
|
39
|
+
private
|
40
|
+
|
41
|
+
def relaunch_sporks
|
42
|
+
runner.kill_sporks
|
43
|
+
runner.launch_sporks("reload")
|
44
|
+
end
|
45
|
+
|
42
46
|
end
|
43
47
|
end
|
@@ -57,14 +57,14 @@ module Guard
|
|
57
57
|
|
58
58
|
def command
|
59
59
|
parts = []
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
60
|
+
if use_bundler?
|
61
|
+
parts << "bundle"
|
62
|
+
parts << "exec"
|
63
|
+
end
|
64
|
+
if use_foreman?
|
65
|
+
parts << "foreman"
|
66
|
+
parts << "run"
|
67
|
+
end
|
68
68
|
parts << "spork"
|
69
69
|
|
70
70
|
if type == :test_unit
|
@@ -76,7 +76,7 @@ module Guard
|
|
76
76
|
end
|
77
77
|
|
78
78
|
parts << "-p"
|
79
|
-
|
79
|
+
parts << port.to_s
|
80
80
|
parts << "-q" if options[:quiet]
|
81
81
|
|
82
82
|
if use_foreman?
|
@@ -20,7 +20,7 @@ module Guard
|
|
20
20
|
spork_processes.map { |process| process[:pid] }
|
21
21
|
end
|
22
22
|
|
23
|
-
private
|
23
|
+
private
|
24
24
|
|
25
25
|
def drb_ready?
|
26
26
|
DRb.start_service
|
@@ -50,8 +50,8 @@ module Guard
|
|
50
50
|
require "win32ole"
|
51
51
|
WIN32OLE.connect("winmgmts://.").InstancesOf("win32_process").
|
52
52
|
each.
|
53
|
-
select do |p|
|
54
|
-
p.commandline =~ /spork|ring_server|magazine_slave_provider/ &&
|
53
|
+
select do |p|
|
54
|
+
p.commandline =~ /spork|ring_server|magazine_slave_provider/ &&
|
55
55
|
File.basename(p.executablepath, File.extname(p.executablepath)) =~ /^(cmd|ruby)$/i
|
56
56
|
end.
|
57
57
|
map { |p| {:pid => p.processid, :ppid => p.parentprocessid} }
|
@@ -1,4 +1,4 @@
|
|
1
|
-
guard
|
1
|
+
guard :spork, :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
|
2
2
|
watch('config/application.rb')
|
3
3
|
watch('config/environment.rb')
|
4
4
|
watch('config/environments/test.rb')
|
data/lib/guard/spork/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-spork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibaud Guillaume-Gentil
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.8.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.8.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spork
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|