sensu-extension 1.1.0 → 1.1.1

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: 89f56995875626d482529538e59ff354aa515c59
4
- data.tar.gz: d3fa3efd43cc6ba69badddb4fd062736ee414c7d
3
+ metadata.gz: 4c11409ffdd49e64a6348dbbc53c764214687397
4
+ data.tar.gz: f59c3de82957e6223a1a8ada73a9b885befd2e4e
5
5
  SHA512:
6
- metadata.gz: 568e9391e63a6661442ef7fccbbe585c14c726db4ccb005f60fa71362f1eb90bc5591b10b8c895011624888350612aeed8f50e528f8058835525bafd5983c604
7
- data.tar.gz: 566da231ab3061573cb7765f9b3a12406ac4c36b59ca146d6e36d73972a1fd00072a19b61398d65c0ab10747de31caa1b7c579d180d29ef69e01fa8ae29daec0
6
+ metadata.gz: e8ab0b42e9cb297e512a8defa33d63d942449cf1c69b521fa8b7b64a465c8a1c9daf2ebd1ba5506c2cbded15cc8f9d6b42388def992883decf7a50cf6fb27fba
7
+ data.tar.gz: 82aa66236e4b70e16a706526b57ff6ce82e994e837463effddb744b32c07906c6ea4ee11604abfa7ae81f7290540ba84d115e0c8bc8dd9c2c5235daab578777c
@@ -95,12 +95,15 @@ module Sensu
95
95
  # not override this method!
96
96
  #
97
97
  # @param data [Object, nil) to dup() and pass to run().
98
- # @param options [Hash] to pass to run().
98
+ # @param options [Hash] to pass to run() if it has an arity of 2.
99
99
  # @param callback [Proc] to pass to run().
100
100
  def safe_run(data=nil, options={}, &callback)
101
101
  begin
102
- data_copy = data ? data.dup : data
103
- run(data_copy, options, &callback)
102
+ arguments = [data ? data.dup : data]
103
+ if method(:run).arity.abs == 2
104
+ arguments << options
105
+ end
106
+ run(*arguments, &callback)
104
107
  rescue => error
105
108
  klass = error.class.name
106
109
  backtrace = error.backtrace.map { |line| "\s\s#{line}" }.join("\n")
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "sensu-extension"
5
- spec.version = "1.1.0"
5
+ spec.version = "1.1.1"
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.0
4
+ version: 1.1.1
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-02 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-em