md_edit 0.1.1 → 0.1.2
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/md_edit.rb +6 -6
- metadata +1 -1
- 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: 319a2c623cba863422eab20d2ae4f87b786a41b3
|
4
|
+
data.tar.gz: 1e7522748700c17ef0cb3edca9ba081a3f0cb6fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d25a3fbceed14648e90a50dab0c176f8718d9701333026ac9c0023072de95766880865ea67500abd51c491e7b0e039cd39894577b74cb559e022f52348f7f865
|
7
|
+
data.tar.gz: 6fdc5e5b379b444b9191cd0d543ca3152218999cd8f7c3c02a10702689b231e4c66bcbaef6bb99f324b7cd66e1d14b209d63ec2c85ace96bc44f05e4c2d46a09
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/md_edit.rb
CHANGED
@@ -17,18 +17,18 @@ class MdEdit
|
|
17
17
|
|
18
18
|
parse s
|
19
19
|
|
20
|
-
h = @
|
20
|
+
@h = @sections.keys.inject({}) do |r,x|
|
21
21
|
r.merge(x.sub(/^#+ +/,'').downcase => 5 - x.count('#'))
|
22
22
|
end
|
23
23
|
|
24
|
-
@pl = PhraseLookup.new h
|
24
|
+
@pl = PhraseLookup.new @h
|
25
25
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
def find(s)
|
30
|
-
key = @
|
31
|
-
[key, @
|
30
|
+
key = @sections.keys.grep(/#{s.downcase}/i).first
|
31
|
+
[key, @sections[key]]
|
32
32
|
end
|
33
33
|
|
34
34
|
def query(s)
|
@@ -62,7 +62,7 @@ class MdEdit
|
|
62
62
|
h = {}
|
63
63
|
|
64
64
|
a4 = scan a3, h
|
65
|
-
@
|
65
|
+
@sections = h
|
66
66
|
|
67
67
|
end
|
68
68
|
|
@@ -85,4 +85,4 @@ class MdEdit
|
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
|
-
end
|
88
|
+
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|