tree_support 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86248d992a77da5505f13bc34c3a267ad196fd4ea903ba0db7823fb1dad0a16c
4
- data.tar.gz: 5939a67cfcb10da3e1c62ce3f539eb4100b8b8ac142e1005f4b485f70f28be56
3
+ metadata.gz: bc32b4d87ac536560722828526789df4b1bae17d0872c75aafdee114bf22f187
4
+ data.tar.gz: 5974d22129202db8a20e92d0b99d567a4afe5ea8f1a4af709fd785105b647a82
5
5
  SHA512:
6
- metadata.gz: 411439c72319f83d97967e433b046f4069bd7cdc24c6bc7111d9f09face5d15808a4eee0a40ed10d074c8b151c190feff0e413d702a6c69ba8faf1266d7a039d
7
- data.tar.gz: ac5f109d06e75f0b0bd41f7b342efdcb0f708082ed13dbcb40aae7b0a1fe508b20f114bcb1cd71b603096dd72fc257ac66deca22cb4fb9fb1dfa026c4353666b
6
+ metadata.gz: 2b5365879d03dc973df6de1caf2ca9d33e217ea8649fd2129a953cc288e97c3aa806763fe04a74be01aca33ce1c501ad1a7edfa3e098fbd22bd2cdc1219f24cb
7
+ data.tar.gz: 4492c979351ef948321ba535d1d0172852275d89c0c136a6f981279c026a62fc2434895e6c2ba3c994fb5c4c5742a875fcdc86861d49c22465db5096e18b5593
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.4.1
3
+ - 2.5.1
4
4
  script: bundle exec rake
@@ -52,10 +52,10 @@ root = Node.new("*root*") do
52
52
  end
53
53
  end
54
54
 
55
- # TreeSupport.tree に渡すオブジェクトは parent.children name に応答できさえすればいい
55
+ # The object passed to TreeSupport.tree needs only to respond to parent.children and name
56
56
  puts TreeSupport.tree(root)
57
57
 
58
- # オブジェクトに文字列化するメソッドを入れるには?
58
+ # How do I put a method to stringify an object?
59
59
  Node.include(TreeSupport::Stringify)
60
60
  puts root.to_s_tree
61
61
  # >> *root*
@@ -66,19 +66,6 @@ Node.extend(ActsAsTree::TreeView)
66
66
  Node.tree_view(:name)
67
67
 
68
68
  # puts TreeSupport.tree(root)
69
- # ~> from -:8:in `<main>'
70
- # ~> from -:8:in `require'
71
- # ~> from /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/acts_as_tree-2.4.0/lib/acts_as_tree.rb:322:in `<top (required)>'
72
- # ~> from /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/acts_as_tree-2.4.0/lib/acts_as_tree.rb:322:in `require'
73
- # ~> from /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/acts_as_tree-2.4.0/lib/acts_as_tree/active_record/acts/tree.rb:1:in `<top (required)>'
74
- # ~> from /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/acts_as_tree-2.4.0/lib/acts_as_tree/active_record/acts/tree.rb:1:in `require'
75
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.0.0/lib/active_support/core_ext/hash/transform_values.rb:11: warning: method redefined; discarding old transform_values
76
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.0.0/lib/active_support/core_ext/hash/transform_values.rb:23: warning: method redefined; discarding old transform_values!
77
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.2/lib/concurrent/map.rb:230: warning: constant ::Fixnum is deprecated
78
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.2/lib/concurrent/map.rb:230: warning: constant ::Fixnum is deprecated
79
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.2/lib/concurrent/map.rb:230: warning: constant ::Fixnum is deprecated
80
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.2/lib/concurrent/map.rb:230: warning: constant ::Fixnum is deprecated
81
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/arel-7.1.0/lib/arel/nodes/casted.rb:14: warning: instance variable @class not initialized
82
69
  # >> root
83
70
  # >> |_ *root*
