lib/facebooker.rb in simianarmy-facebooker-1.0.50 vs lib/facebooker.rb in simianarmy-facebooker-1.0.51

- old
+ new

@@ -1,34 +1,41 @@ begin unless Object.const_defined?("ActiveSupport") and ActiveSupport.const_defined?("JSON") - raise "ActiveSupport JSON Required for Ruote System!" + raise "ActiveSupport JSON Required!" require 'json' module Facebooker def self.json_decode(str) JSON.parse(str) + end + + def self.json_encode(o) + JSON.dump(o) end end else module Facebooker def self.json_decode(str) ActiveSupport::JSON.decode(str) end + + def self.json_encode(obj) + ActiveSupport::JSON.encode(obj) + end end end rescue - puts "*** DANGER!!! REQUIRING json! Breaks if ActiveSupport***" + puts "*** DANGER!!! REQUIRING json! Conflicts w/ ActiveSupport::JSON***" require 'json' end require 'zlib' require 'digest/md5' - - module Facebooker @facebooker_configuration = {} + @raw_facebooker_configuration = {} @current_adapter = nil @set_asset_host_to_callback_url = true @path_prefix = nil @use_curl = false @@ -120,10 +127,9 @@ return @raw_facebooker_configuration['alternative_keys'][api_key].merge( 'api_key' => api_key ) end return false end - # TODO: This should be converted to attr_accessor, but we need to # get all the require statements at the top of the file to work. # Set the current adapter