lucene_query_parser 0.0.1 → 0.0.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 +7 -0
- data/Gemfile +1 -1
- data/LICENSE +21 -0
- data/bin/check_lucene_query +1 -1
- data/lib/lucene_query_parser/parser.rb +1 -16
- data/lib/lucene_query_parser/version.rb +1 -1
- data/lucene_query_parser.gemspec +2 -1
- data/spec/spec_helper.rb +2 -0
- metadata +61 -80
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1a501530144bf2af7bb77539b83c911e9c4a2498
|
4
|
+
data.tar.gz: 6beadc35fead5d80208c26a7589d2fe77e0a656b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 53f63d5c25ba64a3f92f714d014e8307a500c5ba0a45c499fb47ae087eb8b36caa76670a246c2466037b0fc77887d08393b0bbd4c32ede626536eaac8d2bdebd
|
7
|
+
data.tar.gz: 496ee21e3f36e4f6413f18c1326eb95b697c3cccff30a1c5c0d80816bb5005c95a85c0db6719d870bc48ef488c7b41e5c220c43a375b8ff5558ed0c557965ad9
|
data/Gemfile
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2011 Nathan Witmer
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/bin/check_lucene_query
CHANGED
@@ -11,26 +11,11 @@ module LuceneQueryParser
|
|
11
11
|
parse query
|
12
12
|
nil
|
13
13
|
rescue Parslet::ParseFailed => error
|
14
|
-
cause =
|
14
|
+
cause = error.cause.ascii_tree
|
15
15
|
cause =~ /line (\d+) char (\d+)/
|
16
16
|
{:line => $1.to_i, :column => $2.to_i, :message => cause}
|
17
17
|
end
|
18
18
|
|
19
|
-
# Recursively find a "real" cause within a Parslet error tree. "Real"
|
20
|
-
# causes contain line/column positions.
|
21
|
-
def find_cause(node)
|
22
|
-
if node.parslet.cause
|
23
|
-
node.cause
|
24
|
-
else
|
25
|
-
# go in reverse to find the last thing that failed rather than the first
|
26
|
-
node.children.reverse.each do |child|
|
27
|
-
if cause = find_cause(child)
|
28
|
-
return cause
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
19
|
# ----- grammar definition -----
|
35
20
|
|
36
21
|
root :expr
|
data/lucene_query_parser.gemspec
CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = "https://github.com/aniero/lucene_query_parser"
|
11
11
|
s.summary = %q{Lucene query parser and syntax checker}
|
12
12
|
s.description = %q{Parser class and syntax checking script for validating Lucene queries}
|
13
|
+
s.licenses = ["MIT"]
|
13
14
|
|
14
15
|
s.rubyforge_project = "lucene_query_parser"
|
15
16
|
|
@@ -20,5 +21,5 @@ Gem::Specification.new do |s|
|
|
20
21
|
|
21
22
|
s.add_runtime_dependency "parslet"
|
22
23
|
s.add_runtime_dependency "rainbow"
|
23
|
-
s.add_development_dependency "rspec", "~> 2.
|
24
|
+
s.add_development_dependency "rspec", "~> 3.2.0"
|
24
25
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,80 +1,70 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: lucene_query_parser
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 1
|
10
|
-
version: 0.0.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Nathan Witmer
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2015-02-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: parslet
|
22
|
-
|
23
|
-
|
24
|
-
none: false
|
25
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
26
17
|
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
32
20
|
type: :runtime
|
33
|
-
version_requirements: *id001
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: rainbow
|
36
21
|
prerelease: false
|
37
|
-
|
38
|
-
|
39
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rainbow
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
40
31
|
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
version: "0"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
46
34
|
type: :runtime
|
47
|
-
version_requirements: *id002
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: rspec
|
50
35
|
prerelease: false
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.2.0
|
62
48
|
type: :development
|
63
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.2.0
|
64
55
|
description: Parser class and syntax checking script for validating Lucene queries
|
65
|
-
email:
|
56
|
+
email:
|
66
57
|
- nwitmer@gmail.com
|
67
|
-
executables:
|
58
|
+
executables:
|
68
59
|
- check_lucene_query
|
69
60
|
extensions: []
|
70
|
-
|
71
61
|
extra_rdoc_files: []
|
72
|
-
|
73
|
-
|
74
|
-
- .
|
75
|
-
- .rspec
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".rspec"
|
76
65
|
- Gemfile
|
77
66
|
- Guardfile
|
67
|
+
- LICENSE
|
78
68
|
- README.md
|
79
69
|
- Rakefile
|
80
70
|
- bin/check_lucene_query
|
@@ -85,38 +75,29 @@ files:
|
|
85
75
|
- spec/lucene_query_parser/parser_spec.rb
|
86
76
|
- spec/spec_helper.rb
|
87
77
|
homepage: https://github.com/aniero/lucene_query_parser
|
88
|
-
licenses:
|
89
|
-
|
78
|
+
licenses:
|
79
|
+
- MIT
|
80
|
+
metadata: {}
|
90
81
|
post_install_message:
|
91
82
|
rdoc_options: []
|
92
|
-
|
93
|
-
require_paths:
|
83
|
+
require_paths:
|
94
84
|
- lib
|
95
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
-
|
97
|
-
requirements:
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
98
87
|
- - ">="
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
version: "0"
|
104
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
|
-
requirements:
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
107
92
|
- - ">="
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
segments:
|
111
|
-
- 0
|
112
|
-
version: "0"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
113
95
|
requirements: []
|
114
|
-
|
115
96
|
rubyforge_project: lucene_query_parser
|
116
|
-
rubygems_version:
|
97
|
+
rubygems_version: 2.2.2
|
117
98
|
signing_key:
|
118
|
-
specification_version:
|
99
|
+
specification_version: 4
|
119
100
|
summary: Lucene query parser and syntax checker
|
120
|
-
test_files:
|
101
|
+
test_files:
|
121
102
|
- spec/lucene_query_parser/parser_spec.rb
|
122
103
|
- spec/spec_helper.rb
|