Files
metasploit-gs/lib/active_support/json/decoding.rb
T
Mike Smith 756e6d2ad8 Remove unsupported msfweb interface. (fixes #503)
* This will significantly decrease the size of the msf install (~5 MB)
* ActiveRecord & ActiveSupport are still used, and have been moved to lib/

git-svn-id: file:///home/svn/framework3/trunk@10682 4d416f70-5f16-0410-b530-b9f4589650da
2010-10-14 18:45:16 +00:00

36 lines
864 B
Ruby

require 'active_support/core_ext/module/attribute_accessors'
module ActiveSupport
# Look for and parse json strings that look like ISO 8601 times.
mattr_accessor :parse_json_times
module JSON
class << self
attr_reader :parse_error
delegate :decode, :to => :backend
def backend
self.backend = "Yaml" unless defined?(@backend)
@backend
end
def backend=(name)
if name.is_a?(Module)
@backend = name
else
require "active_support/json/backends/#{name.to_s.downcase}.rb"
@backend = ActiveSupport::JSON::Backends::const_get(name)
end
@parse_error = @backend::ParseError
end
def with_backend(name)
old_backend, self.backend = backend, name
yield
ensure
self.backend = old_backend
end
end
end
end