z4app 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/z4app/version.rb +1 -1
  3. data/lib/z4app.rb +6 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b7bc57600f4e146c9d09e6205205a4e80c0a809531a5e6eb5242029f97df53b
4
- data.tar.gz: 7f7ab4e8799ed72cb10e82c7a6cd82174391f8b48cbf1b9ea55aed9270ec98d1
3
+ metadata.gz: 8aef9eea56d6c25507a813a577ff075e5e3ff79700cdfba5cb43b82fed2e3d31
4
+ data.tar.gz: 055a7302586c350cf558d58f3949a30fec43e54efd215f706b53ad16489dc96a
5
5
  SHA512:
6
- metadata.gz: e04eda590cc1b8081b98e6429fb77edb28f1641c2b3e14228627847fa55657518fe85068a2cd3a1f28f939eb2ed6b38c45eaadf010cc8ffedf25cc0f9d9e0db3
7
- data.tar.gz: 3cd906c0346dedad870d55ce8088e6c84200ed34a4d320c686610c63883f537ce71b65cbd2192e220672182552f58d103805a9ce9ec908270677023a3bfd495b
6
+ metadata.gz: 8dd0fe9c4371415a341e82df5571ef0d998f55715b6b27d4d46d952a2cb20a044348134417d4313485baef302c37d29b38d0b1d6e65191e11b146ebf4e29aadd
7
+ data.tar.gz: a8039199eb7b9ec226c1ca1e8c6a7d98b54b6eca873ccc00dce7a38fbae3c2834afb74491f17fc215985aba25797e42155eaf8398ffb85fd66e7629b96467d4d
data/lib/z4app/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Z4app
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  COMMIT = `git log --format="%H" -n 1`.strip
6
6
  end
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!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: z4app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Olson