line-tree 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1466817b8694f84b089e0e025c2de227ea87f8122b10d8e85087130b5af6e2a7
4
- data.tar.gz: cc8aa9b846f0aa103955376ae369ed9acc41d80ab995afca57c61cc6b9f33168
3
+ metadata.gz: a33a15f527a6b9c0b3351182fd47786a8d7b9bd8fd3a9361be0050d3d4bf92ff
4
+ data.tar.gz: e1ebcf399f166e9287a516d0c2fc481c5d168bd9033af80e947ca8becdb824f8
5
5
  SHA512:
6
- metadata.gz: 9518e74794986289260782bf556fd782896c138c0de0ca4d90aec3c35bb3496fee6887e0230055c80d891d8f532dec097c46418d45da284d3356cdc3fa8352ee
7
- data.tar.gz: fa7b09a43ac1556883ddbff8780bf0e570a46d342189cd6713d749c1c1aad10ee2b880c160de72f703646054b122f60c12d8cbe1583e050a198f96ec01924fd6
6
+ metadata.gz: 9ae4053c9b18c5e3fc236d4291be9de534734a41dd44f7a8a1708cfb8102407607ad71891b594b3167e333c147b1c71f74087adb387aa6bf9a086bfeba029619
7
+ data.tar.gz: 238d52f7490b57143e880b7f8fc21941f985da05b98083cbaeb19490215a2ba2ca84b384db605fa468fb92d981c76f25ef73c4a3ae38f73ddbcbd25a60436911
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/line-tree.rb CHANGED
@@ -62,6 +62,27 @@ class LineTree
62
62
  Rexle.new(s).xml declaration: false
63
63
 
64
64
  end
65
+
66
+ def to_tree()
67
+
68
+ def make_tree_list(a)
69
+
70
+ items = a.inject([]) do |r,x|
71
+
72
+ if x.is_a? Array then
73
+ r << make_tree_list(x)
74
+ else
75
+ r + ['item', {title: x}]
76
+ end
77
+ end
78
+
79
+ end
80
+
81
+ a = make_tree_list(@to_a)
82
+ doc = Rexle.new(['tree', {}, *a])
83
+ doc.xml
84
+
85
+ end
65
86
 
66
87
  def to_xml(options={})
67
88
  to_doc.xml(options)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: line-tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  tRbkGzcgp9c2ZiHYMTUE+pFTjJmsHsHNK2V5UKCUGoiLja2dhcA5APnBhy1IGSao
36
36
  guQOgw0RA86t3d5G4VaV1iMO
37
37
  -----END CERTIFICATE-----
38
- date: 2019-07-14 00:00:00.000000000 Z
38
+ date: 2019-09-15 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rexle
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubygems_version: 3.0.1
87
+ rubygems_version: 3.0.3
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: line-tree
metadata.gz.sig CHANGED
Binary file