sensu-extension 1.1.1 → 1.1.2
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 +4 -4
- data/lib/sensu/extension.rb +8 -6
- data/sensu-extension.gemspec +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 579d697b9fc9d816257f96de68b5101dcf8ff8fa
         | 
| 4 | 
            +
              data.tar.gz: d821a0d5aaae04f9f14d51f9f5a41a54f7c0c9c9
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d5f4fa0b341627bd9eedc4ad4be04efb0669e9d80d42008e4d04562a6bc40adf17035c13329b5c5fa7f6a50f380b462a03cccc5d533c9f01a39cfb9c42aaa421
         | 
| 7 | 
            +
              data.tar.gz: 1bf13bee6dd0e15d6d50f83daa9068640887d20325dd47a7ee559c2f7c16c938b95581f6aa3332a22a8837342f84c05374733a9f446f747b38dbfae29df745ed
         | 
    
        data/lib/sensu/extension.rb
    CHANGED
    
    | @@ -94,15 +94,17 @@ module Sensu | |
| 94 94 | 
             
                  # it to ensure the extension doesn't mutate the original. Do
         | 
| 95 95 | 
             
                  # not override this method!
         | 
| 96 96 | 
             
                  #
         | 
| 97 | 
            -
                  # @param data [Object, nil) to dup() and pass to run() | 
| 98 | 
            -
                  # | 
| 97 | 
            +
                  # @param data [Object, nil) to dup() and pass to run(), if run()
         | 
| 98 | 
            +
                  #   has an absolue arity of 1 or more.
         | 
| 99 | 
            +
                  # @param options [Hash] to pass to run(), if run() has an
         | 
| 100 | 
            +
                  #   absolute arity of 2.
         | 
| 99 101 | 
             
                  # @param callback [Proc] to pass to run().
         | 
| 100 102 | 
             
                  def safe_run(data=nil, options={}, &callback)
         | 
| 101 103 | 
             
                    begin
         | 
| 102 | 
            -
                       | 
| 103 | 
            -
                       | 
| 104 | 
            -
             | 
| 105 | 
            -
                       | 
| 104 | 
            +
                      @run_arity ||= method(:run).arity.abs
         | 
| 105 | 
            +
                      arguments = []
         | 
| 106 | 
            +
                      arguments << (data ? data.dup : data) if @run_arity >= 1
         | 
| 107 | 
            +
                      arguments << options if @run_arity == 2
         | 
| 106 108 | 
             
                      run(*arguments, &callback)
         | 
| 107 109 | 
             
                    rescue => error
         | 
| 108 110 | 
             
                      klass = error.class.name
         | 
    
        data/sensu-extension.gemspec
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: sensu-extension
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.1. | 
| 4 | 
            +
              version: 1.1.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Sean Porter
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014-12- | 
| 11 | 
            +
            date: 2014-12-04 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: sensu-em
         |