summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2016-06-02 14:10:27 +0200
committerFlorian Frank <flori@ping.de>2016-06-02 14:10:27 +0200
commit08b6febac4f2382f2526c51060b630b7b7130577 (patch)
treefdfab9e96d564d53cf4adc181c1146e1b0e8989e
parent6cee8d7dc22d2d8559a49ed27e79f943edd34389 (diff)
downloadjson-08b6febac4f2382f2526c51060b630b7b7130577.tar.gz
Change rfc reference
-rw-r--r--lib/json/common.rb28
-rw-r--r--lib/json/pure/parser.rb2
2 files changed, 6 insertions, 24 deletions
diff --git a/lib/json/common.rb b/lib/json/common.rb
index 1215d41..c47938f 100644
--- a/lib/json/common.rb
+++ b/lib/json/common.rb
@@ -141,7 +141,7 @@ module JSON
# structures. Disable depth checking with :max_nesting => false. It
# defaults to 100.
# * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
- # defiance of RFC 4627 to be parsed by the Parser. This option defaults
+ # defiance of RFC 7159 to be parsed by the Parser. This option defaults
# to false.
# * *symbolize_names*: If set to true, returns symbols for the names
# (keys) in a JSON object. Otherwise strings are returned. Strings are
@@ -165,7 +165,7 @@ module JSON
# parse! methods defaults to not doing max depth checking: This can be
# dangerous if someone wants to fill up your stack.
# * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in
- # defiance of RFC 4627 to be parsed by the Parser. This option defaults
+ # defiance of RFC 7159 to be parsed by the Parser. This option defaults
# 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
@@ -402,27 +402,9 @@ module JSON
raise ArgumentError, "exceed depth limit"
end
- # Swap consecutive bytes of _string_ in place.
- def self.swap!(string) # :nodoc:
- 0.upto(string.size / 2) do |i|
- break unless string[2 * i + 1]
- string[2 * i], string[2 * i + 1] = string[2 * i + 1], string[2 * i]
- end
- string
- end
-
- # Shortcut for iconv.
- if ::String.method_defined?(:encode)
- # Encodes string using Ruby's _String.encode_
- def self.iconv(to, from, string)
- string.encode(to, from)
- end
- else
- require 'iconv'
- # Encodes string using _iconv_ library
- def self.iconv(to, from, string)
- Iconv.conv(to, from, string)
- end
+ # Encodes string using Ruby's _String.encode_
+ def self.iconv(to, from, string)
+ string.encode(to, from)
end
if ::Object.method(:const_defined?).arity == 1
diff --git a/lib/json/pure/parser.rb b/lib/json/pure/parser.rb
index c5d1501..c96fadb 100644
--- a/lib/json/pure/parser.rb
+++ b/lib/json/pure/parser.rb
@@ -58,7 +58,7 @@ module JSON
# structures. Disable depth checking with :max_nesting => false|nil|0,
# it defaults to 100.
# * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
- # defiance of RFC 4627 to be parsed by the Parser. This option defaults
+ # defiance of RFC 7159 to be parsed by the Parser. This option defaults
# to false.
# * *symbolize_names*: If set to true, returns symbols for the names
# (keys) in a JSON object. Otherwise strings are returned, which is