From a51cd156c942582b05ce05eb5ec1e8ee3944700e Mon Sep 17 00:00:00 2001 From: Jeff Byrnes Date: Mon, 26 Oct 2015 13:06:20 -0400 Subject: [PATCH] Ensure options hash has symbols for keys Otherwise, confusion reigns --- cronitor.gemspec | 1 + lib/cronitor.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/cronitor.gemspec b/cronitor.gemspec index bcca0b9..329c79d 100644 --- a/cronitor.gemspec +++ b/cronitor.gemspec @@ -19,6 +19,7 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.add_dependency 'unirest', '~> 1.1' + spec.add_dependency 'hashie', '~> 3.4' spec.add_development_dependency 'bundler', '~> 1.10' spec.add_development_dependency 'rake', '~> 10.0' diff --git a/lib/cronitor.rb b/lib/cronitor.rb index 1092cad..9eea81d 100644 --- a/lib/cronitor.rb +++ b/lib/cronitor.rb @@ -25,6 +25,7 @@ def initialize(token: nil, opts: {}, code: nil) end if @opts + Hashie.symbolize_keys! @opts exists? @opts[:name] if @opts.key? :name human_readable @opts[:rules] if @opts.key? :rules end