rapporteur 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjUxY2VjMWI5YWZjZWQ0OTY1NzAzOTlhYmVhZDIwMjczNGFkOTZkMw==
4
+ Y2MzZjBlZWExMWYyZGZhNDU1YTI2MTc2NzUxYjQ2YTg2N2IzMWQwMA==
5
5
  data.tar.gz: !binary |-
6
- M2NhMjU1NWY4NTc4N2E3NjQ3YjA5YmQ2NGNlYjk2YTY0NGU5YjQ2YQ==
6
+ Mjk0ODE3NWFmMWE0Yzg5M2NiNTM5YWE1MDRjYTlmYTliOTk5NDFhZg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MmFlY2NmMjdkZWZiNjhkNGM0OTFmMDg4OTM1OTkzMDU0Mjg5ODU4YzcwYWVk
10
- MzUxYzBlMTFiZjUyNTM4Mjk3YzgwNmE4N2E2MGFjNzcyYzk3NjNmMDg1MzJl
11
- NDIyMjg3ZDA2Mzg1ZmE1NjE0NjA2MDdhZTEwZWY4ZjM4OTMzZmE=
9
+ MTc2M2M2ZDIxMzMzNjRlNGEyMmE4YjllZTZlZDkzMGQ0YTUyODNmNGMyMmIz
10
+ OTNiNzVjYjMzMTY1YWZlODg3YTcyMjY4NDFhNzI2MmE5YTVkY2VlOGVkMjI4
11
+ NmQzMWJmYTVmZjczNDY1YjEyYjcxOThkYjJhNzQyMGNkNmEwMTA=
12
12
  data.tar.gz: !binary |-
13
- YjljMTM4YzhhNWY1MGQwMjg1Mzk5ZTI0OWJkOWY5NjE1OTZkNjM1OTNlOWM5
14
- ODUzNjlhZDM4M2QxNTdhZGNmOGVlOTg2MjIxZDc3OTFiOTJkNGY3NzVhZDcx
15
- M2ZjNTQ3OGIyMDE0YmU1NjRmMDExMDA1Zjg1NWYzYTExNmZiZGI=
13
+ MzEwMTc4Y2NjODViMGQ0ZmQ4ZjA0YjFlMTc0ZGFiMzY2Njg5MDM0NDY2ZTAz
14
+ M2I1MDdkOTlhYmZiMGZiYTNkNTBiZTA0NGJhMjZiMDAwYWQyZjRkOTBlZjA5
15
+ NTdjMTk4YzQ2YjFiNDhlN2RmZTc1ZDg1NjY3MTc2YTM4YTEzMTg=
data/.travis.yml CHANGED
@@ -1,11 +1,12 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.2
4
3
  - 1.9.3
5
- - jruby
4
+ - 2.0.0
5
+ - jruby-19mode
6
6
  gemfile:
7
7
  - gemfiles/rails3.1.gemfile
8
8
  - gemfiles/rails3.2.gemfile
9
+ - gemfiles/rails4.0.gemfile
9
10
  notifications:
10
11
  email: false
11
12
  campfire:
data/Appraisals CHANGED
@@ -5,3 +5,7 @@ end
5
5
  appraise "rails3.2" do
6
6
  gem "railties", "~> 3.2.0"
7
7
  end
8
+
9
+ appraise "rails4.0" do
10
+ gem "railties", "~> 4.0.0"
11
+ end
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  * No significant changes.
6
6
 
7
+ ## [2.1.0][v2.1.0] / 2013-06-28
8
+
9
+ * Update the gemspec to allow for Rails 4.0 environments.
10
+ * Update the packaged Responder to properly handle Rails 4.0.
11
+ * Fix deprecation notice for Checker.clear.
12
+
7
13
  ## [2.0.1][v2.0.1] / 2013-05-31
8
14
 
9
15
  * Fix NoMethodError in CheckerDeprecations#clear.
@@ -47,7 +53,8 @@
47
53
  * Initial public release.
48
54
 
49
55
 
50
- [unreleased]: https://github.com/codeschool/rapporteur/compare/v2.0.1...master
56
+ [unreleased]: https://github.com/codeschool/rapporteur/compare/v2.1.0...master
57
+ [v2.1.0]: https://github.com/codeschool/rapporteur/compare/v2.0.1...v2.1.0
51
58
  [v2.0.1]: https://github.com/codeschool/rapporteur/compare/v2.0.0...v2.0.1
52
59
  [v2.0.0]: https://github.com/codeschool/rapporteur/compare/v1.1.0...v2.0.0
