README.rdoc in rufus-json-1.0.0 vs README.rdoc in rufus-json-1.0.1
- old
+ new
@@ -11,13 +11,15 @@
#require 'active_support'
require 'rufus-json' # gem install rufus-json
p Rufus::Json.decode('{"a":2,"b":true}')
+ p Rufus::Json.load('{"a":2,"b":true}')
# => { 'a' => 2, 'b' => true }
p Rufus::Json.encode({ 'a' => 2, 'b' => true })
+ p Rufus::Json.dump({ 'a' => 2, 'b' => true })
# => '{"a":2,"b":true}'
If multiple libs are present, it will favour yajl-ruby and json, and then active_support. It's OK to force a backend.
@@ -41,9 +43,23 @@
There is a dup method, it may be useful in an all JSON system (flattening stuff that will anyway get flattened later).
o = Rufus::Json.dup(o)
+
+
+=== require 'rufus-json/automatic'
+
+ require 'rufus-json/automatic'
+
+will require 'rufus-json' and load the first JSON lib available (in the order yajl, active_support, json, json/pure.
+
+It is equivalent to
+
+ require 'rufus-json'
+ Rufus::Json.load_backend
+
+(the .load_backend method accepts a list/order of backends to try).
== rdoc
http://rufus.rubyforge.org/rufus-json/