mirror of
https://github.com/ruby/ruby.git
synced 2025-09-23 20:44:00 +02:00
* ext/json, test/json: merge JSON HEAD(17fe8e7)
https://github.com/flori/json/compare/v1.8.1...17fe8e7 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5547719573
commit
4a481ad400
10 changed files with 42 additions and 20 deletions
|
@ -148,7 +148,7 @@ module JSON
|
|||
# the default.
|
||||
# * *create_additions*: If set to false, the Parser doesn't create
|
||||
# additions even if a matching class and create_id was found. This option
|
||||
# defaults to true.
|
||||
# defaults to false.
|
||||
# * *object_class*: Defaults to Hash
|
||||
# * *array_class*: Defaults to Array
|
||||
def parse(source, opts = {})
|
||||
|
@ -169,7 +169,7 @@ module JSON
|
|||
# to true.
|
||||
# * *create_additions*: If set to false, the Parser doesn't create
|
||||
# additions even if a matching class and create_id was found. This option
|
||||
# defaults to true.
|
||||
# defaults to false.
|
||||
def parse!(source, opts = {})
|
||||
opts = {
|
||||
:max_nesting => false,
|
||||
|
@ -390,7 +390,7 @@ module JSON
|
|||
end
|
||||
end
|
||||
opts = JSON.dump_default_options
|
||||
limit and opts.update(:max_nesting => limit)
|
||||
opts = opts.merge(:max_nesting => limit) if limit
|
||||
result = generate(obj, opts)
|
||||
if anIO
|
||||
anIO.write result
|
||||
|
@ -411,7 +411,7 @@ module JSON
|
|||
string
|
||||
end
|
||||
|
||||
# Shortuct for iconv.
|
||||
# Shortcut for iconv.
|
||||
if ::String.method_defined?(:encode)
|
||||
# Encodes string using Ruby's _String.encode_
|
||||
def self.iconv(to, from, string)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue