philae 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rack/philae_rack.rb +16 -0
  3. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fb2abe798bfe65ac1f77da6a0284195eb73db03
4
- data.tar.gz: 841db519d68f08b8de7187415b5d428391154780
3
+ metadata.gz: 707a119eee0ecc09e66ced7697e524cc62b16152
4
+ data.tar.gz: 6e2d7473196edc923604cd09674b4400181b77ac
5
5
  SHA512:
6
- metadata.gz: 3c43748351457a9cdbe040a88fa8d557e47aae050fe73f3574e0ae56dafd22455d3ac940fc273239d328467bc9630714dba3fa5ae6963737cc5327cbcca08f21
7
- data.tar.gz: 15527a9c4fa412943be8af12fdcaf96d8badf7d28c113798c987871954cfec84b8c7d1b323fe2b3077afc9a591f19cc41b996cf53c6e27ba37cecd71c4befc06
6
+ metadata.gz: f2b666b3f40f4c92d910b107b258ee0b11dfa934acf89ce44fbb900d33de4a6f1df7e0c26306febb44191d516f30e927379ee340d522046aef4d00a16a7d41e9
7
+ data.tar.gz: 46333b2d80f2600501155ef1b2412a4aa7bcdd4579f72fbab3a3bb6be929c2a823ac8817fea9817599fde4abf5b61d010cc9166c925d643a636b38ba20af3714
@@ -0,0 +1,16 @@
1
+ module Rack
2
+ class PhilaeRack
3
+ def initialize(app, prober)
4
+ @app = app
5
+ @prober = prober
6
+ end
7
+
8
+ def call(env)
9
+ if env['PATH_INFO'] == '/_health'
10
+ [200, { 'Content-type' => 'application/json' }, [@prober.check.to_json]]
11
+ else
12
+ @app.call(env)
13
+ end
14
+ end
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: philae
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - leo@scalingo.com
@@ -66,6 +66,7 @@ files:
66
66
  - lib/philae/nsq_probe.rb
67
67
  - lib/philae/philae_probe.rb
68
68
  - lib/philae/prober.rb
69
+ - lib/rack/philae_rack.rb
69
70
  homepage: https://scalingo.com
70
71
  licenses:
71
72
  - BSD-3-Clause