guard-spork 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -91,6 +91,8 @@ guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'cucumber' }, :rspec_env => { '
91
91
  end
92
92
  ```
93
93
 
94
+ If your application runs on [Heroku](http://www.heroku.com/) or otherwise uses [Foreman](https://github.com/ddollar/foreman), you can provide the `:foreman => true` option to have environment variables present in the `.env` file passed on to the Spork server.
95
+
94
96
  Available options:
95
97
 
96
98
  ``` ruby
@@ -107,6 +109,7 @@ Available options:
107
109
  :cucumber_env => { 'RAILS_ENV' => 'bar' } # Default: nil
108
110
  :aggressive_kill => false # Default: true, will search Spork pids from `ps aux` and kill them all on start.
109
111
  :notify_on_start => true # Default: false, will notify as soon as starting begins.
112
+ :foreman => true # Default: false, will start Spork through `foreman run` to pick up environment variables used by Foreman.
110
113
  ```
111
114
 
112
115
  ## Common troubleshooting
@@ -18,6 +18,7 @@ module Guard
18
18
  options[:minitest_env] ||= {}
19
19
  options[:minitest] ||= false
20
20
  options[:aggressive_kill] = true unless options[:aggressive_kill] == false
21
+ options[:foreman] ||= false
21
22
  @options = options
22
23
  initialize_spork_instances
23
24
  end
@@ -50,7 +51,7 @@ module Guard
50
51
  @spork_instances = []
51
52
  [:rspec, :cucumber, :test_unit, :minitest].each do |type|
52
53
  port, env = options[:"#{type}_port"], options[:"#{type}_env"]
53
- spork_instances << SporkInstance.new(type, port, env, :bundler => should_use?(:bundler)) if should_use?(type)
54
+ spork_instances << SporkInstance.new(type, port, env, :bundler => should_use?(:bundler), :foreman => should_use?(:foreman)) if should_use?(type)
54
55
  end
55
56
  end
56
57
 
@@ -124,10 +125,14 @@ module Guard
124
125
  def detect_minitest
125
126
  false
126
127
  end
127
-
128
+
128
129
  def detect_cucumber
129
130
  File.exist?("features")
130
131
  end
132
+
133
+ def detect_foreman
134
+ File.exist?("Procfile")
135
+ end
131
136
  end
132
137
  end
133
138
  end
@@ -51,6 +51,7 @@ module Guard
51
51
  def command
52
52
  parts = []
53
53
  parts << "bundle exec" if use_bundler?
54
+ parts << "foreman run" if use_foreman?
54
55
  parts << "spork"
55
56
 
56
57
  if type == :test_unit
@@ -80,6 +81,10 @@ module Guard
80
81
  options[:bundler]
81
82
  end
82
83
 
84
+ def use_foreman?
85
+ options[:foreman]
86
+ end
87
+
83
88
  end
84
89
  end
85
90
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module SporkVersion
3
- VERSION = "0.6.1"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
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: 0.6.1
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-09 00:00:00.000000000 Z
12
+ date: 2012-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
16
- requirement: &70168472906160 !ruby/object:Gem::Requirement
16
+ requirement: &70202560383460 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.10.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70168472906160
24
+ version_requirements: *70202560383460
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: spork
27
- requirement: &70168472905700 !ruby/object:Gem::Requirement
27
+ requirement: &70202560383000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.8.4
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70168472905700
35
+ version_requirements: *70202560383000
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &70168472905240 !ruby/object:Gem::Requirement
38
+ requirement: &70202560382540 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70168472905240
46
+ version_requirements: *70202560382540
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &70168472904780 !ruby/object:Gem::Requirement
49
+ requirement: &70202560382080 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '2.6'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70168472904780
57
+ version_requirements: *70202560382080
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: guard-rspec
60
- requirement: &70168472904320 !ruby/object:Gem::Requirement
60
+ requirement: &70202560381620 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0.4'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70168472904320
68
+ version_requirements: *70202560381620
69
69
  description: Guard::Spork automatically manage Spork DRb servers.
70
70
  email:
71
71
  - thibaud@thibaud.me