84
71
  # >> | |_ Battle
@@ -74,44 +74,8 @@ end
74
74
 
75
75
  puts TreeSupport.tree(root) {|e| "#{e.name}(#{e.position})"}
76
76
 
77
- # acts_as_tree + acts_as_list destroy_all で事故る
77
+ # acts_as_tree + acts_as_list accident in destroy_all
78
78
  Node.destroy_all rescue $! # => #<ActiveRecord::RecordNotFound: Couldn't find Node with 'id'=2>
79
- # ~> from -:8:in `<main>'
80
- # ~> from -:8:in `require'
81
- # ~> from /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/acts_as_tree-2.4.0/lib/acts_as_tree.rb:322:in `<top (required)>'
82
- # ~> from /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/acts_as_tree-2.4.0/lib/acts_as_tree.rb:322:in `require'
83
- # ~> from /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/acts_as_tree-2.4.0/lib/acts_as_tree/active_record/acts/tree.rb:1:in `<top (required)>'
84
- # ~> from /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/acts_as_tree-2.4.0/lib/acts_as_tree/active_record/acts/tree.rb:1:in `require'
85
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.0.0/lib/active_support/core_ext/hash/transform_values.rb:11: warning: method redefined; discarding old transform_values
86
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.0.0/lib/active_support/core_ext/hash/transform_values.rb:23: warning: method redefined; discarding old transform_values!
87
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.2/lib/concurrent/map.rb:230: warning: constant ::Fixnum is deprecated
88
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.2/lib/concurrent/map.rb:230: warning: constant ::Fixnum is deprecated
89
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.2/lib/concurrent/map.rb:230: warning: constant ::Fixnum is deprecated
90
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.2/lib/concurrent/map.rb:230: warning: constant ::Fixnum is deprecated
91
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/arel-7.1.0/lib/arel/nodes/casted.rb:14: warning: instance variable @class not initialized
92
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
93
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
94
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
95
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
96
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
97
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
98
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
99
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
100
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
101
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
102
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
103
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
104
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
105
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
106
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
107
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
108
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
109
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
110
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activerecord-5.0.0/lib/active_record/sanitization.rb:163: warning: too many arguments for format string
111
- # ~> /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/arel-7.1.0/lib/arel/nodes/casted.rb:14: warning: instance variable @class not initialized
112
- # ~> !XMP1512801308_58182_9031![1] => ActiveRecord::RecordNotFound #<ActiveRecord::RecordNotFound: Couldn't find Node with 'id'=2>
113
- # ~> root
114
- # ~> _xmp_1512801308_58182_55846
115
79
  # >> *root*(1)
116
80
  # >> ├─Battle(1)
117
81
  # >> │ ├─Attack(1)
@@ -24,4 +24,4 @@ class Node < ActiveRecord::Base
24
24
  end
25
25
 
26
26
  Node.create!(name: "*root*")
27
- Node.first.to_json # => "{\"id\":1,\"parent_id\":null,\"name\":\"*root*\"}"
27
+ Node.first.as_json # => {"id"=>1, "parent_id"=>nil, "name"=>"*root*"}
@@ -3,7 +3,7 @@ require "bundler/setup"
3
3
  require "tree_support"
4
4
  require "memory_record"
5
5
 
6
- class Foo
6
+ class TreeModel
7
7
  include MemoryRecord