53
60
  [v1.1.0]: https://github.com/codeschool/rapporteur/compare/v1.0.1...v1.1.0
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rapporteur
1
+ # Rapporteur (rap-or-TUHR)
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/rapporteur.png)](http://badge.fury.io/rb/rapporteur)
4
4
  [![Build Status](https://travis-ci.org/codeschool/rapporteur.png?branch=master)](https://travis-ci.org/codeschool/rapporteur)
@@ -25,7 +25,7 @@ validations:
25
25
  ```json
26
26
  {
27
27
  "errors": {
28
- "base": ["The application database is inaccessible or unavailable"]
28
+ "database": ["The application database is inaccessible or unavailable"]
29
29
  }
30
30
  }
31
31
  ```
@@ -34,22 +34,28 @@ validations:
34
34
 
35
35
  Supported Ruby versions:
36
36
 
37
- * MRI 1.9.2
37
+ * MRI 2.0.0
38
38
  * MRI 1.9.3
39
+ * MRI 1.9.2
39
40
  * JRuby 1.7.4
40
41
 
41
42
  Supported Rails versions:
42
43
 
43
- * Rails 3.1.x.
44
+ * Rails 4.0.x.
44
45
  * Rails 3.2.x.
46
+ * Rails 3.1.x.
45
47
 
46
48
  To install, add this line to your application's Gemfile:
47
49
 
48
- gem 'rapporteur'
50
+ ```ruby
51
+ gem 'rapporteur'
52
+ ```
49
53
 
50
54
  And then execute:
51
55
 
52
- $ bundle
56
+ ```bash
57
+ $ bundle
58
+ ```
53
59
 
54
60
  ## Usage
55
61
 
@@ -136,8 +142,8 @@ Rapporteur.add_check do |checker|
136
142
  end
137
143
 
138
144
  my_proc_check = lambda { |checker|
139
- checker.add_error("You have bad luck!") if rand(10) > 5
140
- checker.add_message(:luck, "good")
145
+ checker.add_error(:luck, :bad) if rand(2) > 0
146
+ checker.add_message(:luck, :good)
141
147
  }
142
148
 
143
149
  Rapporteur.add_check(my_proc_check)
@@ -145,7 +151,7 @@ Rapporteur.add_check(my_proc_check)
145
151
  class MyClassCheck
146
152
  def self.call(checker)
147
153
  @@counter ||= 0
148
- checker.add_error("Stop calling me!!") if @@counter > 50
154
+ checker.add_error(:count, :exceeded) if @@counter > 50
149
155
  end
150
156
  end
151
157
 
@@ -211,13 +217,10 @@ For example, to override the database check failure message:
211
217
 
212
218
  ```yaml
213
219
  en:
214
- activemodel:
220
+ rapporteur:
215
221
  errors:
216
- models:
217
- rapporteur/checker:
218
- attributes:
219
- base:
220
- database_unavailable: "Something went wrong"
222
+ database:
223
+ unavailable: "Something went wrong"
221
224
  ```
222
225
 
223
226
  ## Contributing
@@ -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 "railties", "~> 4.0.0"
8
+
9
+ gemspec :path=>"../"
@@ -28,7 +28,7 @@ module Rapporteur
28
28
  # Examples
29
29
  #
30
30
  # Rapporteur.add_check { |checker|
31
- # checker.add_error("Bad luck.") if rand(2) == 1
31
+ # checker.add_error(:luck, :bad) if rand(2) == 1
32
32
  # }
33
33
  #
34
34
  # Returns self.
@@ -89,13 +89,19 @@ module Rapporteur
89
89
  # in the status request.
90
90
  #
91
91
  # It is suggested that you use I18n and locale files for these messages, as
92
- # is done with the pre-built checks. If you're using I19n, you'll need to
93
- # define `activemodel.errors.models.rapporteur/checker.attributes.base.<your key>`.
92
+ # is done with the pre-built checks. If you're using I18n, you'll need to
93
+ # define `rapporteur.errors.<your key>.<your message>`.
94
94
  #
95
95
  # Examples
96
96
  #
97
- # checker.add_error("You failed.")
98
- # checker.add_error(:i18n_key_is_better)
97
+ # checker.add_error(:you, "failed.")
98
+ # checker.add_error(:using, :i18n_key_is_better)
99
+ #
100
+ # en:
101
+ # rapporteur:
102
+ # errors:
103
+ # using:
104
+ # i18n_key_is_better: 'Look, localization!'
99
105
  #
100
106
  # Returns self.
101
107
  #
@@ -8,7 +8,7 @@ module Rapporteur
8
8
  end
9
9
 
10
10
  def clear
11
- ActiveSupport::Deprecation.warn("use Rapporteur.clear", caller)
11
+ ActiveSupport::Deprecation.warn("use Rapporteur.clear_checks", caller)
12
12
  Rapporteur.clear_checks
13
13
  end
14
14
 
@@ -2,7 +2,30 @@ module Rapporteur
2
2
  module Checks
3
3
  autoload :ActiveRecordCheck, 'rapporteur/checks/active_record_check'
4
4
 
5
+ # A check which simply reports the current clock time in UTC. This check is
6
+ # useful because it shows that the status end point is not being cached and
7
+ # allows you to determine if your server clocks are abnormally skewed.
8
+ #
9
+ # This check has no failure cases.
10
+ #
11
+ # Examples
12
+ #
13
+ # {
14
+ # time: "2013-06-21T05:18:59Z"
15
+ # }
16
+ #
5
17
  TimeCheck = lambda { |checker| checker.add_message(:time, Time.now.utc) }
18
+
19
+ # A check which reports the current revision of the running application.
20
+ #
21
+ # This check has no failure cases.
22
+ #
23
+ # Examples
24
+ #
25
+ # {
26
+ # revision: "c74edd04f64b25ff6691308bcfdefcee149aa4b5"
27
+ # }
28
+ #
6
29
  RevisionCheck = lambda { |checker| checker.add_message(:revision, Revision.current) }
7
30
  end
8
31
  end
@@ -23,7 +23,7 @@ module Rapporteur
23
23
  def display_errors
24
24
  controller.render format => {errors: resource.errors}, status: :internal_server_error
25
25
  end
26
- elsif Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 2
26
+ else
27
27
  def display_errors
28
28
  controller.render format => resource_errors, status: :internal_server_error
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module Rapporteur
2
- VERSION = "2.0.1"
2
+ VERSION = "2.1.0"
3
3
  end
data/rapporteur.gemspec CHANGED
@@ -18,12 +18,12 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'railties', '~> 3.1'
21
+ spec.add_dependency 'railties', '>= 3.1', '< 4.1'
22
22
  spec.add_dependency 'activesupport'
23
23
 
24
24
  spec.add_development_dependency "appraisal", "~> 0.5"
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
26
26
  spec.add_development_dependency "combustion", "~> 0.5"
27
- spec.add_development_dependency "rails", "~> 3.1"
27
+ spec.add_development_dependency "rails", ">= 3.1", "< 4.1"
28
28
  spec.add_development_dependency "rspec-rails", "~> 2.11"
29
29
  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: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Envy Labs
@@ -9,22 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-31 00:00:00.000000000 Z
12
+ date: 2013-06-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - ! '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: '3.1'
21
+ - - <
22
+ - !ruby/object:Gem::Version
23
+ version: '4.1'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - ~>
28
+ - - ! '>='
26
29
  - !ruby/object:Gem::Version
27
30
  version: '3.1'
31
+ - - <
32
+ - !ruby/object:Gem::Version
33
+ version: '4.1'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: activesupport
30
36
  requirement: !ruby/object:Gem::Requirement
@@ -85,16 +91,22 @@ dependencies:
85
91
  name: rails
86
92
  requirement: !ruby/object:Gem::Requirement
87
93
  requirements:
88
- - - ~>
94
+ - - ! '>='
89
95
  - !ruby/object:Gem::Version
90
96
  version: '3.1'
97
+ - - <
98
+ - !ruby/object:Gem::Version
99
+ version: '4.1'
91
100
  type: :development
92
101
  prerelease: false
93
102
  version_requirements: !ruby/object:Gem::Requirement
94
103
  requirements:
95
- - - ~>
104
+ - - ! '>='
96
105
  - !ruby/object:Gem::Version
97
106
  version: '3.1'
107
+ - - <
108
+ - !ruby/object:Gem::Version
109
+ version: '4.1'
98
110
  - !ruby/object:Gem::Dependency
99
111
  name: rspec-rails
100
112
  requirement: !ruby/object:Gem::Requirement
@@ -131,6 +143,7 @@ files:
131
143
  - config/routes.rb
132
144
  - gemfiles/rails3.1.gemfile
133
145
  - gemfiles/rails3.2.gemfile
146
+ - gemfiles/rails4.0.gemfile
134
147
  - lib/rapporteur.rb
135
148
  - lib/rapporteur/checker.rb
136
149
  - lib/rapporteur/checker_deprecations.rb