rapporteur 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 740374b415d28c691af4809b890ea97cc8123608
4
- data.tar.gz: 4807f028b631e7eeb3140164ac6568a61743f731
3
+ metadata.gz: 633181a4b53c700cdd2d1c2c0f8a9f6a5f08acda
4
+ data.tar.gz: 7b29ca2a1e7c9a57424d246ff8c4aa48732cabce
5
5
  SHA512:
6
- metadata.gz: 427a910ae0ed9b2f33dfbbb2a3440b96b50c5d5ceb8af606a5eaf66d71001de2da7bd669807624bba663c940f1ac9ed0d87da485d4328c080e657895363acc76
7
- data.tar.gz: b92fe37f5c3887638cecd112d537208ed258e8d42d920e721ca5500a48552b2312c718d2d945f7c87acd7866fb471a2036386621ac95d8dd2b8d346d02c5957d
6
+ metadata.gz: 8641338d699725b6612887fa2a3b2cd5b8d3d0b76f66b6e28e0f8960356d3bf674422f1056224fba79d41c877abace918c183e53fe7fc9286350bef659edb659
7
+ data.tar.gz: ddf0fe2836eb103f1a0af23d039df8a0fb66eec99fd6d01d66b5589de23526569db5d8c561bce60f1c636633e726fe3afe2c46d2c147b242a932d64a9ade2023
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --color
2
2
  --format progress
3
+ --warnings
data/.travis.yml CHANGED
@@ -6,6 +6,7 @@ rvm:
6
6
  gemfile:
7
7
  - gemfiles/rails3.2.gemfile
8
8
  - gemfiles/rails4.x.gemfile
9
+ - gemfiles/sinatra1.x.gemfile
9
10
  notifications:
10
11
  email: false
11
12
  campfire:
data/Appraisals CHANGED
@@ -5,3 +5,7 @@ end
5
5
  appraise "rails4.x" do
6
6
  gem "railties", "~> 4.0"
7
7
  end
8
+
9
+ appraise "sinatra1.x" do
10
+ gem "sinatra", "~> 1.4"
11
+ end
data/CHANGELOG.md CHANGED
@@ -1,9 +1,22 @@
1
1
  # Rapporteur changelog
2
2
 
3
+ [![Gem Version](http://img.shields.io/gem/v/rapporteur.svg?style=flat)](http://rubygems.org/gems/rapporteur)
4
+ [![Build Status](http://img.shields.io/travis/codeschool/rapporteur/master.svg?style=flat)](https://travis-ci.org/codeschool/rapporteur)
5
+ [![Code Climate](http://img.shields.io/codeclimate/github/codeschool/rapporteur.svg?style=flat)](https://codeclimate.com/github/codeschool/rapporteur)
6
+ [![Dependency Status](https://gemnasium.com/codeschool/rapporteur.svg)](https://gemnasium.com/codeschool/rapporteur)
7
+ [![Inline docs](http://inch-ci.org/github/codeschool/rapporteur.svg?branch=master)](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.1.0...master
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
- [![Gem Version](http://img.shields.io/gem/v/rapporteur.svg)](http://rubygems.org/gems/rapporteur)
4
- [![Build Status](http://img.shields.io/travis/codeschool/rapporteur/master.svg)](https://travis-ci.org/codeschool/rapporteur)
5
- [![Code Climate](http://img.shields.io/codeclimate/github/codeschool/rapporteur.svg)](https://codeclimate.com/github/codeschool/rapporteur)
3
+ [![Gem Version](http://img.shields.io/gem/v/rapporteur.svg?style=flat)](http://rubygems.org/gems/rapporteur)
4
+ [![Build Status](http://img.shields.io/travis/codeschool/rapporteur/master.svg?style=flat)](https://travis-ci.org/codeschool/rapporteur)
5
+ [![Code Climate](http://img.shields.io/codeclimate/github/codeschool/rapporteur.svg?style=flat)](https://codeclimate.com/github/codeschool/rapporteur)
6
6
  [![Dependency Status](https://gemnasium.com/codeschool/rapporteur.svg)](https://gemnasium.com/codeschool/rapporteur)
7
+ [![Inline docs](http://inch-ci.org/github/codeschool/rapporteur.svg?branch=master)](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 'rapporteur'
115
- require 'my_app/api/endpoint'
116
-
117
- module MyApp
118
- module API
119
- module Endpoints
120
- class Status < Endpoint
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
@@ -1,3 +1,3 @@
1
1
  Rails.application.routes.draw do
2
- get 'status.json', :to => 'statuses#show', :defaults => {:format => 'json'}, :as => :status
2
+ get 'status.:format', :to => 'statuses#show', :defaults => {:format => 'json'}, :constraints => {:format => 'json'}, :as => :status
3
3
  end
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
6
+ gem "sqlite3", :platforms => :ruby
7
+ gem "sinatra", "~> 1.4"
8
+
9
+ gemspec :path => "../"
data/lib/rapporteur.rb CHANGED
@@ -46,6 +46,7 @@ module Rapporteur
46
46
  end
47
47
  @checker
48
48
  end
49
+ @checker = nil
49
50
 
50
51
  # Public: Empties all configured checks from the checker. This may be
51
52
  # useful for testing and for cases where you might've built up some basic
@@ -1,3 +1,3 @@
1
1
  module Rapporteur
2
- VERSION = "3.1.0"
2
+ VERSION = "3.2.0"
3
3
  end
@@ -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
@@ -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.1.0
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: 2014-07-03 00:00:00.000000000 Z
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.3.0
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