bmg 0.16.0.pre.rc2 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/bmg.rb +1 -0
- data/lib/bmg/support/keys.rb +6 -0
- data/lib/bmg/type.rb +7 -2
- data/lib/bmg/version.rb +1 -1
- metadata +5 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 81ed4175114b231d4909a01a4d25a82957ca523a65feedb3c556f96067209d53
|
4
|
+
data.tar.gz: e1c5f0179ca55a39515526c05a06560d8d1a0827c9829b0ad47087b3ad353af1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 964d0b754e3834b48c8fc1741fb74e4bf7f78b6d3efc4360e07b1d08d4178b6f13b10de4e23bda7f6a664aa757973094499da837b8aeeffc3b8368a2dce2dd6f
|
7
|
+
data.tar.gz: 7ae281e7f4141ce1960bdec92d1a126b7ee36310a150565d9a587bbabd1dfd3731a5058a822748bbb70c892828947a69e6fc6b7e3e81604198904a062759adb3
|
data/lib/bmg.rb
CHANGED
data/lib/bmg/support/keys.rb
CHANGED
@@ -52,6 +52,12 @@ module Bmg
|
|
52
52
|
Keys.new(keys, false)
|
53
53
|
end
|
54
54
|
|
55
|
+
def restrict(oldtype, newtype, predicate)
|
56
|
+
return self if (cs = predicate.constant_variables).empty?
|
57
|
+
keys = @keys.map{|k| k - cs }
|
58
|
+
Keys.new(keys, false)
|
59
|
+
end
|
60
|
+
|
55
61
|
def union(oldtype, newtype, right_type)
|
56
62
|
return nil unless rkeys = right_type.keys
|
57
63
|
return nil unless (oldtype.predicate & right_type.predicate).contradiction?
|
data/lib/bmg/type.rb
CHANGED
@@ -204,9 +204,14 @@ module Bmg
|
|
204
204
|
known_attributes!(renaming.keys)
|
205
205
|
unknown_attributes!(renaming.values)
|
206
206
|
end
|
207
|
+
new_pred = begin
|
208
|
+
self.predicate.rename(renaming)
|
209
|
+
rescue Predicate::NotSupportedError => e
|
210
|
+
Predicate.tautology
|
211
|
+
end
|
207
212
|
dup.tap{|x|
|
208
213
|
x.attrlist = self.attrlist.map{|a| renaming[a] || a } if knows_attrlist?
|
209
|
-
x.predicate =
|
214
|
+
x.predicate = new_pred
|
210
215
|
x.keys = self._keys.rename(self, x, renaming) if knows_keys?
|
211
216
|
}
|
212
217
|
end
|
@@ -216,7 +221,7 @@ module Bmg
|
|
216
221
|
dup.tap{|x|
|
217
222
|
### attrlist stays the same
|
218
223
|
x.predicate = self.predicate & predicate
|
219
|
-
x.keys = self._keys if knows_keys?
|
224
|
+
x.keys = self._keys.restrict(self, x, predicate) if knows_keys?
|
220
225
|
}
|
221
226
|
end
|
222
227
|
|
data/lib/bmg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bmg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.0
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: predicate
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.3'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: roo
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '2.7'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '2.7'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: sequel
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -268,12 +254,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
268
254
|
version: '0'
|
269
255
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
270
256
|
requirements:
|
271
|
-
- - "
|
257
|
+
- - ">="
|
272
258
|
- !ruby/object:Gem::Version
|
273
|
-
version:
|
259
|
+
version: '0'
|
274
260
|
requirements: []
|
275
261
|
rubyforge_project:
|
276
|
-
rubygems_version: 2.6
|
262
|
+
rubygems_version: 2.7.6
|
277
263
|
signing_key:
|
278
264
|
specification_version: 4
|
279
265
|
summary: Bmg is Alf's successor.
|