wongi-engine 0.0.9 → 0.0.10
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
- data/README.md +4 -0
- data/lib/wongi-engine/beta/beta_node.rb +0 -1
- data/lib/wongi-engine/template.rb +5 -0
- data/lib/wongi-engine/version.rb +1 -1
- data/spec/filter_specs/less_test_spec.rb +41 -0
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9121794caa930fa1efd4e9cd0e099bab35f73b2d
|
4
|
+
data.tar.gz: e6c628f83a408993367941977f1b6452db903b76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6a18165e16edfdb48b7d74d7e90f82ce58a571d351ed95ee2983cf07767c1bbb02b9873b376f8759af9fd06f79c7498b20a307a943653e50d750ba6594e22cc
|
7
|
+
data.tar.gz: 22f63a10e4ab649182bbbd9311c3466fc4e7af3405c571f6f8c25997d415f1bd816ee3e381aaff1040894405e4ae66b175bbf19557801e3bc832f8c9680ce141
|
data/README.md
CHANGED
@@ -448,6 +448,10 @@ The Rete implementation in this library largely follows the outline presented in
|
|
448
448
|
|
449
449
|
## Changelog
|
450
450
|
|
451
|
+
### 0.0.10
|
452
|
+
|
453
|
+
* fixed interaction of filters and optional nodes
|
454
|
+
|
451
455
|
### 0.0.9
|
452
456
|
|
453
457
|
* fixed the definition of `asserted` (#16)
|
@@ -93,6 +93,9 @@ module Wongi::Engine
|
|
93
93
|
end
|
94
94
|
|
95
95
|
class NegTemplate < Template
|
96
|
+
|
97
|
+
undef_method :filters
|
98
|
+
|
96
99
|
# :arg: context => Wongi::Rete::BetaNode::CompilationContext
|
97
100
|
def compile context
|
98
101
|
tests, assignment = *JoinNode.compile( self, context.earlier, context.parameters )
|
@@ -107,6 +110,8 @@ module Wongi::Engine
|
|
107
110
|
|
108
111
|
class OptionalTemplate < Template
|
109
112
|
|
113
|
+
undef_method :filters
|
114
|
+
|
110
115
|
def compile context
|
111
116
|
tests, assignment = *JoinNode.compile( self, context.earlier, context.parameters )
|
112
117
|
alpha = context.rete.compile_alpha( self )
|
data/lib/wongi-engine/version.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "LESS test" do
|
4
|
+
|
5
|
+
before :each do
|
6
|
+
@engine = Wongi::Engine.create
|
7
|
+
end
|
8
|
+
|
9
|
+
def engine
|
10
|
+
@engine
|
11
|
+
end
|
12
|
+
|
13
|
+
def production
|
14
|
+
@production
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_rule &block
|
18
|
+
@production = ( engine << rule( 'test-rule', &block ) )
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should interact with optional node correctly" do
|
22
|
+
|
23
|
+
# before the fix, filters would try to piggy-back on optional templates
|
24
|
+
|
25
|
+
test_rule {
|
26
|
+
forall {
|
27
|
+
maybe "Z", "Z", "Z"
|
28
|
+
less 6,4 # this should fail
|
29
|
+
}
|
30
|
+
|
31
|
+
make {
|
32
|
+
gen ".", ".", "."
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
engine << ["A", "B", "C"]
|
37
|
+
expect( production ).to have(0).tokens
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wongi-engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Valeri Sokolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A rule engine.
|
14
14
|
email:
|
@@ -17,7 +17,7 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- .gitignore
|
20
|
+
- ".gitignore"
|
21
21
|
- Gemfile
|
22
22
|
- LICENSE
|
23
23
|
- README.md
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- spec/dataset_spec.rb
|
83
83
|
- spec/dsl_spec.rb
|
84
84
|
- spec/filter_specs/assert_test_spec.rb
|
85
|
+
- spec/filter_specs/less_test_spec.rb
|
85
86
|
- spec/high_level_spec.rb
|
86
87
|
- spec/rule_specs/any_rule_spec.rb
|
87
88
|
- spec/rule_specs/assign_spec.rb
|
@@ -102,12 +103,12 @@ require_paths:
|
|
102
103
|
- lib
|
103
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
104
105
|
requirements:
|
105
|
-
- -
|
106
|
+
- - ">="
|
106
107
|
- !ruby/object:Gem::Version
|
107
108
|
version: '0'
|
108
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
110
|
requirements:
|
110
|
-
- -
|
111
|
+
- - ">="
|
111
112
|
- !ruby/object:Gem::Version
|
112
113
|
version: '0'
|
113
114
|
requirements: []
|
@@ -121,6 +122,7 @@ test_files:
|
|
121
122
|
- spec/dataset_spec.rb
|
122
123
|
- spec/dsl_spec.rb
|
123
124
|
- spec/filter_specs/assert_test_spec.rb
|
125
|
+
- spec/filter_specs/less_test_spec.rb
|
124
126
|
- spec/high_level_spec.rb
|
125
127
|
- spec/rule_specs/any_rule_spec.rb
|
126
128
|
- spec/rule_specs/assign_spec.rb
|