rapporteur 3.1.0 → 3.2.0
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.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.travis.yml +1 -0
- data/Appraisals +4 -0
- data/CHANGELOG.md +15 -1
- data/README.md +11 -16
- data/config/routes.rb +1 -1
- data/gemfiles/sinatra1.x.gemfile +9 -0
- data/lib/rapporteur.rb +1 -0
- data/lib/rapporteur/version.rb +1 -1
- data/spec/requests/sinatra_spec.rb +59 -0
- data/spec/routing/routes_spec.rb +4 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 633181a4b53c700cdd2d1c2c0f8a9f6a5f08acda
|
4
|
+
data.tar.gz: 7b29ca2a1e7c9a57424d246ff8c4aa48732cabce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8641338d699725b6612887fa2a3b2cd5b8d3d0b76f66b6e28e0f8960356d3bf674422f1056224fba79d41c877abace918c183e53fe7fc9286350bef659edb659
|
7
|
+
data.tar.gz: ddf0fe2836eb103f1a0af23d039df8a0fb66eec99fd6d01d66b5589de23526569db5d8c561bce60f1c636633e726fe3afe2c46d2c147b242a932d64a9ade2023
|
data/.rspec
CHANGED
data/.travis.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,22 @@
|
|
1
1
|
# Rapporteur changelog
|
2
2
|
|
3
|
+
[](http://rubygems.org/gems/rapporteur)
|
4
|
+
[](https://travis-ci.org/codeschool/rapporteur)
|
5
|
+
[](https://codeclimate.com/github/codeschool/rapporteur)
|
6
|
+
[](https://gemnasium.com/codeschool/rapporteur)
|
7
|
+
[](http://inch-ci.org/github/codeschool/rapporteur)
|
8
|
+
|
3
9
|
## [HEAD][unreleased] / unreleased
|
4
10
|
|
5
11
|
* No significant changes.
|
6
12
|
|
13
|
+
## [3.2.0][v3.2.0] / 2015-02-02
|
14
|
+
|
15
|
+
* Update the Rails route definition to force (and default) a JSON format. The
|
16
|
+
intent is to fix an issue where Rails auto-appended a `(.:format)` segment to
|
17
|
+
the fixed route and broke `/status.json` route matching. See
|
18
|
+
[codeschool/rapporteur#9](https://github.com/codeschool/rapporteur/issues/9).
|
19
|
+
|
7
20
|
## [3.1.0][v3.1.0] / 2014-07-03
|
8
21
|
|
9
22
|
* Remove the explicit railties dependency (was at `'>= 3.1', '< 4.2'`). This
|
@@ -92,7 +105,8 @@
|
|
92
105
|
* Initial public release.
|
93
106
|
|
94
107
|
|
95
|
-
[unreleased]: https://github.com/codeschool/rapporteur/compare/v3.
|
108
|
+
[unreleased]: https://github.com/codeschool/rapporteur/compare/v3.2.0...master
|
109
|
+
[v3.2.0]: https://github.com/codeschool/rapporteur/compare/v3.1.0...v3.2.0
|
96
110
|
[v3.1.0]: https://github.com/codeschool/rapporteur/compare/v3.0.2...v3.1.0
|
97
111
|
[v3.0.2]: https://github.com/codeschool/rapporteur/compare/v3.0.1...v3.0.2
|
98
112
|
[v3.0.1]: https://github.com/codeschool/rapporteur/compare/v3.0.0...v3.0.1
|
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# Rapporteur (rap-or-TUHR)
|
2
2
|
|
3
|
-
[](http://rubygems.org/gems/rapporteur)
|
4
|
-
[](https://travis-ci.org/codeschool/rapporteur)
|
5
|
-
[](https://codeclimate.com/github/codeschool/rapporteur)
|
3
|
+
[](http://rubygems.org/gems/rapporteur)
|
4
|
+
[](https://travis-ci.org/codeschool/rapporteur)
|
5
|
+
[](https://codeclimate.com/github/codeschool/rapporteur)
|
6
6
|
[](https://gemnasium.com/codeschool/rapporteur)
|
7
|
+
[](http://inch-ci.org/github/codeschool/rapporteur)
|
7
8
|
|
8
9
|
|
9
10
|
This gem provides a singular, status-checking endpoint to your application. The
|
@@ -111,19 +112,13 @@ automatically generated as previously described.
|
|
111
112
|
So, here is an example usage in Sinatra:
|
112
113
|
|
113
114
|
```ruby
|
114
|
-
require
|
115
|
-
require
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
get "/status.json" do
|
122
|
-
status 200
|
123
|
-
json Rapporteur.run.as_json
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
115
|
+
require "rapporteur"
|
116
|
+
require "sinatra/base"
|
117
|
+
|
118
|
+
class MyApp < Sinatra::Base
|
119
|
+
get "/status.json" do
|
120
|
+
content_type :json
|
121
|
+
body Rapporteur.run.as_json.to_json
|
127
122
|
end
|
128
123
|
end
|
129
124
|
```
|
data/config/routes.rb
CHANGED
data/lib/rapporteur.rb
CHANGED
data/lib/rapporteur/version.rb
CHANGED
@@ -0,0 +1,59 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
ENV["RACK_ENV"] = "test"
|
4
|
+
|
5
|
+
begin
|
6
|
+
require "sinatra/base"
|
7
|
+
require "rack/test"
|
8
|
+
|
9
|
+
describe "Sinatra" do
|
10
|
+
include Rack::Test::Methods
|
11
|
+
|
12
|
+
|
13
|
+
class TestApp < Sinatra::Base
|
14
|
+
get "/status.json" do
|
15
|
+
content_type :json
|
16
|
+
body Rapporteur.run.as_json.to_json
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
def app
|
22
|
+
TestApp
|
23
|
+
end
|
24
|
+
|
25
|
+
before do
|
26
|
+
Rapporteur.add_check(Rapporteur::Checks::TimeCheck)
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
subject { get("/status.json") ; last_response }
|
31
|
+
|
32
|
+
it 'responds with HTTP 200' do
|
33
|
+
expect(subject.status).to(eq(200))
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'responds with a JSON content header' do
|
37
|
+
expect(subject.content_type).to(eq(Mime::JSON))
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'responds with valid JSON' do
|
41
|
+
expect { JSON.parse(subject.body) }.not_to(raise_error)
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'contains the time in ISO8601' do
|
45
|
+
allow(Time).to receive(:now).and_return(Time.gm(2013,8,23))
|
46
|
+
expect(subject).to include_status_message('time', /^2013-08-23T00:00:00(?:.000)?Z$/)
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'the response payload' do
|
50
|
+
subject { get("/status.json") ; JSON.parse(last_response.body) }
|
51
|
+
|
52
|
+
it 'does not contain errors' do
|
53
|
+
expect(subject).not_to(have_key('errors'))
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
rescue LoadError
|
59
|
+
end
|
data/spec/routing/routes_spec.rb
CHANGED
@@ -20,4 +20,8 @@ describe "status routes", :type => :routing do
|
|
20
20
|
it 'does not route /status.xml' do
|
21
21
|
expect({ :get => '/status.xml'}).to_not be_routable
|
22
22
|
end
|
23
|
+
|
24
|
+
it 'does not route /status.json.json' do
|
25
|
+
expect({ :get => '/status.json.json'}).to_not be_routable
|
26
|
+
end
|
23
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rapporteur
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Envy Labs
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-02-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- config/routes.rb
|
144
144
|
- gemfiles/rails3.2.gemfile
|
145
145
|
- gemfiles/rails4.x.gemfile
|
146
|
+
- gemfiles/sinatra1.x.gemfile
|
146
147
|
- lib/rapporteur.rb
|
147
148
|
- lib/rapporteur/check_list.rb
|
148
149
|
- lib/rapporteur/checker.rb
|
@@ -169,6 +170,7 @@ files:
|
|
169
170
|
- spec/requests/messsage_addition_spec.rb
|
170
171
|
- spec/requests/no_checks_spec.rb
|
171
172
|
- spec/requests/revision_check_spec.rb
|
173
|
+
- spec/requests/sinatra_spec.rb
|
172
174
|
- spec/requests/time_check_spec.rb
|
173
175
|
- spec/routing/routes_spec.rb
|
174
176
|
- spec/spec_helper.rb
|
@@ -192,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
194
|
version: '0'
|
193
195
|
requirements: []
|
194
196
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.
|
197
|
+
rubygems_version: 2.4.2
|
196
198
|
signing_key:
|
197
199
|
specification_version: 4
|
198
200
|
summary: An engine that provides common status polling endpoint.
|
@@ -209,6 +211,7 @@ test_files:
|
|
209
211
|
- spec/requests/messsage_addition_spec.rb
|
210
212
|
- spec/requests/no_checks_spec.rb
|
211
213
|
- spec/requests/revision_check_spec.rb
|
214
|
+
- spec/requests/sinatra_spec.rb
|
212
215
|
- spec/requests/time_check_spec.rb
|
213
216
|
- spec/routing/routes_spec.rb
|
214
217
|
- spec/spec_helper.rb
|