rapporteur 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -6
- data/CHANGELOG.md +13 -1
- data/README.md +1 -1
- data/app/controllers/statuses_controller.rb +19 -4
- data/config/routes.rb +18 -1
- data/lib/rapporteur/checker.rb +1 -2
- data/lib/rapporteur/version.rb +1 -1
- data/lib/rapporteur.rb +0 -1
- data/rapporteur.gemspec +1 -1
- data/spec/routing/routes_spec.rb +1 -1
- metadata +5 -6
- data/lib/rapporteur/responder.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c09441f5790264d6bac686e7995dfd8de5e5eec
|
4
|
+
data.tar.gz: 0271da9fe733c0114ef50aecedfce99b72c7ed94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1428b9ee37335136b8751cf828c8de25837b4a903fe875c5b33d1540125b8f42b754d9716391d74218a780d7b6cd99550756747c24ff90fe65d40f240f6d3887
|
7
|
+
data.tar.gz: 8900d3c79a3787acdbaeb997af7f05cfcd3e516c5967d1bae3f90aa0bdf287137bd31bb8e02aa1df0e9fc0b286ba4dc0fe82fedd71b5b5f48ff12c38a7a3e7fb
|
data/.travis.yml
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache:
|
3
|
+
directories:
|
4
|
+
- vendor/bundle
|
2
5
|
rvm:
|
3
6
|
- 1.9.3
|
4
|
-
- 2.1.
|
7
|
+
- 2.1.5
|
5
8
|
- jruby-19mode
|
6
9
|
gemfile:
|
7
10
|
- gemfiles/rails3.2.gemfile
|
@@ -9,8 +12,3 @@ gemfile:
|
|
9
12
|
- gemfiles/sinatra1.x.gemfile
|
10
13
|
notifications:
|
11
14
|
email: false
|
12
|
-
campfire:
|
13
|
-
on_success: change
|
14
|
-
on_failure: always
|
15
|
-
rooms:
|
16
|
-
- secure: "gxEt3SeVn1kup6PfB6hiQu6eWsefmMEdd8U1qPSS6vlRjsM7Xy2IrXdz9gdl\n0nrrRgESvOxT3sqMh4/opH6M1kbtCyl3M0yvjF2QUtjWQ+4BStJGhNyXlDTp\nNAas19fuEUPBNxNqoy7aTVBiFpQRs0NisEZTS3+N3eA2tz757Qk="
|
data/CHANGELOG.md
CHANGED
@@ -10,6 +10,17 @@
|
|
10
10
|
|
11
11
|
* No significant changes.
|
12
12
|
|
13
|
+
## [3.3.0][v3.3.0] / 2015-02-03
|
14
|
+
|
15
|
+
* Remove the customized Rapporteur::Responder (an ActionController::Responder)
|
16
|
+
since responders were removed from Rails core in version 4.2 and inline the
|
17
|
+
logic into the StatusesController.
|
18
|
+
* Register Rapporteur::Engine routes for Rails 4.2 support.
|
19
|
+
* Auto-mount the engine routes and force definition of an application `status`
|
20
|
+
route for backward compatibility. Otherwise, developers would seemingly need
|
21
|
+
to either manually mount the engine or define an application-level named
|
22
|
+
route for the status endpoint.
|
23
|
+
|
13
24
|
## [3.2.0][v3.2.0] / 2015-02-02
|
14
25
|
|
15
26
|
* Update the Rails route definition to force (and default) a JSON format. The
|
@@ -105,7 +116,8 @@
|
|
105
116
|
* Initial public release.
|
106
117
|
|
107
118
|
|
108
|
-
[unreleased]: https://github.com/codeschool/rapporteur/compare/v3.
|
119
|
+
[unreleased]: https://github.com/codeschool/rapporteur/compare/v3.3.0...master
|
120
|
+
[v3.3.0]: https://github.com/codeschool/rapporteur/compare/v3.2.0...v3.3.0
|
109
121
|
[v3.2.0]: https://github.com/codeschool/rapporteur/compare/v3.1.0...v3.2.0
|
110
122
|
[v3.1.0]: https://github.com/codeschool/rapporteur/compare/v3.0.2...v3.1.0
|
111
123
|
[v3.0.2]: https://github.com/codeschool/rapporteur/compare/v3.0.1...v3.0.2
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ the current application Git revision and server time:
|
|
22
22
|
```
|
23
23
|
|
24
24
|
When an application validation fails, an HTTP 500 response is returned with a
|
25
|
-
collection of error messages, similar to the
|
25
|
+
collection of error messages, similar to the Rails < 4.2 responders for model
|
26
26
|
validations:
|
27
27
|
|
28
28
|
```json
|
@@ -1,8 +1,23 @@
|
|
1
1
|
class StatusesController < ActionController::Base
|
2
|
-
self.responder = Rapporteur::Responder
|
3
|
-
respond_to :json
|
4
|
-
|
5
2
|
def show
|
6
|
-
|
3
|
+
respond_to do |format|
|
4
|
+
format.json do
|
5
|
+
resource = Rapporteur.run
|
6
|
+
|
7
|
+
if resource.errors.empty?
|
8
|
+
render({:json => resource})
|
9
|
+
else
|
10
|
+
display_errors(resource, :json)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
|
20
|
+
def display_errors(resource, format)
|
21
|
+
render({format => {:errors => resource.errors}, :status => :internal_server_error})
|
7
22
|
end
|
8
23
|
end
|
data/config/routes.rb
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
Rapporteur::Engine.routes.draw do
|
2
|
+
get("status.:format", {
|
3
|
+
:as => :status,
|
4
|
+
:constraints => {:format => "json"},
|
5
|
+
:defaults => {:format => "json"},
|
6
|
+
:to => "statuses#show"
|
7
|
+
})
|
8
|
+
end
|
9
|
+
|
1
10
|
Rails.application.routes.draw do
|
2
|
-
|
11
|
+
unless Rails.application.routes.named_routes.routes[:status]
|
12
|
+
mount Rapporteur::Engine => "/"
|
13
|
+
get("/status.:format", {
|
14
|
+
:as => :status,
|
15
|
+
:constraints => {:format => "json"},
|
16
|
+
:defaults => {:format => "json"},
|
17
|
+
:to => "statuses#show"
|
18
|
+
})
|
19
|
+
end
|
3
20
|
end
|
data/lib/rapporteur/checker.rb
CHANGED
@@ -163,8 +163,7 @@ module Rapporteur
|
|
163
163
|
end
|
164
164
|
|
165
165
|
##
|
166
|
-
# Internal: Used by Rails' JSON serialization
|
167
|
-
# ActionController::Responder.
|
166
|
+
# Internal: Used by Rails' JSON serialization.
|
168
167
|
#
|
169
168
|
def read_attribute_for_serialization(key)
|
170
169
|
@messages[key]
|
data/lib/rapporteur/version.rb
CHANGED
data/lib/rapporteur.rb
CHANGED
@@ -10,7 +10,6 @@ module Rapporteur
|
|
10
10
|
autoload :CheckerDeprecations, 'rapporteur/checker_deprecations'
|
11
11
|
autoload :Checks, 'rapporteur/checks'
|
12
12
|
autoload :MessageList, 'rapporteur/message_list'
|
13
|
-
autoload :Responder, 'rapporteur/responder'
|
14
13
|
autoload :Revision, 'rapporteur/revision'
|
15
14
|
|
16
15
|
|
data/rapporteur.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "appraisal", "~> 1.0"
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
25
25
|
spec.add_development_dependency "combustion", "~> 0.5", ">= 0.5.1"
|
26
|
-
spec.add_development_dependency "rails", ">= 3.1", "< 4.
|
26
|
+
spec.add_development_dependency "rails", ">= 3.1", "< 4.3"
|
27
27
|
spec.add_development_dependency "rspec-rails", "~> 3.0"
|
28
28
|
spec.add_development_dependency "rspec-collection_matchers", "~> 1.0"
|
29
29
|
end
|
data/spec/routing/routes_spec.rb
CHANGED
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.3.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: 2015-02-
|
12
|
+
date: 2015-02-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: i18n
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
version: '3.1'
|
83
83
|
- - "<"
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: '4.
|
85
|
+
version: '4.3'
|
86
86
|
type: :development
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -92,7 +92,7 @@ dependencies:
|
|
92
92
|
version: '3.1'
|
93
93
|
- - "<"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '4.
|
95
|
+
version: '4.3'
|
96
96
|
- !ruby/object:Gem::Dependency
|
97
97
|
name: rspec-rails
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,7 +152,6 @@ files:
|
|
152
152
|
- lib/rapporteur/checks/active_record_check.rb
|
153
153
|
- lib/rapporteur/engine.rb
|
154
154
|
- lib/rapporteur/message_list.rb
|
155
|
-
- lib/rapporteur/responder.rb
|
156
155
|
- lib/rapporteur/revision.rb
|
157
156
|
- lib/rapporteur/rspec.rb
|
158
157
|
- lib/rapporteur/rspec3.rb
|
@@ -194,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
193
|
version: '0'
|
195
194
|
requirements: []
|
196
195
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.4.
|
196
|
+
rubygems_version: 2.4.5
|
198
197
|
signing_key:
|
199
198
|
specification_version: 4
|
200
199
|
summary: An engine that provides common status polling endpoint.
|
data/lib/rapporteur/responder.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
module Rapporteur
|
2
|
-
# A customization of the default Rails ActionController::Responder.
|
3
|
-
# Primarily, this is used to smooth out the differences between Rails
|
4
|
-
# responder versions and allow for error messages in GET requests.
|
5
|
-
#
|
6
|
-
class Responder < ActionController::Responder
|
7
|
-
# Internal: Overrides the default behavior by ignoring the HTTP verb and
|
8
|
-
# always responding with errors if the rendering resource contains errors.
|
9
|
-
#
|
10
|
-
def to_format
|
11
|
-
if has_errors?
|
12
|
-
display_errors
|
13
|
-
else
|
14
|
-
super
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
|
19
|
-
protected
|
20
|
-
|
21
|
-
|
22
|
-
if Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 1
|
23
|
-
def display_errors
|
24
|
-
controller.render format => {:errors => resource.errors}, :status => :internal_server_error
|
25
|
-
end
|
26
|
-
else
|
27
|
-
def display_errors
|
28
|
-
controller.render format => resource_errors, :status => :internal_server_error
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|