lib/riak.rb in riak-client-0.7.1 vs lib/riak.rb in riak-client-0.8.0.beta

- old
+ new

@@ -13,12 +13,14 @@ # limitations under the License. $KCODE = "UTF8" if RUBY_VERSION < "1.9" require 'active_support/all' require 'active_support/json' +require 'active_support/version' require 'base64' require 'uri' +require 'cgi' require 'net/http' require 'yaml' require 'riak/i18n' # The Riak module contains all aspects of the HTTP client interface @@ -30,11 +32,14 @@ autoload :Link, "riak/link" autoload :WalkSpec, "riak/walk_spec" autoload :RObject, "riak/robject" autoload :MapReduce, "riak/map_reduce" - # Cache store - autoload :CacheStore, "riak/cache_store" + # Cache store - only supports Rails 3 style + if ActiveSupport::VERSION::STRING >= "3.0.0" + autoload :CacheStore, "riak/cache_store" + ::ActiveSupport::Cache.autoload :RiakStore, "riak/cache_store" + end # Exceptions autoload :FailedRequest, "riak/failed_request" autoload :InvalidResponse, "riak/invalid_response" autoload :MapReduceError, "riak/map_reduce_error"