pxindex 0.1.2 → 0.1.3

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: 77bf21e2e1c1408b7b120bf424115534d620bf43
4
- data.tar.gz: 157ae6bd91e88fca8ce19df89c14759518836569
3
+ metadata.gz: 2aa3e5764464ae67bc1b996f5e0ff3a4ddbd3b3d
4
+ data.tar.gz: 707ac50a50cc25440756584b4f4545d770aefce9
5
5
  SHA512:
6
- metadata.gz: bee12c0ac40b5443f8d07773ac3847a326942f1bb0b98bfcdf54702ebfaf53525e75d4a577fb9a76086fc31b8ece75726dade735764c12202ececb42fe22a1e8
7
- data.tar.gz: 6032bf8b5efc45f4f54f1dabe941bf0640377a48db68473e13345be7f869ab20f56e7276bf86e8c9a3d03e3846110a7a4b71f5179364d0a59cb7fd13f5089e28
6
+ metadata.gz: 4ed1a8d641e7e16a92acb43eed49fae7ecbdb3cf7504c0386f03c6623d6ba2124e72ed3229535b8e7e66ae5855a28a9c079d415c370e728b61e710e5819b5643
7
+ data.tar.gz: 47c4b3e7dd048dd292fc3c6b459da025501dfe270616195221000da104f4577e7460d4b7d570993a6b214dfcaa622fc01b599da34c6e1d32a433f37c8d78bd7f
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -10,8 +10,20 @@ class PxIndex
10
10
  def initialize(raw_s, debug: false)
11
11
 
12
12
  s, _ = RXFHelper.read raw_s
13
+
14
+ lines = s.lines
15
+
16
+ header = []
17
+ header << lines.shift until lines[0].strip.empty?
18
+
19
+ a = LineTree.new(lines.join.gsub(/^# [a-z]\n/,'')).to_a
20
+ a2 = a.group_by {|x| x.first[0] }.to_a
21
+
22
+ s2 = a2.map {|x| '# ' + x[0] + "\n\n" + treeize(x[-1]) }.join("\n\n")
23
+
24
+ @raw_px = header.join + "\n" + s2
13
25
 
14
- @px = PolyrexHeadings.new(s).to_polyrex
26
+ @px = PolyrexHeadings.new(@raw_px).to_polyrex
15
27
  @rs = @px.records
16
28
 
17
29
  @s = ''
@@ -61,6 +73,9 @@ class PxIndex
61
73
 
62
74
  alias query q?
63
75
 
76
+ def to_s()
77
+ @raw_px
78
+ end
64
79
 
65
80
  private
66
81
 
@@ -86,6 +101,13 @@ class PxIndex
86
101
 
87
102
  a = rs.select {|x| x.title[0..s.length-1] == s}
88
103
 
104
+ if @debug then
105
+ puts 'a: ' + a.inspect
106
+ if a.any? then
107
+ puts 'a.map ' + a.map(&:title).inspect
108
+ end
109
+ end
110
+
89
111
  if s.length == 1 and a.any? and keywords.length < 2 then
90
112
  a = a.first.records
91
113
  end
@@ -114,5 +136,18 @@ class PxIndex
114
136
  end
115
137
 
116
138
  end
139
+
140
+ def treeize(obj, indent=-2)
141
+
142
+ if obj.is_a? Array then
143
+
144
+ obj.map {|x| treeize(x, indent+1)}.join("\n")
145
+
146
+ else
147
+
148
+ ' ' * indent + obj
149
+
150
+ end
151
+ end
117
152
 
118
- end
153
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pxindex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,28 +10,27 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
- YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTE2MTEzMDE4NDAwMVoXDTE3MTEzMDE4NDAwMVowSDESMBAG
16
- A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
- EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
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QFl3++eDh82JS/2nqL
30
+ IIkRAfg3vUhmtNQu26Gsi9aZcJAGPKIjdRuYc9oyiGpJv0cQ02HBGRUXnoKS7XYT
31
+ QDc=
33
32
  -----END CERTIFICATE-----
34
- date: 2017-10-09 00:00:00.000000000 Z
33
+ date: 2018-03-14 00:00:00.000000000 Z
35
34
  dependencies:
36
35
  - !ruby/object:Gem::Dependency
37
36
  name: polyrex-headings
metadata.gz.sig CHANGED
Binary file