summaryrefslogtreecommitdiff
path: root/ext/json/lib/json/common.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-20 02:55:08 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-20 02:55:08 +0000
commit14cab32596d3e394cafea7a7698a81034b83c172 (patch)
tree672a0450700e77f4d0129f781ce24c1799a773fa /ext/json/lib/json/common.rb
parent9d740ddebeaa46f47c9b4529e8b36d72d97f9105 (diff)
* ext/json: merge JSON 1.8.1.
https://github.com/nurse/json/compare/002ac2771ce32776b32ccd2d06e5604de6c36dcd...e09ffc0d7da25d0393873936c118c188c78dbac3 * Remove Rubinius exception since transcoding should be working now. * Fix https://github.com/flori/json/issues/162 reported by Marc-Andre Lafortune <github_rocks@marc-andre.ca>. Thanks! * Applied patches by Yui NARUSE <naruse@airemix.jp> to suppress warning with -Wchar-subscripts and better validate UTF-8 strings. * Applied patch by ginriki@github to remove unnecessary if. * Add load/dump interface to JSON::GenericObject to make serialize :some_attribute, JSON::GenericObject work in Rails active models for convenient SomeModel#some_attribute.foo.bar access to serialised JSON data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json/lib/json/common.rb')
-rw-r--r--ext/json/lib/json/common.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb
index a547679..e24f637 100644
--- a/ext/json/lib/json/common.rb
+++ b/ext/json/lib/json/common.rb
@@ -179,10 +179,9 @@ module JSON
end
# Generate a JSON document from the Ruby data structure _obj_ and return
- # it. _state_ is
- # * a JSON::State object,
+ # it. _state_ is * a JSON::State object,
# * or a Hash like object (responding to to_hash),
- # * or an object convertible into a hash by a to_h method,
+ # * an object convertible into a hash by a to_h method,
# that is used as or to configure a State object.
#
# It defaults to a state object, that creates the shortest possible JSON text
@@ -413,10 +412,7 @@ module JSON
end
# Shortuct for iconv.
- if ::String.method_defined?(:encode) &&
- # XXX Rubinius doesn't support ruby 1.9 encoding yet
- defined?(RUBY_ENGINE) && RUBY_ENGINE != 'rbx'
- then
+ if ::String.method_defined?(:encode)
# Encodes string using Ruby's _String.encode_
def self.iconv(to, from, string)
string.encode(to, from)