polyrex-links 0.3.2 → 0.4.0
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 +0 -0
- data.tar.gz.sig +0 -0
- data/lib/polyrex-links.rb +24 -3
- metadata +7 -7
- 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: 8964a224bb312d07bcc1a24ca3df8350c26ee39ae1c1d4437ad53ca6741e9cf8
|
4
|
+
data.tar.gz: 38a6fffecdb3f792e0d7cb4bdc08456e8c550bd069a4304d227444727ad0c69e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f84201d8eee6df717d0a99d1464776239476afad86f8ab7bf83a1d711777226c90381478ea3b7579e67f91241e03c4febe60eb01093ed3336a0e44c2aa09bae
|
7
|
+
data.tar.gz: df19c602da175197d3f6b2797c1df4314dc63e9d4ee1e48609435ca2d46139028194b570fb05f842b6d4961ff182f6335019644e8f80dbb98c69c9a90b7b6244
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/polyrex-links.rb
CHANGED
@@ -6,10 +6,17 @@ require 'polyrex'
|
|
6
6
|
|
7
7
|
class PolyrexLinks < Polyrex
|
8
8
|
|
9
|
-
def initialize(
|
10
|
-
|
9
|
+
def initialize(rawx='links/link[name,url]', delimiter: ' # ', debug: false)
|
10
|
+
|
11
|
+
x, _ = RXFHelper.read(rawx)
|
12
|
+
obj = x.lstrip.sub(/<\?polyrex-links\?>/,
|
13
|
+
'<?polyrex schema="links/link[name,url]" delimiter=" # "?>')
|
14
|
+
puts 'obj: ' + x.inspect if debug
|
15
|
+
|
16
|
+
super(obj)
|
11
17
|
@delimiter = self.delimiter = delimiter
|
12
18
|
@debug = debug
|
19
|
+
|
13
20
|
end
|
14
21
|
|
15
22
|
def find(s)
|
@@ -19,12 +26,26 @@ class PolyrexLinks < Polyrex
|
|
19
26
|
if found then
|
20
27
|
|
21
28
|
path = backtrack_path found
|
22
|
-
[
|
29
|
+
[link(path.join('/')), path.join('/')]
|
23
30
|
|
24
31
|
end
|
25
32
|
|
26
33
|
end
|
27
34
|
|
35
|
+
def migrate(raws)
|
36
|
+
|
37
|
+
s, _ = RXFHelper.read(raws)
|
38
|
+
pl = PolyrexLinks.new("<?polyrex-links?>\n\n" + s.sub(/<\?[^\?]+\?>/,'').lstrip)
|
39
|
+
|
40
|
+
pl.each_recursive do |x|
|
41
|
+
link, linkpath = find(x.name)
|
42
|
+
x.url = link.url if link.url
|
43
|
+
end
|
44
|
+
|
45
|
+
pl
|
46
|
+
|
47
|
+
end
|
48
|
+
|
28
49
|
# Returns the Polyrex element for the given path
|
29
50
|
#
|
30
51
|
def link(s)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyrex-links
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
5x/50O2gHQvmLgSVk8EsWqPZ6B8tMZ9h/ttCIkW33ewCmHrrxH9suuyqbC/SaiEf
|
36
36
|
2qE86MpuEcgDiX59WiP5GiBx
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2021-05-
|
38
|
+
date: 2021-05-25 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: polyrex
|
@@ -43,22 +43,22 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '1.
|
46
|
+
version: '1.3'
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 1.2
|
49
|
+
version: 1.3.2
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '1.
|
56
|
+
version: '1.3'
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 1.2
|
59
|
+
version: 1.3.2
|
60
60
|
description:
|
61
|
-
email:
|
61
|
+
email: digital.robertson@gmail.com
|
62
62
|
executables: []
|
63
63
|
extensions: []
|
64
64
|
extra_rdoc_files: []
|
metadata.gz.sig
CHANGED
Binary file
|