z4app 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/z4app/version.rb +1 -1
- data/lib/z4app.rb +6 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8aef9eea56d6c25507a813a577ff075e5e3ff79700cdfba5cb43b82fed2e3d31
|
4
|
+
data.tar.gz: 055a7302586c350cf558d58f3949a30fec43e54efd215f706b53ad16489dc96a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dd0fe9c4371415a341e82df5571ef0d998f55715b6b27d4d46d952a2cb20a044348134417d4313485baef302c37d29b38d0b1d6e65191e11b146ebf4e29aadd
|
7
|
+
data.tar.gz: a8039199eb7b9ec226c1ca1e8c6a7d98b54b6eca873ccc00dce7a38fbae3c2834afb74491f17fc215985aba25797e42155eaf8398ffb85fd66e7629b96467d4d
|
data/lib/z4app/version.rb
CHANGED
data/lib/z4app.rb
CHANGED
@@ -133,6 +133,10 @@ module Z4app
|
|
133
133
|
end
|
134
134
|
|
135
135
|
on_start { puts "[z4app] OK." }
|
136
|
+
|
137
|
+
def die!
|
138
|
+
Process.kill('TERM', Process.pid)
|
139
|
+
end
|
136
140
|
|
137
141
|
# handle dumb shit
|
138
142
|
['robots.txt', 'favicon.ico'].each { |e| get("/#{e}") {}}
|
@@ -189,8 +193,10 @@ module Z4app
|
|
189
193
|
return JSON.generate(@@APP[:post][:index].call(params, request))
|
190
194
|
}
|
191
195
|
end
|
196
|
+
|
192
197
|
# start server
|
193
198
|
def self.init!
|
199
|
+
Signal.trap('INT') { APP.die!; exit!; }
|
194
200
|
Process.detach(fork { APP.run! { puts "[z4app][init] OK." } })
|
195
201
|
end
|
196
202
|
end
|
@@ -203,5 +209,3 @@ else
|
|
203
209
|
puts "[z4app][config] default."
|
204
210
|
end
|
205
211
|
|
206
|
-
# start app
|
207
|
-
@app = Z4app.init!
|