From abfac72eb83fef559ba6d5b9a46ec63cd7eb4e39 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Thu, 17 Sep 2015 13:41:33 +0300 Subject: restore ruby 1.9.3 compatibility fix some whitespaces bump up gemspec version --- CHANGELOG.md | 3 +++ lib/oxidized/hook.rb | 4 ++-- lib/oxidized/hook/exec.rb | 6 +++--- oxidized.gemspec | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1066372..bf3d8d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.8.1 +- BUGFIX: restore ruby 1.9.3 compatibility + # 0.8.0 - FEATURE: hooks (by @aakso) - FEATURE: MRV MasterOS support (by @kwibbly) diff --git a/lib/oxidized/hook.rb b/lib/oxidized/hook.rb index 2763c4f..7f1942b 100644 --- a/lib/oxidized/hook.rb +++ b/lib/oxidized/hook.rb @@ -19,7 +19,7 @@ class HookManager # RegisteredHook is a container for a Hook instance class RegisteredHook < Struct.new(:name, :hook); end - Events = [ + Events = [ :node_success, :node_fail, :post_store, @@ -49,7 +49,7 @@ class HookManager Log.debug "Hook #{name.inspect} registered #{hook.class} for event #{event.inspect}" end - def handle event, **ctx_params + def handle event, ctx_params={} ctx = HookContext.new ctx_params ctx.event = event diff --git a/lib/oxidized/hook/exec.rb b/lib/oxidized/hook/exec.rb index eb71466..af2aeb1 100644 --- a/lib/oxidized/hook/exec.rb +++ b/lib/oxidized/hook/exec.rb @@ -9,9 +9,9 @@ class Exec < Oxidized::Hook def validate_cfg! # Syntax check - if cfg.has_key? "timeout" + if cfg.has_key? "timeout" @timeout = cfg.timeout - raise "invalid timeout value" unless @timeout.is_a?(Integer) && + raise "invalid timeout value" unless @timeout.is_a?(Integer) && @timeout > 0 end @@ -25,7 +25,7 @@ class Exec < Oxidized::Hook end rescue RuntimeError => e - raise ArgumentError, + raise ArgumentError, "#{self.class.name}: configuration invalid: #{e.message}" end diff --git a/oxidized.gemspec b/oxidized.gemspec index 15e4e41..d2956b1 100644 --- a/oxidized.gemspec +++ b/oxidized.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'oxidized' - s.version = '0.8.0' + s.version = '0.8.1' s.licenses = %w( Apache-2.0 ) s.platform = Gem::Platform::RUBY s.authors = [ 'Saku Ytti', 'Samer Abdel-Hafez', 'Anton Aksola' ] -- cgit v1.2.1