predicate 2.3.2 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/predicate.rb +4 -0
- data/lib/predicate/nodes/expr.rb +4 -0
- data/lib/predicate/processors.rb +1 -0
- data/lib/predicate/processors/unqualifier.rb +17 -0
- data/lib/predicate/version.rb +1 -1
- data/spec/predicate/test_unqualify.rb +18 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6adb8570080165285172882eb0c0f8216180efa05a58df348055f9a406fcef24
|
4
|
+
data.tar.gz: 3add1e5ed2a4d728fb92637c8527b8dfeaa2b66f16622a45608aca1d9f079774
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8967a78cd1bbee2b0e2666f0fe853743d98c5be4730c3d263ce30d541387b71de37ac1d3e9544d487c92782795fcdeeb116099b741a362b60390b35aa2834e6a
|
7
|
+
data.tar.gz: ed564310b25c229a65824e06d6b37353d326a1dd56b00a6723ad669c4321fa2d4e50d660d5c02b66efbaef695a2063504602e9466c7908b0ebf681943dc28571
|
data/lib/predicate.rb
CHANGED
data/lib/predicate/nodes/expr.rb
CHANGED
data/lib/predicate/processors.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
class Predicate
|
2
|
+
class Unqualifier < Sexpr::Rewriter
|
3
|
+
|
4
|
+
grammar Grammar
|
5
|
+
|
6
|
+
def on_qualified_identifier(sexpr)
|
7
|
+
[ :identifier, sexpr.last ]
|
8
|
+
end
|
9
|
+
|
10
|
+
def on_native(sexpr)
|
11
|
+
raise NotSupportedError
|
12
|
+
end
|
13
|
+
|
14
|
+
alias :on_missing :copy_and_apply
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
data/lib/predicate/version.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
class Predicate
|
3
|
+
describe Predicate, "unqualify" do
|
4
|
+
|
5
|
+
let(:p){ Predicate }
|
6
|
+
|
7
|
+
subject{ predicate.unqualify }
|
8
|
+
|
9
|
+
context 'when the predicate is not qualified' do
|
10
|
+
let(:predicate){ p.in(:x, [2]) & p.eq(:y, :z) }
|
11
|
+
|
12
|
+
it 'works as expected' do
|
13
|
+
expect(subject).to eql(predicate)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: predicate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/predicate/processors/qualifier.rb
|
123
123
|
- lib/predicate/processors/renamer.rb
|
124
124
|
- lib/predicate/processors/to_s.rb
|
125
|
+
- lib/predicate/processors/unqualifier.rb
|
125
126
|
- lib/predicate/sequel.rb
|
126
127
|
- lib/predicate/sequel/to_sequel.rb
|
127
128
|
- lib/predicate/version.rb
|
@@ -182,6 +183,7 @@ files:
|
|
182
183
|
- spec/predicate/test_qualify.rb
|
183
184
|
- spec/predicate/test_rename.rb
|
184
185
|
- spec/predicate/test_tautology.rb
|
186
|
+
- spec/predicate/test_unqualify.rb
|
185
187
|
- spec/sequel/test_to_sequel.rb
|
186
188
|
- spec/spec_helper.rb
|
187
189
|
- spec/test_predicate.rb
|