md_edit 0.2.0 → 0.2.1
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/lib/md_edit.rb +18 -1
- 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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 805a24d10ff12f7104375b217c8f1fe8af186f6c
|
4
|
+
data.tar.gz: 0a2ecebf02d98048ec6af1f3d74a771a72c06c2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51f798f78809cff32dd923b2e07f0f30d2a09111e692b22ac949d80a2ce1540d6fde129e69d92b232b26b740cc072ed1e17ae6bfec65db242af233d823debd75
|
7
|
+
data.tar.gz: b240a8a670771f7083dbfa59fc9b3da2da55f33b5a128a2a7c5fcbc22b93f3aed54165c36088c54f6f467d3baa42eb8b5af2743eeaee2f0d424cc8b18ce152a7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/md_edit.rb
CHANGED
@@ -159,7 +159,19 @@ class MdEdit
|
|
159
159
|
end
|
160
160
|
|
161
161
|
if a2 then
|
162
|
-
|
162
|
+
|
163
|
+
phrases_found = a2.values.flatten(1).map do |x|
|
164
|
+
|
165
|
+
raw_heading, phrase = x.split(/\]\s+/,2)
|
166
|
+
|
167
|
+
if raw_heading =~ / > / then
|
168
|
+
heading = raw_heading[/(?<=\[)[^\]]+/].split(' > ')[1..-1].join(' > ')
|
169
|
+
"[%s] %s" % [heading, phrase]
|
170
|
+
else
|
171
|
+
x
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
163
175
|
results.concat phrases_found if phrases_found
|
164
176
|
end
|
165
177
|
|
@@ -176,6 +188,10 @@ class MdEdit
|
|
176
188
|
bullets ? a.map{|x| x.sub(/\b/,'- ')} : a.join
|
177
189
|
|
178
190
|
end
|
191
|
+
|
192
|
+
def to_h()
|
193
|
+
@h
|
194
|
+
end
|
179
195
|
|
180
196
|
def to_s()
|
181
197
|
@s
|
@@ -249,6 +265,7 @@ class MdEdit
|
|
249
265
|
end
|
250
266
|
|
251
267
|
@headingslookup = PhraseLookup.new h
|
268
|
+
@h = h.to_a.map {|k,v| [k.split(' > ').last, v]}.to_h
|
252
269
|
@s = s
|
253
270
|
|
254
271
|
phrases = @sections.flat_map do |heading, raw_value|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: md_edit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
R5r1JjTBaaHOaqI14bIkwUSY5q1cO4Wl7HWly80kX2AD8o/tPHvyF9Tx3pBvaboU
|
32
32
|
etnSPHbQwmBvFQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-12-
|
34
|
+
date: 2017-12-27 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: line-tree
|
metadata.gz.sig
CHANGED
Binary file
|