2011-07-12 23:25:17 -07:00

29 lines
630 B
Ruby

require File.join(File.dirname(__FILE__), 'common')
require File.join(File.dirname(__FILE__), 'pure/parser')
require File.join(File.dirname(__FILE__), 'pure/generator')
module JSON
# This module holds all the modules/classes that implement JSON's
# functionality in pure ruby.
module Pure
$DEBUG and warn "Using Pure library for JSON."
JSON.parser = Parser
JSON.generator = Generator
end
JSON_LOADED = true unless defined?(::JSON::JSON_LOADED)
end
## Hacks needed to make to_json work
class Fixnum
def to_json(options=nil)
to_s
end
end
class Integer
def to_json(options=nil)
to_s
end
end