weblet 0.2.1 → 0.2.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/weblet.rb +10 -4
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: e1b3fa491f5536efe9eba1c3c3a0832c05d200e964af91b907a37bc585903261
|
4
|
+
data.tar.gz: baa8a63a3292328e12eb67b03e9d0ac5e89d931d1e6c0a77d0002ae5484a58b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c10707bb0f4e4134565c0d3043dd5d1d571bf10e2451ff641c17bcd9786cb540ed2afa45b481d18494f5c1cab67f3b5e906590d2abc520cdf03a596e5a661ce4
|
7
|
+
data.tar.gz: 9387796aab5fd12979e1b5d0d7a05116e77b8400a2f73e4f21446616118f7065e92dc1f19f6e94a872e846ded6c96564ee5bfb3a57dc661b9fa592961b1bd08b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/weblet.rb
CHANGED
@@ -3,14 +3,19 @@
|
|
3
3
|
# file: weblet.rb
|
4
4
|
|
5
5
|
require 'rexle'
|
6
|
+
require 'rxfhelper'
|
6
7
|
|
7
8
|
|
8
9
|
class WebletBuilder
|
9
10
|
|
10
|
-
def initialize(s, marker:
|
11
|
+
def initialize(s, marker: nil, debug: false)
|
11
12
|
|
12
13
|
@marker, @debug = marker, debug
|
13
14
|
|
15
|
+
# the default marker is the hash symbol (#) but the client can set their
|
16
|
+
# own marker by simply using their custom symbol in the 1st line of input
|
17
|
+
@marker ||= s[0]
|
18
|
+
|
14
19
|
@a = build(scan(s.strip))
|
15
20
|
@a.unshift *['weblet', {}, '']
|
16
21
|
|
@@ -58,12 +63,13 @@ end
|
|
58
63
|
|
59
64
|
class Weblet
|
60
65
|
|
61
|
-
def initialize(raws, b, marker:
|
66
|
+
def initialize(raws, b, marker: nil, debug: false)
|
62
67
|
|
63
68
|
@debug = debug
|
69
|
+
|
70
|
+
s, _ = RXFHelper.read(raws.strip)
|
64
71
|
|
65
|
-
|
66
|
-
obj = raws[0] == '<' ? raws : WebletBuilder.new(raws, marker: marker, \
|
72
|
+
obj = s[0] == '<' ? s : WebletBuilder.new(s, marker: marker, \
|
67
73
|
debug: debug).to_a
|
68
74
|
@doc = Rexle.new(obj)
|
69
75
|
@h = scan @doc.root
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|