pinglish 0.2.0 → 0.2.1

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: ec75a2a5a2073dc30123f704f3a6536a2ebabc6b
4
+ data.tar.gz: 9fd7d437d56004b82994196e51db7a2abcfa4794
5
+ SHA512:
6
+ metadata.gz: bcbb41a1c0edce38cd0b886cdde067816473f69b8fb2b0af2b28f1f83fb2c042957c9ab585abb02db9d05a8741c4216a6be6c4a296235fbbcef8e0d4a9fc6fe5
7
+ data.tar.gz: 63909466cfb0eb89c2d4a050101761a22c422d1353b7908fdd628e3a5778c2b986841281b7d18248e344cb3a016568657f283af433a0da7eadb26c56a2f1283c
@@ -41,18 +41,11 @@ class Pinglish
41
41
 
42
42
  return @app.call env unless request.path_info == @path
43
43
 
44
- groups = [].map(&:to_s) # FIX
45
-
46
44
  begin
47
- timeout @timeout do
45
+ timeout @max do
48
46
  results = {}
49
- filtered = @checks.values
50
-
51
- unless groups.empty?
52
- filtered = filtered.select { |c| groups.include? c.group.to_s }
53
- end
54
47
 
55
- filtered.each do |check|
48
+ @checks.values.each do |check|
56
49
  begin
57
50
  timeout check.timeout do
58
51
  results[check.name] = check.call
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "pinglish"
5
- gem.version = "0.2.0"
5
+ gem.version = "0.2.1"
6
6
  gem.authors = ["John Barnette", "Will Farrington"]
7
7
  gem.email = ["jbarnette@github.com", "wfarr@github.com"]
8
8
  gem.description = "A simple Rack middleware for checking app health."
@@ -138,6 +138,23 @@ class PinglishTest < MiniTest::Unit::TestCase
138
138
  assert_equal ["long"], json["timeouts"]
139
139
  end
140
140
 
141
+ def test_with_checks_taking_more_than_max
142
+ app = build_app(:max => 0.001) do |ping|
143
+ ping.check(:long) { sleep 0.003 }
144
+ end
145
+
146
+ session = Rack::Test::Session.new(app)
147
+ session.get "/_ping"
148
+
149
+ assert_equal 503, session.last_response.status
150
+ assert_equal "application/json; charset=UTF-8",
151
+ session.last_response.content_type
152
+
153
+ json = JSON.load(session.last_response.body)
154
+ assert json.key?("now")
155
+ assert_equal "failures", json["status"]
156
+ end
157
+
141
158
  def test_with_script_name
142
159
  app = build_app
143
160
 
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pinglish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
5
- prerelease:
4
+ version: 0.2.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - John Barnette
@@ -10,54 +9,48 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-06-26 00:00:00.000000000 Z
12
+ date: 2014-11-13 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rack
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - ">="
21
19
  - !ruby/object:Gem::Version
22
20
  version: '0'
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: '0'
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: minitest
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ~>
32
+ - - "~>"
37
33
  - !ruby/object:Gem::Version
38
34
  version: '4.5'
39
35
  type: :development
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ~>
39
+ - - "~>"
45
40
  - !ruby/object:Gem::Version
46
41
  version: '4.5'
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: rack-test
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ~>
46
+ - - "~>"
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0.6'
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ~>
53
+ - - "~>"
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0.6'
63
56
  description: A simple Rack middleware for checking app health.
@@ -68,7 +61,7 @@ executables: []
68
61
  extensions: []
69
62
  extra_rdoc_files: []
70
63
  files:
71
- - .gitignore
64
+ - ".gitignore"
72
65
  - Gemfile
73
66
  - LICENSE
74
67
  - README.md
@@ -83,28 +76,27 @@ files:
83
76
  - test/pinglish_test.rb
84
77
  homepage: https://github.com/jbarnette/pinglish
85
78
  licenses: []
79
+ metadata: {}
86
80
  post_install_message:
87
81
  rdoc_options: []
88
82
  require_paths:
89
83
  - lib
90
84
  required_ruby_version: !ruby/object:Gem::Requirement
91
- none: false
92
85
  requirements:
93
- - - ! '>='
86
+ - - ">="
94
87
  - !ruby/object:Gem::Version
95
88
  version: '0'
96
89
  required_rubygems_version: !ruby/object:Gem::Requirement
97
- none: false
98
90
  requirements:
99
- - - ! '>='
91
+ - - ">="
100
92
  - !ruby/object:Gem::Version
101
93
  version: '0'
102
94
  requirements: []
103
95
  rubyforge_project:
104
- rubygems_version: 1.8.23
96
+ rubygems_version: 2.2.2
105
97
  signing_key:
106
- specification_version: 3
107
- summary: /_ping your way to freedom.
98
+ specification_version: 4
99
+ summary: "/_ping your way to freedom."
108
100
  test_files:
109
101
  - test/check_test.rb
110
102
  - test/helper.rb