sensu-extension 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c11409ffdd49e64a6348dbbc53c764214687397
4
- data.tar.gz: f59c3de82957e6223a1a8ada73a9b885befd2e4e
3
+ metadata.gz: 579d697b9fc9d816257f96de68b5101dcf8ff8fa
4
+ data.tar.gz: d821a0d5aaae04f9f14d51f9f5a41a54f7c0c9c9
5
5
  SHA512:
6
- metadata.gz: e8ab0b42e9cb297e512a8defa33d63d942449cf1c69b521fa8b7b64a465c8a1c9daf2ebd1ba5506c2cbded15cc8f9d6b42388def992883decf7a50cf6fb27fba
7
- data.tar.gz: 82aa66236e4b70e16a706526b57ff6ce82e994e837463effddb744b32c07906c6ea4ee11604abfa7ae81f7290540ba84d115e0c8bc8dd9c2c5235daab578777c
6
+ metadata.gz: d5f4fa0b341627bd9eedc4ad4be04efb0669e9d80d42008e4d04562a6bc40adf17035c13329b5c5fa7f6a50f380b462a03cccc5d533c9f01a39cfb9c42aaa421
7
+ data.tar.gz: 1bf13bee6dd0e15d6d50f83daa9068640887d20325dd47a7ee559c2f7c16c938b95581f6aa3332a22a8837342f84c05374733a9f446f747b38dbfae29df745ed
@@ -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
- # @param options [Hash] to pass to run() if it has an arity of 2.
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
- arguments = [data ? data.dup : data]
103
- if method(:run).arity.abs == 2
104
- arguments << options
105
- end
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-extension"
5
- spec.version = "1.1.1"
5
+ spec.version = "1.1.2"
6
6
  spec.authors = ["Sean Porter"]
7
7
  spec.email = ["portertech@gmail.com"]
8
8
  spec.summary = "The Sensu extension library"
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.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-03 00:00:00.000000000 Z
11
+ date: 2014-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-em