rapporteur 2.0.1 → 2.1.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 +8 -8
- data/.travis.yml +3 -2
- data/Appraisals +4 -0
- data/CHANGELOG.md +8 -1
- data/README.md +18 -15
- data/gemfiles/rails4.0.gemfile +9 -0
- data/lib/rapporteur/checker.rb +11 -5
- data/lib/rapporteur/checker_deprecations.rb +1 -1
- data/lib/rapporteur/checks.rb +23 -0
- data/lib/rapporteur/responder.rb +1 -1
- data/lib/rapporteur/version.rb +1 -1
- data/rapporteur.gemspec +2 -2
- metadata +19 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                Y2MzZjBlZWExMWYyZGZhNDU1YTI2MTc2NzUxYjQ2YTg2N2IzMWQwMA==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                Mjk0ODE3NWFmMWE0Yzg5M2NiNTM5YWE1MDRjYTlmYTliOTk5NDFhZg==
         | 
| 7 7 | 
             
            !binary "U0hBNTEy":
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                MTc2M2M2ZDIxMzMzNjRlNGEyMmE4YjllZTZlZDkzMGQ0YTUyODNmNGMyMmIz
         | 
| 10 | 
            +
                OTNiNzVjYjMzMTY1YWZlODg3YTcyMjY4NDFhNzI2MmE5YTVkY2VlOGVkMjI4
         | 
| 11 | 
            +
                NmQzMWJmYTVmZjczNDY1YjEyYjcxOThkYjJhNzQyMGNkNmEwMTA=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 13 | 
            +
                MzEwMTc4Y2NjODViMGQ0ZmQ4ZjA0YjFlMTc0ZGFiMzY2Njg5MDM0NDY2ZTAz
         | 
| 14 | 
            +
                M2I1MDdkOTlhYmZiMGZiYTNkNTBiZTA0NGJhMjZiMDAwYWQyZjRkOTBlZjA5
         | 
| 15 | 
            +
                NTdjMTk4YzQ2YjFiNDhlN2RmZTc1ZDg1NjY3MTc2YTM4YTEzMTg=
         | 
    
        data/.travis.yml
    CHANGED
    
    
    
        data/Appraisals
    CHANGED
    
    
    
        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 | 
| 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 | 
             
            [](http://badge.fury.io/rb/rapporteur)
         | 
| 4 4 | 
             
            [](https://travis-ci.org/codeschool/rapporteur)
         | 
| @@ -25,7 +25,7 @@ validations: | |
| 25 25 | 
             
            ```json
         | 
| 26 26 | 
             
            {
         | 
| 27 27 | 
             
              "errors": {
         | 
| 28 | 
            -
                " | 
| 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  | 
| 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  | 
| 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 | 
            -
             | 
| 50 | 
            +
            ```ruby
         | 
| 51 | 
            +
            gem 'rapporteur'
         | 
| 52 | 
            +
            ```
         | 
| 49 53 |  | 
| 50 54 | 
             
            And then execute:
         | 
| 51 55 |  | 
| 52 | 
            -
             | 
| 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( | 
| 140 | 
            -
              checker.add_message(:luck,  | 
| 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( | 
| 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 | 
            -
               | 
| 220 | 
            +
              rapporteur:
         | 
| 215 221 | 
             
                errors:
         | 
| 216 | 
            -
                   | 
| 217 | 
            -
                     | 
| 218 | 
            -
                      attributes:
         | 
| 219 | 
            -
                        base:
         | 
| 220 | 
            -
                          database_unavailable: "Something went wrong"
         | 
| 222 | 
            +
                  database:
         | 
| 223 | 
            +
                    unavailable: "Something went wrong"
         | 
| 221 224 | 
             
            ```
         | 
| 222 225 |  | 
| 223 226 | 
             
            ## Contributing
         | 
    
        data/lib/rapporteur/checker.rb
    CHANGED
    
    | @@ -28,7 +28,7 @@ module Rapporteur | |
| 28 28 | 
             
                # Examples
         | 
| 29 29 | 
             
                #
         | 
| 30 30 | 
             
                #   Rapporteur.add_check { |checker|
         | 
| 31 | 
            -
                #     checker.add_error( | 
| 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  | 
| 93 | 
            -
                # define ` | 
| 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(" | 
| 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 | 
             
                #
         | 
    
        data/lib/rapporteur/checks.rb
    CHANGED
    
    | @@ -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
         | 
    
        data/lib/rapporteur/responder.rb
    CHANGED
    
    | @@ -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 | 
            -
                 | 
| 26 | 
            +
                else
         | 
| 27 27 | 
             
                  def display_errors
         | 
| 28 28 | 
             
                    controller.render format => resource_errors, status: :internal_server_error
         | 
| 29 29 | 
             
                  end
         | 
    
        data/lib/rapporteur/version.rb
    CHANGED
    
    
    
        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', ' | 
| 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", " | 
| 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 | 
| 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- | 
| 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
         |