mizuno 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -109,6 +109,12 @@ Choice.options do
109
109
  default false
110
110
  end
111
111
 
112
+ option :restart do
113
+ long '--restart'
114
+ desc 'starts a new instance if needed when reloading'
115
+ default false
116
+ end
117
+
112
118
  option :reloadable do
113
119
  long '--reloadable'
114
120
  desc 'sets up live reloading via mizuno/reloader'
data/lib/mizuno/runner.rb CHANGED
@@ -101,6 +101,10 @@ module Mizuno
101
101
  Runner.daemonize(options) if options.delete(:daemonize)
102
102
 
103
103
  # Fire up Mizuno as if it was called from Rackup.
104
+ Runner.start(options)
105
+ end
106
+
107
+ def Runner.start(options)
104
108
  Dir.chdir(options[:root])
105
109
  Logger.configure(options)
106
110
  ENV['RACK_ENV'] = options[:env]
@@ -154,7 +158,10 @@ module Mizuno
154
158
  # Reload a running daemon by SIGHUPing it.
155
159
  #
156
160
  def Runner.reload(options)
157
- pid = Runner.pid(options) or die("Mizuno isn't running.")
161
+ pid = Runner.pid(options)
162
+ return(Runner.daemonize(options)) \
163
+ if(pid.nil? and options.delete(:restart))
164
+ die("Mizuno is currently not running.") unless pid
158
165
  Process.kill("HUP", pid)
159
166
  die("Mizuno signaled to reload app.", true)
160
167
  end
@@ -1,3 +1,3 @@
1
1
  module Mizuno
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: mizuno
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.3
5
+ version: 0.6.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Don Werve
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-29 00:00:00.000000000Z
12
+ date: 2012-05-15 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack