whoops 0.1.5 → 0.1.6
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.
- data/Gemfile +9 -1
- data/README.asciidoc +2 -0
- data/app/mailers/whoops/notification_mailer.rb +10 -0
- data/app/models/whoops/event_group.rb +8 -1
- metadata +10 -24
    
        data/Gemfile
    CHANGED
    
    
    
        data/README.asciidoc
    CHANGED
    
    | @@ -16,6 +16,8 @@ Whoops is a logging system. It consists of a Rails engine (which records logs an | |
| 16 16 |  | 
| 17 17 | 
             
            * http://airbrakeapp.com/pages/home[Airbrake (the app formerly known as Hoptoad)]
         | 
| 18 18 | 
             
            * https://papertrailapp.com/[papertrail]
         | 
| 19 | 
            +
            * http://graylog2.org/[Graylog2]
         | 
| 20 | 
            +
            * https://github.com/jdpace/errbit[errbit]
         | 
| 19 21 |  | 
| 20 22 | 
             
            == License
         | 
| 21 23 |  | 
| @@ -0,0 +1,10 @@ | |
| 1 | 
            +
            class Whoops::NotificationMailer < ActionMailer::Base
         | 
| 2 | 
            +
              def event_notification(event_group, *addresses)
         | 
| 3 | 
            +
                @event_group = event_group
         | 
| 4 | 
            +
                @addresses = addresses
         | 
| 5 | 
            +
                mail(
         | 
| 6 | 
            +
                  :to      => addresses,
         | 
| 7 | 
            +
                  :subject => "Whoops Notification | #{event_group.service}: #{event_group.environment}: #{event_group.message}"
         | 
| 8 | 
            +
                )
         | 
| 9 | 
            +
              end
         | 
| 10 | 
            +
            end
         | 
| @@ -8,11 +8,13 @@ class Whoops::EventGroup | |
| 8 8 | 
             
              end
         | 
| 9 9 | 
             
              field :last_recorded_at, :type => DateTime
         | 
| 10 10 | 
             
              field :notify_on_next_occurrence, :type => Boolean, :default => true
         | 
| 11 | 
            -
             | 
| 11 | 
            +
             | 
| 12 12 | 
             
              has_many :events, :class_name => "Whoops::Event"
         | 
| 13 13 |  | 
| 14 14 | 
             
              validates_presence_of :identifier, :event_type, :service, :message
         | 
| 15 15 |  | 
| 16 | 
            +
              after_validation :send_notifications
         | 
| 17 | 
            +
              
         | 
| 16 18 | 
             
              def self.identifying_fields
         | 
| 17 19 | 
             
                field_names - ["message", "last_recorded_at"]
         | 
| 18 20 | 
             
              end
         | 
| @@ -31,5 +33,10 @@ class Whoops::EventGroup | |
| 31 33 | 
             
                services
         | 
| 32 34 | 
             
              end
         | 
| 33 35 |  | 
| 36 | 
            +
              def send_notifications
         | 
| 37 | 
            +
                matcher = Whoops::NotificationRule::Matcher.new(self)
         | 
| 38 | 
            +
                Whoops::NotificationMailer.event_notification(self, matcher.matches)
         | 
| 39 | 
            +
                self.notify_on_next_occurrence = false
         | 
| 40 | 
            +
              end
         | 
| 34 41 |  | 
| 35 42 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: whoops
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash:  | 
| 4 | 
            +
              hash: 23
         | 
| 5 5 | 
             
              prerelease: false
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 0
         | 
| 8 8 | 
             
              - 1
         | 
| 9 | 
            -
              -  | 
| 10 | 
            -
              version: 0.1. | 
| 9 | 
            +
              - 6
         | 
| 10 | 
            +
              version: 0.1.6
         | 
| 11 11 | 
             
            platform: ruby
         | 
| 12 12 | 
             
            authors: 
         | 
| 13 13 | 
             
            - Daniel Higginbotham
         | 
| @@ -15,7 +15,7 @@ autorequire: | |
| 15 15 | 
             
            bindir: bin
         | 
| 16 16 | 
             
            cert_chain: []
         | 
| 17 17 |  | 
| 18 | 
            -
            date: 2011- | 
| 18 | 
            +
            date: 2011-08-02 00:00:00 -04:00
         | 
| 19 19 | 
             
            default_executable: 
         | 
| 20 20 | 
             
            dependencies: 
         | 
| 21 21 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -179,7 +179,7 @@ dependencies: | |
| 179 179 | 
             
              type: :development
         | 
| 180 180 | 
             
              version_requirements: *id011
         | 
| 181 181 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 182 | 
            -
              name:  | 
| 182 | 
            +
              name: faker
         | 
| 183 183 | 
             
              prerelease: false
         | 
| 184 184 | 
             
              requirement: &id012 !ruby/object:Gem::Requirement 
         | 
| 185 185 | 
             
                none: false
         | 
| @@ -192,24 +192,10 @@ dependencies: | |
| 192 192 | 
             
                    version: "0"
         | 
| 193 193 | 
             
              type: :development
         | 
| 194 194 | 
             
              version_requirements: *id012
         | 
| 195 | 
            -
            - !ruby/object:Gem::Dependency 
         | 
| 196 | 
            -
              name: faker
         | 
| 197 | 
            -
              prerelease: false
         | 
| 198 | 
            -
              requirement: &id013 !ruby/object:Gem::Requirement 
         | 
| 199 | 
            -
                none: false
         | 
| 200 | 
            -
                requirements: 
         | 
| 201 | 
            -
                - - ">="
         | 
| 202 | 
            -
                  - !ruby/object:Gem::Version 
         | 
| 203 | 
            -
                    hash: 3
         | 
| 204 | 
            -
                    segments: 
         | 
| 205 | 
            -
                    - 0
         | 
| 206 | 
            -
                    version: "0"
         | 
| 207 | 
            -
              type: :development
         | 
| 208 | 
            -
              version_requirements: *id013
         | 
| 209 195 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| 210 196 | 
             
              name: capybara
         | 
| 211 197 | 
             
              prerelease: false
         | 
| 212 | 
            -
              requirement: & | 
| 198 | 
            +
              requirement: &id013 !ruby/object:Gem::Requirement 
         | 
| 213 199 | 
             
                none: false
         | 
| 214 200 | 
             
                requirements: 
         | 
| 215 201 | 
             
                - - ">="
         | 
| @@ -221,8 +207,8 @@ dependencies: | |
| 221 207 | 
             
                    - 0
         | 
| 222 208 | 
             
                    version: 0.4.0
         | 
| 223 209 | 
             
              type: :development
         | 
| 224 | 
            -
              version_requirements: * | 
| 225 | 
            -
            description: A  | 
| 210 | 
            +
              version_requirements: *id013
         | 
| 211 | 
            +
            description: A Rails engine which receives logs and provides an interface for them
         | 
| 226 212 | 
             
            email: 
         | 
| 227 213 | 
             
            executables: []
         | 
| 228 214 |  | 
| @@ -309,7 +295,7 @@ files: | |
| 309 295 | 
             
            - Gemfile
         | 
| 310 296 | 
             
            - README.asciidoc
         | 
| 311 297 | 
             
            has_rdoc: true
         | 
| 312 | 
            -
            homepage: 
         | 
| 298 | 
            +
            homepage: http://www.whoopsapp.com
         | 
| 313 299 | 
             
            licenses: []
         | 
| 314 300 |  | 
| 315 301 | 
             
            post_install_message: 
         | 
| @@ -341,6 +327,6 @@ rubyforge_project: | |
| 341 327 | 
             
            rubygems_version: 1.3.7
         | 
| 342 328 | 
             
            signing_key: 
         | 
| 343 329 | 
             
            specification_version: 3
         | 
| 344 | 
            -
            summary: A  | 
| 330 | 
            +
            summary: A Rails engine which receives logs and provides an interface for them
         | 
| 345 331 | 
             
            test_files: []
         | 
| 346 332 |  |