8
8
  memory_record [
9
9
  {key: :a, name: "A", parent: nil},
@@ -28,7 +28,7 @@ class Foo
28
28
  end
29
29
  end
30
30
 
31
- puts Foo.find_all(&:root?).collect(&:to_s_tree)
31
+ puts TreeModel.find_all(&:root?).collect(&:to_s_tree)
32
32
  # >> A
33
33
  # >> └─B
34
34
  # >> └─C
@@ -1,123 +1,129 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- tree_support (0.0.1)
4
+ tree_support (0.1.4)
5
5
  activesupport
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (5.0.0)
11
- actionpack (= 5.0.0)
12
- nio4r (~> 1.2)
13
- websocket-driver (~> 0.6.1)
14
- actionmailer (5.0.0)
15
- actionpack (= 5.0.0)
16
- actionview (= 5.0.0)
17
- activejob (= 5.0.0)
10
+ actioncable (5.2.1)
11
+ actionpack (= 5.2.1)
12
+ nio4r (~> 2.0)
13
+ websocket-driver (>= 0.6.1)
14
+ actionmailer (5.2.1)
15
+ actionpack (= 5.2.1)
16
+ actionview (= 5.2.1)
17
+ activejob (= 5.2.1)
18
18
  mail (~> 2.5, >= 2.5.4)
19
19
  rails-dom-testing (~> 2.0)
20
- actionpack (5.0.0)
21
- actionview (= 5.0.0)
22
- activesupport (= 5.0.0)
20
+ actionpack (5.2.1)
21
+ actionview (= 5.2.1)
22
+ activesupport (= 5.2.1)
23
23
  rack (~> 2.0)
24
- rack-test (~> 0.6.3)
24
+ rack-test (>= 0.6.3)
25
25
  rails-dom-testing (~> 2.0)
26
26
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
- actionview (5.0.0)
28
- activesupport (= 5.0.0)
27
+ actionview (5.2.1)
28
+ activesupport (= 5.2.1)
29
29
  builder (~> 3.1)
30
- erubis (~> 2.7.0)
30
+ erubi (~> 1.4)
31
31
  rails-dom-testing (~> 2.0)
32
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
33
- activejob (5.0.0)
34
- activesupport (= 5.0.0)
32
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
+ activejob (5.2.1)
34
+ activesupport (= 5.2.1)
35
35
  globalid (>= 0.3.6)
36
- activemodel (5.0.0)
37
- activesupport (= 5.0.0)
38
- activerecord (5.0.0)
39
- activemodel (= 5.0.0)
40
- activesupport (= 5.0.0)
41
- arel (~> 7.0)
42
- activesupport (5.0.0)
36
+ activemodel (5.2.1)
37
+ activesupport (= 5.2.1)
38
+ activerecord (5.2.1)
39
+ activemodel (= 5.2.1)
40
+ activesupport (= 5.2.1)
41
+ arel (>= 9.0)
42
+ activestorage (5.2.1)
43
+ actionpack (= 5.2.1)
44
+ activerecord (= 5.2.1)
45
+ marcel (~> 0.3.1)
46
+ activesupport (5.2.1)
43
47
  concurrent-ruby (~> 1.0, >= 1.0.2)
44
- i18n (~> 0.7)
48
+ i18n (>= 0.7, < 2)
45
49
  minitest (~> 5.1)
46
50
  tzinfo (~> 1.1)
47
- acts_as_list (0.7.6)
51
+ acts_as_list (0.9.16)
48
52
  activerecord (>= 3.0)
49
- acts_as_tree (2.4.0)
53
+ acts_as_tree (2.8.0)
50
54
  activerecord (>= 3.0.0)
51
- arel (7.1.0)
52
- builder (3.2.2)
53
- byebug (9.0.5)
54
- concurrent-ruby (1.0.2)
55
- erubis (2.7.0)
56
- globalid (0.3.6)
57
- activesupport (>= 4.1.0)
55
+ arel (9.0.0)
56
+ builder (3.2.3)
57
+ byebug (10.0.2)
58
+ concurrent-ruby (1.0.5)
59
+ crass (1.0.4)
60
+ erubi (1.7.1)
61
+ globalid (0.4.1)
62
+ activesupport (>= 4.2.0)
58
63
  gviz (0.3.5)
59
64
  thor
60
- i18n (0.7.0)
61
- loofah (2.0.3)
65
+ i18n (1.1.0)
66
+ concurrent-ruby (~> 1.0)
67
+ loofah (2.2.2)
68
+ crass (~> 1.0.2)
62
69
  nokogiri (>= 1.5.9)
63
- mail (2.6.4)
64
- mime-types (>= 1.16, < 4)
65
- memory_record (0.0.6)
66
- activemodel
70
+ mail (2.7.0)
71
+ mini_mime (>= 0.1.1)
72
+ marcel (0.3.3)
73
+ mimemagic (~> 0.3.2)
74
+ memory_record (0.0.14)
67
75
  activesupport
68
- method_source (0.8.2)
69
- mime-types (3.1)
70
- mime-types-data (~> 3.2015)
71
- mime-types-data (3.2016.0521)
72
- mini_portile2 (2.1.0)
73
- minitest (5.9.0)
74
- nio4r (1.2.1)
75
- nokogiri (1.6.8)
76
- mini_portile2 (~> 2.1.0)
77
- pkg-config (~> 1.1.7)
78
- pkg-config (1.1.7)
79
- rack (2.0.1)
80
- rack-test (0.6.3)
81
- rack (>= 1.0)
82
- rails (5.0.0)
83
- actioncable (= 5.0.0)
84
- actionmailer (= 5.0.0)
85
- actionpack (= 5.0.0)
86
- actionview (= 5.0.0)
87
- activejob (= 5.0.0)
88
- activemodel (= 5.0.0)
89
- activerecord (= 5.0.0)
90
- activesupport (= 5.0.0)
91
- bundler (>= 1.3.0, < 2.0)
92
- railties (= 5.0.0)
76
+ method_source (0.9.0)
77
+ mimemagic (0.3.2)
78
+ mini_mime (1.0.1)
79
+ mini_portile2 (2.3.0)
80
+ minitest (5.11.3)
81
+ nio4r (2.3.1)
82
+ nokogiri (1.8.4)
83
+ mini_portile2 (~> 2.3.0)
84
+ rack (2.0.5)
85
+ rack-test (1.1.0)
86
+ rack (>= 1.0, < 3)
87
+ rails (5.2.1)
88
+ actioncable (= 5.2.1)
89
+ actionmailer (= 5.2.1)
90
+ actionpack (= 5.2.1)
91
+ actionview (= 5.2.1)
92
+ activejob (= 5.2.1)
93
+ activemodel (= 5.2.1)
94
+ activerecord (= 5.2.1)
95
+ activestorage (= 5.2.1)
96
+ activesupport (= 5.2.1)
97
+ bundler (>= 1.3.0)
98
+ railties (= 5.2.1)
93
99
  sprockets-rails (>= 2.0.0)
94
- rails-dom-testing (2.0.1)
95
- activesupport (>= 4.2.0, < 6.0)
96
- nokogiri (~> 1.6.0)
97
- rails-html-sanitizer (1.0.3)
98
- loofah (~> 2.0)
99
- railties (5.0.0)
100
- actionpack (= 5.0.0)
101
- activesupport (= 5.0.0)
100
+ rails-dom-testing (2.0.3)
101
+ activesupport (>= 4.2.0)
102
+ nokogiri (>= 1.6)
103
+ rails-html-sanitizer (1.0.4)
104
+ loofah (~> 2.2, >= 2.2.2)
105
+ railties (5.2.1)
106
+ actionpack (= 5.2.1)
107
+ activesupport (= 5.2.1)
102
108
  method_source
103
109
  rake (>= 0.8.7)
104
- thor (>= 0.18.1, < 2.0)
105
- rake (11.2.2)
106
- sprockets (3.7.0)
110
+ thor (>= 0.19.0, < 2.0)
111
+ rake (12.3.1)
112
+ sprockets (3.7.2)
107
113
  concurrent-ruby (~> 1.0)
108
114
  rack (> 1, < 3)
109
- sprockets-rails (3.1.1)
115
+ sprockets-rails (3.2.1)
110
116
  actionpack (>= 4.0)
111
117
  activesupport (>= 4.0)
112
118
  sprockets (>= 3.0.0)
113
- sqlite3 (1.3.11)
114
- thor (0.19.1)
115
- thread_safe (0.3.5)
116
- tzinfo (1.2.2)
119
+ sqlite3 (1.3.13)
120
+ thor (0.20.0)
121
+ thread_safe (0.3.6)
122
+ tzinfo (1.2.5)
117
123
  thread_safe (~> 0.1)
118
- websocket-driver (0.6.4)
124
+ websocket-driver (0.7.0)
119
125
  websocket-extensions (>= 0.1.0)
120
- websocket-extensions (0.1.2)
126
+ websocket-extensions (0.1.3)
121
127
 
122
128
  PLATFORMS
123
129
  ruby
@@ -134,4 +140,4 @@ DEPENDENCIES
134
140
  tree_support!
135
141
 
136
142
  BUNDLED WITH
137
- 1.16.0.pre.3
143
+ 1.16.2
data/examples/demo.rb CHANGED
@@ -105,22 +105,22 @@ TreeSupport.graphviz(root, take: 3, drop: 1).output("../images/take_drop.png")
105
105
  # >> Break
106
106
  # >> ├─Stop
107
107
  # >> └─Recover
108
- # >> 70279213508120
109
- # >> ├─70279213507760
110
- # >> │ ├─70279213507500
111
- # >> │ │ ├─70279213507240
112
- # >> │ │ ├─70279213507000
113
- # >> │ │ │ ├─70279213506800
114
- # >> │ │ │ └─70279213506660
115
- # >> │ │ └─70279213507200
116
- # >> │ └─70279213509960
117
- # >> ├─70279213498160
118
- # >> │ ├─70279213497920
119
- # >> │ │ ├─70279213497740
120
- # >> │ │ └─70279213497600
121
- # >> │ └─70279213497380
122
- # >> └─70279213497180
123
- # >> ├─70279213496960
124
- # >> └─70279213496720
125
- # >> ├─70279213496480
126
- # >> └─70279213496320
108
+ # >> 70308246324740
109
+ # >> ├─70308246324580
110
+ # >> │ ├─70308246324440
111
+ # >> │ │ ├─70308246324300
112
+ # >> │ │ ├─70308246324200
113
+ # >> │ │ │ ├─70308246324060
114
+ # >> │ │ │ └─70308246323960
115
+ # >> │ │ └─70308246323860
116
+ # >> │ └─70308246323760
117
+ # >> ├─70308246323660
118
+ # >> │ ├─70308246323520
119
+ # >> │ │ ├─70308246323380
120
+ # >> │ │ └─70308246323280
121
+ # >> │ └─70308246314940
122
+ # >> └─70308246314840
123
+ # >> ├─70308246314700
124
+ # >> └─70308246314600
125
+ # >> ├─70308246314460
126
+ # >> └─70308246314360
@@ -70,11 +70,16 @@ module TreeSupport
70
70
  # {key: :c, parent: :b},
71
71
  # ]
72
72
  #
73
- # puts TreeSupport.records_to_tree(records).to_s_tree
74
- # a
75
- # └─b
76
- # └─c
77
- # └─d
73
+ # puts TreeSupport.records_to_tree(records, root_key: :root).to_s_tree
74
+ # >> root
75
+ # >> └─a
76
+ # >> ├─b
77
+ # >> ├─c
78
+ #
79
+ # puts TreeSupport.records_to_tree(records).first.to_s_tree
80
+ # >> a
81
+ # >> ├─b
82
+ # >> ├─c
78
83
  #
79
84
  # Be sure to have one route
80
85
  #
@@ -1,3 +1,3 @@
1
1
  module TreeSupport
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tree_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - akicho8
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-30 00:00:00.000000000 Z
11
+ date: 2018-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport