File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- ruby-nginx (1.0.3 )
4+ ruby-nginx (1.0.4 )
55 erb
66 thor
77 tty-command (~> 0.10 , >= 0.10.1 )
Original file line number Diff line number Diff line change @@ -16,14 +16,23 @@ def initialize(sudo: false)
1616 def run
1717 super
1818 rescue Ruby ::Nginx ::StopError => e
19+ return if nginx_not_running_error? ( e )
20+
1921 if @sudo
20- # Nginx is not running - ignore.
21- raise unless e . message . include? ( "invalid PID number" )
22+ raise
2223 else
2324 # Elevate to sudo and try again.
2425 self . class . new ( sudo : true ) . run
2526 end
2627 end
28+
29+ private
30+
31+ def nginx_not_running_error? ( error )
32+ error . message . include? ( "invalid PID number" ) ||
33+ error . message . include? ( "No such process" ) ||
34+ error . message . include? ( "No such file or directory" )
35+ end
2736 end
2837 end
2938 end
Original file line number Diff line number Diff line change 22
33module Ruby
44 module Nginx
5- VERSION = "1.0.3 "
5+ VERSION = "1.0.4 "
66
77 Version = Gem ::Version
88 end
You can’t perform that action at this time.
0 commit comments