diff --git a/lib/splunk_logging.rb b/lib/splunk_logging.rb index 91a891040dfd82ee599461f18cea4612126d1c84..39f58763f2bc6458c9f3337e3e2e173fd3bf57cd 100644 --- a/lib/splunk_logging.rb +++ b/lib/splunk_logging.rb @@ -11,7 +11,7 @@ module SplunkLogging if hash.respond_to?(:keys) string = '' hash.each_pair do |key, value| - if(value.instance_of?(Symbol)||value.instance_of?(Fixnum)) + if(value.instance_of?(Symbol)||value.instance_of?(Fixnum)||value.instance_of?(Float)) string << "#{key}=#{value} " else string << "#{key}='#{value}' " diff --git a/spec/lib/splunk_logging_spec.rb b/spec/lib/splunk_logging_spec.rb index f724ab641ab07cf94a4bfbdf3d1be4994f0e66f9..f2fa5204f649948ee1ba4a134e303d80dca1a607 100644 --- a/spec/lib/splunk_logging_spec.rb +++ b/spec/lib/splunk_logging_spec.rb @@ -17,5 +17,8 @@ describe SplunkLogging do it 'does not quote numbers' do format_hash({:key => 500 }).should =~ /=500/ end + it 'does not quote floats' do + format_hash({:key => 2.324}).should =~ /=2.324/ + end end end