Skip to content

Commit 3a535cb

Browse files
authored
Merge pull request #99 from evolve75/58-JSON.parse
58 json.parse clarification (use the `create_additions: true` option for `JSON.parse`)
2 parents 6251c7e + 2281227 commit 3a535cb

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
rubytree (2.0.2)
4+
rubytree (2.0.3)
55
json (~> 2.0, > 2.3.1)
66

77
GEM

lib/tree/utils/json_converter.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#
55
# Author:: Anupam Sengupta (anupamsg@gmail.com)
66
#
7-
# Time-stamp: <2022-06-20 22:16:46 anupam>
7+
# Time-stamp: <2023-12-27 12:46:07 anupam>
88
#
9-
# Copyright (C) 2012, 2013, 2014, 2015, 2022 Anupam Sengupta <anupamsg@gmail.com>
9+
# Copyright (C) 2012, 2013, 2014, 2015, 2022, 2023 Anupam Sengupta <anupamsg@gmail.com>
1010
#
1111
# All rights reserved.
1212
#
@@ -100,11 +100,14 @@ module ClassMethods
100100
# representation. Note that this method should *NOT* be called directly.
101101
# Instead, to convert the JSON hash back to a tree, do:
102102
#
103-
# tree = JSON.parse(the_json_hash)
103+
# tree = JSON.parse(the_json_hash, create_additions: true)
104104
#
105105
# This operation requires the {JSON gem}[http://flori.github.com/json/] to
106106
# be available, or else the operation fails with a warning message.
107107
#
108+
# Note the +create_additions: true+ option, which is *required* for
109+
# successfully parsing the string or hash.
110+
#
108111
# @author Dirk Breuer (http://github.com/railsbros-dirk)
109112
# @since 0.7.0
110113
#

lib/tree/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@
3535

3636
module Tree
3737
# Rubytree Package Version
38-
VERSION = '2.0.2'
38+
VERSION = '2.0.3'
3939
end

0 commit comments

Comments
 (0)