pxindex 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/pxindex.rb +25 -16
- data.tar.gz.sig +1 -1
- metadata +6 -6
- 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: 77bf21e2e1c1408b7b120bf424115534d620bf43
|
4
|
+
data.tar.gz: 157ae6bd91e88fca8ce19df89c14759518836569
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bee12c0ac40b5443f8d07773ac3847a326942f1bb0b98bfcdf54702ebfaf53525e75d4a577fb9a76086fc31b8ece75726dade735764c12202ececb42fe22a1e8
|
7
|
+
data.tar.gz: 6032bf8b5efc45f4f54f1dabe941bf0640377a48db68473e13345be7f869ab20f56e7276bf86e8c9a3d03e3846110a7a4b71f5179364d0a59cb7fd13f5089e28
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/pxindex.rb
CHANGED
@@ -7,8 +7,7 @@ require 'polyrex-headings'
|
|
7
7
|
|
8
8
|
class PxIndex
|
9
9
|
|
10
|
-
|
11
|
-
def initialize(raw_s)
|
10
|
+
def initialize(raw_s, debug: false)
|
12
11
|
|
13
12
|
s, _ = RXFHelper.read raw_s
|
14
13
|
|
@@ -16,18 +15,33 @@ class PxIndex
|
|
16
15
|
@rs = @px.records
|
17
16
|
|
18
17
|
@s = ''
|
18
|
+
@a = []
|
19
|
+
@debug = debug
|
19
20
|
|
20
21
|
end
|
22
|
+
|
23
|
+
def parent()
|
24
|
+
@rs.first
|
25
|
+
end
|
21
26
|
|
22
27
|
def q?(s)
|
23
|
-
|
24
|
-
|
28
|
+
|
29
|
+
return @a.last if s == @s
|
30
|
+
puts '@s : ' + @s.inspect if @debug
|
31
|
+
puts 's: ' + s.inspect if @debug
|
32
|
+
|
33
|
+
# @s is used to store the previous string input to compare it with
|
34
|
+
# the new string input
|
35
|
+
|
36
|
+
if (s.length - @s.length).abs >= 1 or s[0..-2] != @s then
|
37
|
+
|
38
|
+
@s = s
|
25
39
|
|
26
40
|
@rs = @px.records
|
27
41
|
|
28
42
|
s2 = ''
|
29
43
|
|
30
|
-
a = s.chars.map do |x|
|
44
|
+
@a = s.chars.map do |x|
|
31
45
|
|
32
46
|
s2 += x
|
33
47
|
found = search_records(s2, @rs)
|
@@ -36,19 +50,13 @@ class PxIndex
|
|
36
50
|
found
|
37
51
|
|
38
52
|
end
|
39
|
-
|
40
|
-
return a ? a.last : nil
|
53
|
+
|
54
|
+
return @a ? @a.last : nil
|
41
55
|
|
42
56
|
end
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
records = search_records(s, @rs)
|
47
|
-
|
48
|
-
@s = s
|
49
|
-
|
50
|
-
return records
|
51
|
-
|
57
|
+
|
58
|
+
return []
|
59
|
+
|
52
60
|
end
|
53
61
|
|
54
62
|
alias query q?
|
@@ -58,6 +66,7 @@ class PxIndex
|
|
58
66
|
|
59
67
|
def search_records(raw_s, rs=@rs)
|
60
68
|
|
69
|
+
puts 'raw_s : ' + raw_s.inspect if @debug
|
61
70
|
|
62
71
|
if raw_s[-1] == ' ' then
|
63
72
|
|
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
~�b��S.�@c�ܿ�EH̹�/+,)K5�.����kܤuV�*��=c�2he�Hn��Ҹ��U �������l�7��dnJ1p(��볛�*Ct���no��`�*�oT��@�P�����u9������1���`q������p�� |�Y��n����E�-`a X�z�eQA��D��Ն�K/��)y��|���q<���mBq�y�Q��M�z��4x<�<@y�7%U�7;I�H����ښ�L!�{
|
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.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
MrilunBr0ny9pMGbDRKeTfgMh9LinxPgD3BjXqZ78prB3LDxWO8kA/yDt5sLGSiq
|
32
32
|
n8uRSvQvGormuQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2017-10-09 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: polyrex-headings
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
version: '0.1'
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.1.
|
45
|
+
version: 0.1.9
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,9 +52,9 @@ dependencies:
|
|
52
52
|
version: '0.1'
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.1.
|
55
|
+
version: 0.1.9
|
56
56
|
description:
|
57
|
-
email: james@
|
57
|
+
email: james@jamesrobertson.eu
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.6.13
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Experimental gem to facilitate a keyword search, by querying a Polyrex document
|
metadata.gz.sig
CHANGED
Binary file
|