lib/sidekiq.rb in sidekiq-1.1.4 vs lib/sidekiq.rb in sidekiq-1.2.0
- old
+ new
@@ -1,14 +1,14 @@
require 'sidekiq/version'
require 'sidekiq/client'
require 'sidekiq/worker'
-require 'sidekiq/rails'
require 'sidekiq/redis_connection'
require 'sidekiq/util'
require 'sidekiq/extensions/action_mailer'
require 'sidekiq/extensions/active_record'
+require 'sidekiq/rails' if defined?(::Rails)
module Sidekiq
DEFAULTS = {
:queues => [],
@@ -81,23 +81,13 @@
yield @server_chain if block_given?
@server_chain
end
def self.load_json(string)
- # Can't reliably detect whether MultiJson responds to load, since it's
- # a reserved word. Use adapter as a proxy for new features.
- if MultiJson.respond_to?(:adapter)
- MultiJson.load(string)
- else
- MultiJson.decode(string)
- end
+ MultiJson.decode(string)
end
def self.dump_json(object)
- if MultiJson.respond_to?(:dump)
- MultiJson.dump(object)
- else
- MultiJson.encode(object)
- end
+ MultiJson.encode(object)
end
end