rack-ping 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 90b7783a41c143f1949f0f573e49afa22f48b3c1
4
+ data.tar.gz: 094946fb4866de3e5a1c1c94675577f9b5044069
5
+ SHA512:
6
+ metadata.gz: bcddf45b040ef116c645045f6137245753420d269f0f37758664d97e97093971136a1adf7718507650ca45530ccd3c7b7d3f3f9330c02f324e57ebe4ef597ded
7
+ data.tar.gz: 8feaa0fa03f0c3ecc6557e919fb499ec4a20b43f69739ff4f1ccfb5be096fef0df9bb4c6259421177918bd7830a1b8da4ff73e25ced0fbcc200daf0ab684365a
data/README.md CHANGED
@@ -3,16 +3,44 @@ A Rack middleware that should indicate the health of your service.
3
3
 
4
4
 
5
5
  ## Usage
6
- Here is a simple example (see `examples`)
7
6
 
8
- map '/ping' do
9
- use Rack::Ping do |ping|
10
- ping.check_url "http://localhost:9292/"
11
- ping.ok_regex /goodbye/
12
- end
13
- end
7
+ Here is a simple example (see `examples`):
14
8
 
15
- run lambda{|env| [200, {'Content-Type' => 'text/html'}, ["hello"]]}
9
+ ```ruby
10
+ map '/ping' do
11
+ use Rack::Ping do |ping|
12
+ ping.check_url "http://localhost:9292/"
13
+ ping.ok_regex /goodbye/
14
+ end
15
+ end
16
+
17
+ run lambda{|env| [200, {'Content-Type' => 'text/html'}, ["hello"]]}
18
+ ```
19
+
20
+ If you also run on Rails, for more control, you can also use it in directly your routes:
21
+
22
+ ```ruby
23
+ # no block
24
+ Rails.application.routes.draw do
25
+ mount Rack::Ping.new => '/ping'
26
+ end
27
+
28
+ # using a ping block
29
+ Rails.application.routes.draw do
30
+ mount Rack::Ping.new { |ping|
31
+ ping.check_url "http://example.com"
32
+ }, at: '/ping'
33
+ end
34
+ ```
35
+
36
+
37
+ Note: for pre-1.4.0 Rack, do this:
38
+
39
+ p = Rack::Ping.new
40
+ p.check { true }
41
+ run Rack::URLMap.new("/" => My::App, "/ping" => p)
42
+
43
+ Due to different `to_app` strategy: https://github.com/rack/rack/blob/master/lib/rack/builder.rb#L130
16
44
 
17
45
  ## Options
18
46
 
@@ -4,7 +4,7 @@ module Rack
4
4
  class Ping
5
5
  attr_reader :config
6
6
 
7
- def initialize(app)
7
+ def initialize(app=nil)
8
8
  @config = {
9
9
  :version => '0',
10
10
  :check_url => nil,
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Ping
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'guard-minitest'
22
22
  s.add_development_dependency 'rack-test'
23
23
  s.add_development_dependency 'webmock'
24
+ s.add_development_dependency 'guard'
24
25
  end
metadata CHANGED
@@ -1,49 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-ping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dotan Nahum
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-01-19 00:00:00.000000000Z
11
+ date: 2015-05-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: guard-minitest
16
- requirement: &73903340 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *73903340
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: rack-test
27
- requirement: &73903130 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *73903130
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: webmock
38
- requirement: &73902910 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: guard
57
+ requirement: !ruby/object:Gem::Requirement
40
58
  requirements:
41
- - - ! '>='
59
+ - - ">="
42
60
  - !ruby/object:Gem::Version
43
61
  version: '0'
44
62
  type: :development
45
63
  prerelease: false
46
- version_requirements: *73902910
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
47
69
  description: Health checking Rack middleware
48
70
  email:
49
71
  - jondotan@gmail.com
@@ -51,7 +73,7 @@ executables: []
51
73
  extensions: []
52
74
  extra_rdoc_files: []
53
75
  files:
54
- - .gitignore
76
+ - ".gitignore"
55
77
  - Gemfile
56
78
  - Guardfile
57
79
  - README.md
@@ -64,26 +86,27 @@ files:
64
86
  - spec/spec_helper.rb
65
87
  homepage: ''
66
88
  licenses: []
89
+ metadata: {}
67
90
  post_install_message:
68
91
  rdoc_options: []
69
92
  require_paths:
70
93
  - lib
71
94
  required_ruby_version: !ruby/object:Gem::Requirement
72
- none: false
73
95
  requirements:
74
- - - ! '>='
96
+ - - ">="
75
97
  - !ruby/object:Gem::Version
76
98
  version: '0'
77
99
  required_rubygems_version: !ruby/object:Gem::Requirement
78
- none: false
79
100
  requirements:
80
- - - ! '>='
101
+ - - ">="
81
102
  - !ruby/object:Gem::Version
82
103
  version: '0'
83
104
  requirements: []
84
105
  rubyforge_project: rack-ping
85
- rubygems_version: 1.8.10
106
+ rubygems_version: 2.4.5
86
107
  signing_key:
87
- specification_version: 3
108
+ specification_version: 4
88
109
  summary: Health checking Rack middleware
89
- test_files: []
110
+ test_files:
111
+ - spec/rack/ping_spec.rb
112
+ - spec/spec_helper.rb