guard-passenger 0.4.0 → 0.5.0
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/lib/guard/passenger.rb +13 -24
- data/lib/guard/passenger/runner.rb +4 -0
- data/lib/guard/passenger/version.rb +1 -1
- metadata +55 -101
data/lib/guard/passenger.rb
CHANGED
@@ -8,12 +8,16 @@ module Guard
|
|
8
8
|
autoload :Runner, 'guard/passenger/runner'
|
9
9
|
autoload :Pinger, 'guard/passenger/pinger'
|
10
10
|
|
11
|
-
attr_reader :cli_start, :cli_stop, :ping, :notification, :sudo
|
11
|
+
attr_reader :cli_start, :cli_stop, :ping, :notification, :sudo, :running
|
12
12
|
|
13
13
|
def standalone?
|
14
14
|
@standalone
|
15
15
|
end
|
16
16
|
|
17
|
+
def running?
|
18
|
+
@running
|
19
|
+
end
|
20
|
+
|
17
21
|
# =================
|
18
22
|
# = Guard methods =
|
19
23
|
# =================
|
@@ -21,19 +25,12 @@ module Guard
|
|
21
25
|
def initialize(watchers = [], options = {})
|
22
26
|
super
|
23
27
|
|
24
|
-
warn_deprectation options
|
25
28
|
@standalone = options[:standalone].nil? ? true : options[:standalone]
|
26
29
|
@cli_start = init_cli(options)
|
27
30
|
@cli_stop = cli_stop
|
28
31
|
@notification = options[:notification].nil? ? true : options[:notification]
|
29
32
|
|
30
|
-
|
31
|
-
UI.info "Warning: The :touch option has been replaced by the :ping option, usage is still the same."
|
32
|
-
options[:touch]
|
33
|
-
else
|
34
|
-
options[:ping]
|
35
|
-
end
|
36
|
-
@ping = ping_opt.eql?(true) ? '/' : ping_opt
|
33
|
+
@ping = options[:ping].eql?(true) ? '/' : options[:ping]
|
37
34
|
|
38
35
|
@sudo = options[:sudo] || ''
|
39
36
|
@sudo = @sudo.eql?(true) ? 'sudo' : @sudo
|
@@ -42,12 +39,16 @@ module Guard
|
|
42
39
|
# Call once when guard starts
|
43
40
|
def start
|
44
41
|
UI.info 'Guard::Passenger is running!'
|
45
|
-
standalone?
|
42
|
+
if standalone?
|
43
|
+
running = Runner.start_passenger(cli_start, @sudo)
|
44
|
+
else
|
45
|
+
true
|
46
|
+
end
|
46
47
|
end
|
47
48
|
|
48
49
|
# Call with Ctrl-C signal (when Guard quit)
|
49
50
|
def stop
|
50
|
-
if standalone?
|
51
|
+
if standalone? && running?
|
51
52
|
UI.info 'Stopping Passenger...'
|
52
53
|
Runner.stop_passenger(cli_stop, @sudo)
|
53
54
|
end
|
@@ -60,7 +61,7 @@ module Guard
|
|
60
61
|
end
|
61
62
|
|
62
63
|
# Call on file(s) modifications
|
63
|
-
def
|
64
|
+
def run_on_changes(paths = {})
|
64
65
|
restart_and_ping
|
65
66
|
end
|
66
67
|
|
@@ -69,8 +70,6 @@ module Guard
|
|
69
70
|
def init_cli options={}
|
70
71
|
cmd_parts = []
|
71
72
|
cmd_parts << (options[:cli].nil? ? '--daemonize' : options[:cli])
|
72
|
-
cmd_parts << "--port #{options[:port]}" if options[:port] #DEPRICATED
|
73
|
-
cmd_parts << "--environment #{options[:env]}" if options[:env] #DEPRICATED
|
74
73
|
cmd_parts.join(' ')
|
75
74
|
end
|
76
75
|
|
@@ -112,15 +111,5 @@ module Guard
|
|
112
111
|
restarted
|
113
112
|
end
|
114
113
|
|
115
|
-
def warn_deprectation(options={})
|
116
|
-
options[:environment] = options[:env] if options[:env]
|
117
|
-
[:port, :environment].each do |option|
|
118
|
-
key, value = [option, option.to_s.gsub('_', '-')]
|
119
|
-
if options.key?(key)
|
120
|
-
UI.info "DEPRECATION WARNING: The :#{key} option is deprecated. Pass standard command line argument \"--#{value}\" to Passenger with the :cli option."
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
114
|
end
|
126
115
|
end
|
@@ -9,6 +9,7 @@ module Guard
|
|
9
9
|
UI.info "Passenger successfully restarted."
|
10
10
|
else
|
11
11
|
UI.error "Passenger failed to restart!"
|
12
|
+
throw :task_has_failed
|
12
13
|
end
|
13
14
|
succeed
|
14
15
|
end
|
@@ -20,10 +21,12 @@ module Guard
|
|
20
21
|
UI.info "Passenger standalone started."
|
21
22
|
else
|
22
23
|
UI.error "Passenger standalone failed to start!"
|
24
|
+
throw :task_has_failed
|
23
25
|
end
|
24
26
|
succeed
|
25
27
|
else
|
26
28
|
UI.error "Passenger standalone is not installed. You need at least Passenger version >= 3.0.0.\nPlease run 'gem install passenger' or add it to your Gemfile."
|
29
|
+
throw :task_has_failed
|
27
30
|
false
|
28
31
|
end
|
29
32
|
end
|
@@ -34,6 +37,7 @@ module Guard
|
|
34
37
|
UI.info "Passenger standalone stopped."
|
35
38
|
else
|
36
39
|
UI.error "Passenger standalone failed to stop!"
|
40
|
+
throw :task_has_failed
|
37
41
|
end
|
38
42
|
succeed
|
39
43
|
end
|
metadata
CHANGED
@@ -1,112 +1,78 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-passenger
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
- 0
|
10
|
-
version: 0.4.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Fabio Kuhn
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-06-07 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: guard
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70327437921720 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 0
|
32
|
-
- 0
|
33
|
-
version: 1.0.0
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.1.0.beta
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: bundler
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: *70327437921720
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: bundler
|
27
|
+
requirement: &70327437921260 !ruby/object:Gem::Requirement
|
40
28
|
none: false
|
41
|
-
requirements:
|
29
|
+
requirements:
|
42
30
|
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 1
|
47
|
-
- 0
|
48
|
-
- 7
|
49
|
-
version: 1.0.7
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.1.3
|
50
33
|
type: :development
|
51
|
-
version_requirements: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: rspec
|
54
34
|
prerelease: false
|
55
|
-
|
35
|
+
version_requirements: *70327437921260
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
requirement: &70327437920800 !ruby/object:Gem::Requirement
|
56
39
|
none: false
|
57
|
-
requirements:
|
40
|
+
requirements:
|
58
41
|
- - ~>
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
|
61
|
-
segments:
|
62
|
-
- 2
|
63
|
-
- 2
|
64
|
-
- 0
|
65
|
-
version: 2.2.0
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 2.10.0
|
66
44
|
type: :development
|
67
|
-
version_requirements: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: guard-rspec
|
70
45
|
prerelease: false
|
71
|
-
|
46
|
+
version_requirements: *70327437920800
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: guard-rspec
|
49
|
+
requirement: &70327437920340 !ruby/object:Gem::Requirement
|
72
50
|
none: false
|
73
|
-
requirements:
|
51
|
+
requirements:
|
74
52
|
- - ~>
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
segments:
|
78
|
-
- 0
|
79
|
-
- 1
|
80
|
-
- 8
|
81
|
-
version: 0.1.8
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.7.3
|
82
55
|
type: :development
|
83
|
-
version_requirements: *id004
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: guard-bundler
|
86
56
|
prerelease: false
|
87
|
-
|
57
|
+
version_requirements: *70327437920340
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: guard-bundler
|
60
|
+
requirement: &70327437919880 !ruby/object:Gem::Requirement
|
88
61
|
none: false
|
89
|
-
requirements:
|
62
|
+
requirements:
|
90
63
|
- - ~>
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
- 1
|
96
|
-
- 1
|
97
|
-
version: 0.1.1
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.1.3
|
98
66
|
type: :development
|
99
|
-
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70327437919880
|
100
69
|
description: Guard::Passenger automatically restarts Passenger when needed.
|
101
|
-
email:
|
70
|
+
email:
|
102
71
|
- mordaroso@gmail.com
|
103
72
|
executables: []
|
104
|
-
|
105
73
|
extensions: []
|
106
|
-
|
107
74
|
extra_rdoc_files: []
|
108
|
-
|
109
|
-
files:
|
75
|
+
files:
|
110
76
|
- lib/guard/passenger/pinger.rb
|
111
77
|
- lib/guard/passenger/runner.rb
|
112
78
|
- lib/guard/passenger/templates/Guardfile
|
@@ -116,38 +82,26 @@ files:
|
|
116
82
|
- README.rdoc
|
117
83
|
homepage: http://rubygems.org/gems/guard-passenger
|
118
84
|
licenses: []
|
119
|
-
|
120
85
|
post_install_message:
|
121
86
|
rdoc_options: []
|
122
|
-
|
123
|
-
require_paths:
|
87
|
+
require_paths:
|
124
88
|
- lib
|
125
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
90
|
none: false
|
127
|
-
requirements:
|
128
|
-
- -
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
|
131
|
-
|
132
|
-
- 0
|
133
|
-
version: "0"
|
134
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
96
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
hash: 23
|
140
|
-
segments:
|
141
|
-
- 1
|
142
|
-
- 3
|
143
|
-
- 6
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
144
100
|
version: 1.3.6
|
145
101
|
requirements: []
|
146
|
-
|
147
102
|
rubyforge_project: guard-passenger
|
148
|
-
rubygems_version: 1.8.
|
103
|
+
rubygems_version: 1.8.17
|
149
104
|
signing_key:
|
150
105
|
specification_version: 3
|
151
106
|
summary: Guard gem for Passenger
|
152
107
|
test_files: []
|
153
|
-
|