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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec6a883f3e9cd0e24504c0892a82a94dbf5eda8b
4
- data.tar.gz: 97a7fdb671c26f124900a21bfa6ea89f822ac16c
3
+ metadata.gz: 805a24d10ff12f7104375b217c8f1fe8af186f6c
4
+ data.tar.gz: 0a2ecebf02d98048ec6af1f3d74a771a72c06c2b
5
5
  SHA512:
6
- metadata.gz: ca6e77d81b5968c20b1da74d23c7ffd4d090051f629fdfab1958fe69edbe68798c033d01ddcc00ee8ecb93281f67d53b6985164e72f107ea8eb8abe985e87aa8
7
- data.tar.gz: ff5af7a01cb2d3c6f620b7ffd61a3b80474714b83f6dd2280df68a5e317cf2588e7b31ac89be5e57c7ddb6f82b1f440a3a1b9fbd170ef5c8761d42ab0116faf7
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
- phrases_found = a2.values.flatten(1)
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.0
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-26 00:00:00.000000000 Z
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