guard-passenger 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,5 +1,7 @@
1
1
  = Guard::Passenger
2
2
 
3
+ {<img src="https://secure.travis-ci.org/mordaroso/guard-passenger.png" />}[http://travis-ci.org/mordaroso/guard-passenger]
4
+
3
5
  Guard::Passenger is the useful development server solution. The guard automatically starts Passenger and intelligently restarts the server when needed.
4
6
 
5
7
  == Install
@@ -52,8 +54,9 @@ Guard::Passenger accepts some options for configuration.
52
54
  # :cli string options to pass to passenger command (default: '--daemonize')
53
55
  # :notification boolean Notifications enabled (default: true)
54
56
  # :ping boolean or string ping localhost after Passenger restart (default: false)
57
+ # :sudo boolean or string start Passenger under sudo (default: false)
55
58
 
56
- guard 'passenger', :standalone => false, :cli => '--daemonize --port 3001 --address my_app.local --environment production', :ping => '/foo' do
59
+ guard 'passenger', :standalone => false, :cli => '--daemonize --port 3001 --address my_app.local --environment production', :ping => '/foo', :sudo => 'rvmsudo' do
57
60
  end
58
61
 
59
62
  == Development
@@ -8,7 +8,7 @@ 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
11
+ attr_reader :cli_start, :cli_stop, :ping, :notification, :sudo
12
12
 
13
13
  def standalone?
14
14
  @standalone
@@ -34,18 +34,23 @@ module Guard
34
34
  options[:ping]
35
35
  end
36
36
  @ping = ping_opt.eql?(true) ? '/' : ping_opt
37
+
38
+ @sudo = options[:sudo] || ''
39
+ @sudo = @sudo.eql?(true) ? 'sudo' : @sudo
37
40
  end
38
41
 
39
42
  # Call once when guard starts
40
43
  def start
41
44
  UI.info 'Guard::Passenger is running!'
42
- standalone? ? Runner.start_passenger(cli_start) : true
45
+ standalone? ? Runner.start_passenger(cli_start, @sudo) : true
43
46
  end
44
47
 
45
48
  # Call with Ctrl-C signal (when Guard quit)
46
49
  def stop
47
- UI.info 'Stopping Passenger...'
48
- Runner.stop_passenger(cli_stop) if standalone?
50
+ if standalone?
51
+ UI.info 'Stopping Passenger...'
52
+ Runner.stop_passenger(cli_stop, @sudo)
53
+ end
49
54
  true
50
55
  end
51
56
 
@@ -13,9 +13,9 @@ module Guard
13
13
  succeed
14
14
  end
15
15
 
16
- def start_passenger(cli)
16
+ def start_passenger(cli, sudo = '')
17
17
  if passenger_standalone_installed?
18
- succeed = system("passenger start #{cli}")
18
+ succeed = system("#{sudo} passenger start #{cli}".strip)
19
19
  if succeed
20
20
  UI.info "Passenger standalone started."
21
21
  else
@@ -28,8 +28,8 @@ module Guard
28
28
  end
29
29
  end
30
30
 
31
- def stop_passenger(cli)
32
- succeed = system("passenger stop #{cli}")
31
+ def stop_passenger(cli, sudo = '')
32
+ succeed = system("#{sudo} passenger stop #{cli}".strip)
33
33
  if succeed
34
34
  UI.info "Passenger standalone stopped."
35
35
  else
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module PassengerVersion
3
- VERSION = '0.3.0'
3
+ VERSION = '0.4.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-passenger
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Fabio Kuhn
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-02 00:00:00 +01:00
19
- default_executable:
18
+ date: 2012-02-09 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: guard
@@ -24,13 +23,14 @@ dependencies:
24
23
  requirement: &id001 !ruby/object:Gem::Requirement
25
24
  none: false
26
25
  requirements:
27
- - - ~>
26
+ - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 13
28
+ hash: 23
30
29
  segments:
30
+ - 1
31
+ - 0
31
32
  - 0
32
- - 3
33
- version: "0.3"
33
+ version: 1.0.0
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  - !ruby/object:Gem::Dependency
@@ -114,7 +114,6 @@ files:
114
114
  - lib/guard/passenger.rb
115
115
  - LICENSE
116
116
  - README.rdoc
117
- has_rdoc: true
118
117
  homepage: http://rubygems.org/gems/guard-passenger
119
118
  licenses: []
120
119
 
@@ -146,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
145
  requirements: []
147
146
 
148
147
  rubyforge_project: guard-passenger
149
- rubygems_version: 1.5.0
148
+ rubygems_version: 1.8.15
150
149
  signing_key:
151
150
  specification_version: 3
152
151
  summary: Guard gem for Passenger