polyrex-headings 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -1
- data/lib/polyrex-headings.rb +42 -3
- metadata +36 -33
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9ef8d622cae6b8fecd69ecf653ac5ab0682c178e94808d37749ed2a263f3f534
|
4
|
+
data.tar.gz: 8927856088316195c6c83a36ad0011dda78472cd91ee8c9020fcd8804eecbbdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3492407b37ea880d038fdb4f1bfae0de1c80b221b532d8058678f309b773f241ab697dd2ad92c4f6e31567a8a25889dad0b9e78032015de9268288fab7f616f1
|
7
|
+
data.tar.gz: 2cb84eace798bb211c5a7bb1350c5292f9a694ff5db352a4169fa1116a6451493e38d896ac2c7762ccbe3f0b840eda562f371c31a76c96f0b0f04eb703d71967
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
�Q
|
1
|
+
�f���Q�����J����7�8�]*S��
|
2
|
+
/t�jϦ�C5��;O-64*U{`]��>���)of�u��������^E�
|
data/lib/polyrex-headings.rb
CHANGED
@@ -11,8 +11,9 @@ class PolyrexHeadings
|
|
11
11
|
|
12
12
|
attr_reader :to_polyrex, :to_px, :to_s
|
13
13
|
|
14
|
-
def initialize(raw_s)
|
14
|
+
def initialize(raw_s, debug: false)
|
15
15
|
|
16
|
+
@debug = debug
|
16
17
|
buffer, type = RXFHelper.read(raw_s)
|
17
18
|
|
18
19
|
if type == :unknown and buffer.lines.length <= 1 then
|
@@ -83,11 +84,49 @@ class PolyrexHeadings
|
|
83
84
|
|
84
85
|
px.parse(string, delimiter: ' # ')
|
85
86
|
|
86
|
-
@to_polyrex = @to_px = px
|
87
|
+
@to_polyrex = @to_px = @px = px
|
87
88
|
|
88
89
|
end
|
89
|
-
|
90
|
+
|
91
|
+
def to_h(symbolise: true)
|
92
|
+
build(@px.records, symbolise)
|
93
|
+
end
|
94
|
+
|
90
95
|
private
|
96
|
+
|
97
|
+
def build(records, symbolise)
|
98
|
+
|
99
|
+
a = records.map do |record|
|
100
|
+
|
101
|
+
if @debug then
|
102
|
+
puts 'record.records: ' + record.records.inspect
|
103
|
+
puts 'record.x: ' + record.x.inspect
|
104
|
+
end
|
105
|
+
|
106
|
+
if record.records.any? then
|
107
|
+
|
108
|
+
key = symbolise ? record.x.downcase.to_sym : record.x
|
109
|
+
{key => build(record.records, symbolise)}
|
110
|
+
|
111
|
+
elsif record.x =~ /^[^:]+:\s/ then
|
112
|
+
raw_key, value = record.x.split(/:\s+/,2)
|
113
|
+
key = symbolise ? raw_key.downcase.to_sym : raw_key
|
114
|
+
{key => value}
|
115
|
+
|
116
|
+
else
|
117
|
+
|
118
|
+
record.x
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
puts 'a.first: ' + a.first.inspect if @debug
|
125
|
+
return a.inject({}) {|r,x| r.merge!(x)} if a.first.is_a? Hash
|
126
|
+
|
127
|
+
a
|
128
|
+
|
129
|
+
end
|
91
130
|
|
92
131
|
def indent(n)
|
93
132
|
' ' * (n)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyrex-headings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,49 +10,53 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-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AwIEsDAdBgNVHQ4EFgQU/LlgwlyS
|
26
|
+
SGSlc1MBh7HNQcjk71kwJgYDVR0RBB8wHYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0
|
27
|
+
c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1hc3RlckBqYW1lc3JvYmVydHNvbi5ldTAN
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEAZk/rCYEHUPiWSMoBG97y7zBoBByXMNWNLYGwe3w/
|
29
|
+
nzw+6otk7cgQ/3miwzE2Dfz0+Y/q+ObYuDzyMbhEYZvGBHVURp+M7oRH8df8Fery
|
30
|
+
zRu1tauewT6f30qXDanh1uQfNqA1WRsal+oifghbEBqhsBcoR5XscjdvIF8vX7Kn
|
31
|
+
OEkvJhRm0Wh9PtBhpcHup3BTJxi6FrKa9M2qRewKMDNyHzxZS1N1fwL//+yShXDj
|
32
|
+
IugkkDXAckDU9LRxtGvWs/fodIj+pSO1GmfM+vtWo21bXf3oXLPi3eAGxhCTaS+A
|
33
|
+
uFMwJXcd/3uGvIyAGjSIFaTVD0J9HtRv445DJDN/00fzvObt2L7U0Fu1XPE3fonF
|
34
|
+
uzY8t3bjEky2p6KPiXZoFK8fBaQFK9xGSkEQKBOmCldaVNACqXCbL8tT43voC3Xb
|
35
|
+
7q9m2HtS5F1VPGfES14HGW+RIHF+0IMR3k71aKfUEh0UzApGI6C8+ekwjI+Itciy
|
36
|
+
K8EgeCN0vTCVx/759i3K6q22
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
38
|
+
date: 2020-01-01 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
41
|
name: polyrex
|
38
42
|
requirement: !ruby/object:Gem::Requirement
|
39
43
|
requirements:
|
40
|
-
- - "~>"
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '1.1'
|
43
44
|
- - ">="
|
44
45
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.
|
46
|
+
version: 1.3.0
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.3'
|
46
50
|
type: :runtime
|
47
51
|
prerelease: false
|
48
52
|
version_requirements: !ruby/object:Gem::Requirement
|
49
53
|
requirements:
|
50
|
-
- - "~>"
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: '1.1'
|
53
54
|
- - ">="
|
54
55
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.
|
56
|
+
version: 1.3.0
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '1.3'
|
56
60
|
description:
|
57
61
|
email: james@jamesrobertson.eu
|
58
62
|
executables: []
|
@@ -72,15 +76,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
76
|
requirements:
|
73
77
|
- - ">="
|
74
78
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.
|
79
|
+
version: 2.3.0
|
76
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
81
|
requirements:
|
78
82
|
- - ">="
|
79
83
|
- !ruby/object:Gem::Version
|
80
84
|
version: '0'
|
81
85
|
requirements: []
|
82
|
-
|
83
|
-
rubygems_version: 2.6.8
|
86
|
+
rubygems_version: 3.0.3
|
84
87
|
signing_key:
|
85
88
|
specification_version: 4
|
86
89
|
summary: Parses a raw Polyrex document containing Markdown style headings
|
metadata.gz.sig
CHANGED
Binary file
|