stethoscope 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :gemcutter
1
+ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in stethoscope.gemspec
4
4
  gemspec
data/Gemfile.lock CHANGED
@@ -7,7 +7,7 @@ PATH
7
7
  tilt (>= 1.0)
8
8
 
9
9
  GEM
10
- remote: http://rubygems.org/
10
+ remote: https://rubygems.org/
11
11
  specs:
12
12
  dictionary (1.0.0)
13
13
  json_pure (1.5.3)
data/lib/stethoscope.rb CHANGED
@@ -128,14 +128,17 @@ class Stethoscope
128
128
  status = responses.any?{ |k,v| v[:status] && !((200..299).include?(v[:status])) } ? 500 : 200
129
129
  _format = format(request.path)
130
130
 
131
+ headers = { 'Content-Type' => 'text/html' }
132
+
131
133
  case format(request.path)
132
134
  when :html
133
135
  result = Stethoscope.template.render(Object.new, :checks => responses)
134
136
  when :json
135
137
  result = {:checks => responses, :status => status}.to_json
138
+ headers['Content-Type'] = 'application/json'
136
139
  end
137
140
 
138
- Rack::Response.new(result, status).finish
141
+ Rack::Response.new(result, status, headers).finish
139
142
  end
140
143
 
141
144
  private
@@ -1,3 +1,3 @@
1
1
  class Stethoscope
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -25,6 +25,7 @@ class TestStethoscope
25
25
  test do
26
26
  response = get "/heartbeat"
27
27
  assert { response.status == 200 }
28
+ assert { response.headers['Content-Type'] == 'text/html' }
28
29
  assert { response.body.to_s =~ /Ba-Boomp/ }
29
30
  end
30
31
 
@@ -42,7 +43,8 @@ class TestStethoscope
42
43
  Stethoscope.check(:bar){ |response| response[:status] = 200; response[:test2] = :test2 }
43
44
 
44
45
  response = get "/heartbeat.json"
45
- assert { response.status == 200 }
46
+ assert { response.status == 200 }
47
+ assert { response.headers['Content-Type'] == 'application/json' }
46
48
  assert { response.body !~ /default/ }
47
49
  result = JSON.parse(response.body)
48
50
  assert { result['status'] == 200 }
metadata CHANGED
@@ -1,181 +1,183 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: stethoscope
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Daniel Neighman
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-08-17 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-03-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: rack
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">"
27
- - !ruby/object:Gem::Version
28
- hash: 15
29
- segments:
30
- - 1
31
- - 0
32
- version: "1.0"
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>'
20
+ - !ruby/object:Gem::Version
21
+ version: '1.0'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: dictionary
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 15
44
- segments:
45
- - 1
46
- - 0
47
- version: "1.0"
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>'
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: dictionary
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '1.0'
48
38
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: tilt
52
39
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 15
59
- segments:
60
- - 1
61
- - 0
62
- version: "1.0"
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '1.0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: tilt
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '1.0'
63
54
  type: :runtime
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- name: bundler
67
55
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
69
- none: false
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- hash: 23
74
- segments:
75
- - 1
76
- - 0
77
- - 0
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: bundler
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
78
69
  version: 1.0.0
79
70
  type: :development
80
- version_requirements: *id004
81
- - !ruby/object:Gem::Dependency
82
- name: rspec-core
83
71
  prerelease: false
84
- requirement: &id005 !ruby/object:Gem::Requirement
85
- none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- hash: 62196427
90
- segments:
91
- - 2
92
- - 0
93
- - 0
94
- - beta
95
- - 20
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 1.0.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: rspec-core
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
96
85
  version: 2.0.0.beta.20
97
86
  type: :development
98
- version_requirements: *id005
99
- - !ruby/object:Gem::Dependency
100
- name: nanotest
101
87
  prerelease: false
102
- requirement: &id006 !ruby/object:Gem::Requirement
103
- none: false
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- hash: 3
108
- segments:
109
- - 0
110
- version: "0"
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: 2.0.0.beta.20
94
+ - !ruby/object:Gem::Dependency
95
+ name: nanotest
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
111
102
  type: :development
112
- version_requirements: *id006
113
- - !ruby/object:Gem::Dependency
114
- name: nanotest_extensions
115
103
  prerelease: false
116
- requirement: &id007 !ruby/object:Gem::Requirement
117
- none: false
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- hash: 3
122
- segments:
123
- - 0
124
- version: "0"
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: nanotest_extensions
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
125
118
  type: :development
126
- version_requirements: *id007
127
- - !ruby/object:Gem::Dependency
128
- name: rake
129
119
  prerelease: false
130
- requirement: &id008 !ruby/object:Gem::Requirement
131
- none: false
132
- requirements:
133
- - - ">="
134
- - !ruby/object:Gem::Version
135
- hash: 3
136
- segments:
137
- - 0
138
- version: "0"
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: rake
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
139
134
  type: :development
140
- version_requirements: *id008
141
- - !ruby/object:Gem::Dependency
142
- name: rack-test
143
135
  prerelease: false
144
- requirement: &id009 !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- hash: 3
150
- segments:
151
- - 0
152
- version: "0"
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: rack-test
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
153
150
  type: :development
154
- version_requirements: *id009
155
- - !ruby/object:Gem::Dependency
156
- name: json_pure
157
151
  prerelease: false
158
- requirement: &id010 !ruby/object:Gem::Requirement
159
- none: false
160
- requirements:
161
- - - ">="
162
- - !ruby/object:Gem::Version
163
- hash: 3
164
- segments:
165
- - 0
166
- version: "0"
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: json_pure
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
167
166
  type: :development
168
- version_requirements: *id010
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
169
174
  description: Heartbeat middleware for responding to heartbeat pings
170
- email:
175
+ email:
171
176
  - has.sox@gmail.com
172
177
  executables: []
173
-
174
178
  extensions: []
175
-
176
179
  extra_rdoc_files: []
177
-
178
- files:
180
+ files:
179
181
  - .gitignore
180
182
  - .rvmrc
181
183
  - Gemfile
@@ -194,38 +196,27 @@ files:
194
196
  - test/test_stethoscope.rb
195
197
  homepage: http://rubygems.org/gems/stethoscope
196
198
  licenses: []
197
-
198
199
  post_install_message:
199
200
  rdoc_options: []
200
-
201
- require_paths:
201
+ require_paths:
202
202
  - lib
203
- required_ruby_version: !ruby/object:Gem::Requirement
203
+ required_ruby_version: !ruby/object:Gem::Requirement
204
204
  none: false
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- hash: 3
209
- segments:
210
- - 0
211
- version: "0"
212
- required_rubygems_version: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ! '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ required_rubygems_version: !ruby/object:Gem::Requirement
213
210
  none: false
214
- requirements:
215
- - - ">="
216
- - !ruby/object:Gem::Version
217
- hash: 23
218
- segments:
219
- - 1
220
- - 3
221
- - 6
211
+ requirements:
212
+ - - ! '>='
213
+ - !ruby/object:Gem::Version
222
214
  version: 1.3.6
223
215
  requirements: []
224
-
225
216
  rubyforge_project: stethoscope
226
- rubygems_version: 1.8.6
217
+ rubygems_version: 1.8.24
227
218
  signing_key:
228
219
  specification_version: 3
229
220
  summary: Heartbeat middleware for responding to heartbeat pings
230
221
  test_files: []
231
-
222
+ has_rdoc: