jsmenubuilder 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -1
- data/lib/jsmenubuilder.rb +33 -4
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81612c62821ddc1ddf7d05efecc0c4d65fc4014857011189e77afabaf02ccc47
|
4
|
+
data.tar.gz: 83d8aa800e06745168536df31802c1ef94f88bed3f03a6c926a62bb7bc98cac5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d048898e0197f9a152616e0b45e4d24835ecad556540e5bdace762197c5d8a8faa4b15cc8b89860212f7097bf0fe1a625111124569858f6afb2391fe56c02dfd
|
7
|
+
data.tar.gz: 98e9424d639a8d0ce808b6909d478ea6d67112de28daf6206d4b988a4e4b9f97358188e5348b8446209fdb4c41f86f7199d362b6831cc9817e454fa90641c46c
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
��$����"���e%e�ڌ������;A�>����ņe<h:$<y:1�0 ������9h$�����T3%�`]��tB3�Єn
|
data/lib/jsmenubuilder.rb
CHANGED
@@ -198,13 +198,25 @@ EOF
|
|
198
198
|
|
199
199
|
def initialize(unknown=nil, options={})
|
200
200
|
|
201
|
-
|
201
|
+
@debug = options[:debug]
|
202
|
+
puts 'options: ' + options.inspect if @debug
|
203
|
+
|
204
|
+
if unknown.is_a? Symbol
|
202
205
|
type = unknown.to_sym
|
206
|
+
|
207
|
+
elsif unknown.is_a? String then
|
208
|
+
|
209
|
+
s, _ = RXFHelper.read unknown
|
210
|
+
if s =~ /^<tags/ then
|
211
|
+
options = parse_xml(s)
|
212
|
+
type = options.keys.first
|
213
|
+
else
|
214
|
+
type = unknown.to_sym
|
215
|
+
end
|
216
|
+
|
203
217
|
elsif unknown.is_a? Hash
|
204
218
|
options = unknown
|
205
|
-
end
|
206
|
-
|
207
|
-
@debug = options[:debug]
|
219
|
+
end
|
208
220
|
|
209
221
|
@types = %i(tabs full_page_tabs accordion)
|
210
222
|
|
@@ -312,6 +324,18 @@ EOF
|
|
312
324
|
|
313
325
|
end
|
314
326
|
|
327
|
+
def build_h(doc)
|
328
|
+
|
329
|
+
puts 'inside build_h'.info if @debug
|
330
|
+
|
331
|
+
h = doc.root.xpath('tag').inject({}) do |r,e|
|
332
|
+
r.merge(e.attributes[:title] => e.children.join.strip)
|
333
|
+
end
|
334
|
+
|
335
|
+
{doc.root.attributes[:mode].to_s.to_sym => h}
|
336
|
+
|
337
|
+
end
|
338
|
+
|
315
339
|
def build_xml(type, opt={})
|
316
340
|
|
317
341
|
puts 'inside build_xml'.info if @debug
|
@@ -350,6 +374,11 @@ EOF
|
|
350
374
|
return doc.xml(pretty: true)
|
351
375
|
|
352
376
|
end
|
377
|
+
|
378
|
+
def parse_xml(s)
|
379
|
+
doc = Rexle.new(s)
|
380
|
+
build_h(doc)
|
381
|
+
end
|
353
382
|
|
354
383
|
def tabs(opt={})
|
355
384
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsmenubuilder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
haYJPATx3zs+9jtQoiFg+keM0CPYk/5LgCv9jxxzQcSS20C8O9MWRVvYfIr47ak7
|
36
36
|
yXrDPmRvbJLTNjDv6Tkg3vU6
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2019-09-
|
38
|
+
date: 2019-09-28 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rexle
|
metadata.gz.sig
CHANGED
Binary file
|