mongoid_oslc 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongoid/oslc/{oslc_grammar.rb → grammar.rb} +1 -1
- data/lib/mongoid/oslc/{oslc_grammar.treetop → grammar.treetop} +9 -9
- data/lib/mongoid/oslc/strategy.rb +3 -3
- data/lib/mongoid/oslc/version.rb +4 -2
- data/lib/mongoid/oslc.rb +3 -0
- data/lib/mongoid_oslc.rb +1 -3
- data/mongoid_oslc.gemspec +3 -5
- metadata +28 -12
@@ -20,14 +20,14 @@
|
|
20
20
|
# string_esc ::= /* a string enclosed in double quotes, with certain characters escaped. See below. */
|
21
21
|
# LANGTAG ::= /* see "SPARQL Query Language for RDF", http://www.w3.org/TR/rdf-sparql-query/#rLANGTAG */
|
22
22
|
|
23
|
-
grammar
|
23
|
+
grammar Grammar
|
24
24
|
|
25
25
|
rule decision
|
26
26
|
binary_decision / simple_term
|
27
27
|
end
|
28
28
|
|
29
29
|
rule binary_decision
|
30
|
-
operand_1:simple_term space? boolean_op space? operand_2:decision <Mongoid::Oslc::
|
30
|
+
operand_1:simple_term space? boolean_op space? operand_2:decision <Mongoid::Oslc::Grammar::BinaryDecision>
|
31
31
|
end
|
32
32
|
|
33
33
|
rule simple_term
|
@@ -35,11 +35,11 @@ grammar OslcGrammar
|
|
35
35
|
end
|
36
36
|
|
37
37
|
rule term
|
38
|
-
field comparison_op value <Mongoid::Oslc::
|
38
|
+
field comparison_op value <Mongoid::Oslc::Grammar::Condition>
|
39
39
|
end
|
40
40
|
|
41
41
|
rule boolean_op
|
42
|
-
'and' <Mongoid::Oslc::
|
42
|
+
'and' <Mongoid::Oslc::Grammar::LogicalOperator>
|
43
43
|
end
|
44
44
|
|
45
45
|
rule space
|
@@ -47,11 +47,11 @@ grammar OslcGrammar
|
|
47
47
|
end
|
48
48
|
|
49
49
|
rule field
|
50
|
-
[\w\:]+ <Mongoid::Oslc::
|
50
|
+
[\w\:]+ <Mongoid::Oslc::Grammar::Field>
|
51
51
|
end
|
52
52
|
|
53
53
|
rule comparison_op
|
54
|
-
[\=\>\<\!] <Mongoid::Oslc::
|
54
|
+
[\=\>\<\!] <Mongoid::Oslc::Grammar::Operator>
|
55
55
|
end
|
56
56
|
|
57
57
|
rule value
|
@@ -59,7 +59,7 @@ grammar OslcGrammar
|
|
59
59
|
end
|
60
60
|
|
61
61
|
rule uri_ref_esc
|
62
|
-
[\w]+ <Mongoid::Oslc::
|
62
|
+
[\w]+ <Mongoid::Oslc::Grammar::UriRefEsc>
|
63
63
|
end
|
64
64
|
|
65
65
|
rule literal_value
|
@@ -67,7 +67,7 @@ grammar OslcGrammar
|
|
67
67
|
end
|
68
68
|
|
69
69
|
rule boolean
|
70
|
-
'true' <Mongoid::Oslc::
|
70
|
+
'true' <Mongoid::Oslc::Grammar::BooleanValue> / 'false' <Mongoid::Oslc::Grammar::BooleanValue>
|
71
71
|
end
|
72
72
|
|
73
73
|
rule decimal
|
@@ -75,6 +75,6 @@ grammar OslcGrammar
|
|
75
75
|
end
|
76
76
|
|
77
77
|
rule string_esc
|
78
|
-
'"' [^\"]* '"' <Mongoid::Oslc::
|
78
|
+
'"' [^\"]* '"' <Mongoid::Oslc::Grammar::StringEsc>
|
79
79
|
end
|
80
80
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'treetop'
|
2
|
-
require 'mongoid/oslc/
|
2
|
+
require 'mongoid/oslc/grammar'
|
3
3
|
|
4
4
|
module Mongoid
|
5
5
|
module Oslc
|
@@ -10,8 +10,8 @@ module Mongoid
|
|
10
10
|
options = { :verbose => true }
|
11
11
|
options.merge!(args.extract_options!)
|
12
12
|
|
13
|
-
Treetop.load File.join(File.dirname(__FILE__), "
|
14
|
-
@parser =
|
13
|
+
Treetop.load File.join(File.dirname(__FILE__), "grammar")
|
14
|
+
@parser = GrammarParser.new
|
15
15
|
|
16
16
|
tree = @parser.parse(query)
|
17
17
|
raise Search::QueryParsingError.new(query, @parser.index) if tree.nil?
|
data/lib/mongoid/oslc/version.rb
CHANGED
data/lib/mongoid/oslc.rb
CHANGED
data/lib/mongoid_oslc.rb
CHANGED
data/mongoid_oslc.gemspec
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'mongoid'
|
5
|
-
require 'mongoid/oslc/version'
|
2
|
+
require File.expand_path('../lib/mongoid/oslc/version', __FILE__)
|
6
3
|
|
7
4
|
Gem::Specification.new do |gem|
|
8
5
|
gem.name = "mongoid_oslc"
|
@@ -13,7 +10,8 @@ Gem::Specification.new do |gem|
|
|
13
10
|
gem.summary = ""
|
14
11
|
gem.homepage = ""
|
15
12
|
|
16
|
-
gem.add_runtime_dependency '
|
13
|
+
gem.add_runtime_dependency 'activesupport', '~> 3.0'
|
14
|
+
gem.add_runtime_dependency 'mongoid', '>= 3.0', '< 4.0'
|
17
15
|
gem.add_runtime_dependency 'treetop'
|
18
16
|
|
19
17
|
gem.add_development_dependency('rake', ['>= 0.9.2'])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid_oslc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,17 +9,14 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '4.0'
|
22
|
-
- - ! '>='
|
19
|
+
- - ~>
|
23
20
|
- !ruby/object:Gem::Version
|
24
21
|
version: '3.0'
|
25
22
|
type: :runtime
|
@@ -27,12 +24,31 @@ dependencies:
|
|
27
24
|
version_requirements: !ruby/object:Gem::Requirement
|
28
25
|
none: false
|
29
26
|
requirements:
|
30
|
-
- -
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: mongoid
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '3.0'
|
38
|
+
- - <
|
31
39
|
- !ruby/object:Gem::Version
|
32
40
|
version: '4.0'
|
41
|
+
type: :runtime
|
42
|
+
prerelease: false
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
33
46
|
- - ! '>='
|
34
47
|
- !ruby/object:Gem::Version
|
35
48
|
version: '3.0'
|
49
|
+
- - <
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '4.0'
|
36
52
|
- !ruby/object:Gem::Dependency
|
37
53
|
name: treetop
|
38
54
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,8 +110,8 @@ files:
|
|
94
110
|
- README.md
|
95
111
|
- Rakefile
|
96
112
|
- lib/mongoid/oslc.rb
|
97
|
-
- lib/mongoid/oslc/
|
98
|
-
- lib/mongoid/oslc/
|
113
|
+
- lib/mongoid/oslc/grammar.rb
|
114
|
+
- lib/mongoid/oslc/grammar.treetop
|
99
115
|
- lib/mongoid/oslc/strategy.rb
|
100
116
|
- lib/mongoid/oslc/version.rb
|
101
117
|
- lib/mongoid_oslc.rb
|
@@ -117,7 +133,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
133
|
version: '0'
|
118
134
|
segments:
|
119
135
|
- 0
|
120
|
-
hash:
|
136
|
+
hash: 4115431999775652418
|
121
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
138
|
none: false
|
123
139
|
requirements:
|
@@ -126,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
142
|
version: '0'
|
127
143
|
segments:
|
128
144
|
- 0
|
129
|
-
hash:
|
145
|
+
hash: 4115431999775652418
|
130
146
|
requirements: []
|
131
147
|
rubyforge_project:
|
132
148
|
rubygems_version: 1.8.24
|