splunk / splunk-sdk-ruby

Splunk Software Development Kit for Ruby
http://dev.splunk.com
Apache License 2.0
36 stars 21 forks source link

client.rb claims json/ext doesn't work #5

Closed beezly closed 10 years ago

beezly commented 12 years ago

In client.rb there is a comment and a require suggesting json/ext doesn't work;

#TODO: Please get me working with json/ext - it SO much faster
require 'json/pure'

However, I've just tried replacing it with

require 'json'

and it seems to behave as expected, certainly with a jobs.create_oneshot search request. Does it not work in other circumstances or can this be changed to 'json'? Just using require 'json' will enable fallback to 'json/pure' if the extension version is not available.

beezly commented 12 years ago

The commit at https://github.com/beezly/splunk-sdk-ruby/commit/ab454710157a747c55b58542a83233a095af84d7 changes the sdk to use the compiled JSON extension if it is available. It will fallback to the pure Ruby JSON implementation if the compiled extension doesn't work for any reason.

It passes the test suite without any problems being reported.