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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 218f9f80891f162695252fbfa56a2e9c2bb7d5f7
4
- data.tar.gz: 7c2cf33b9fbc68a20ac08c788fc520b345d8193e
2
+ SHA256:
3
+ metadata.gz: 81ed4175114b231d4909a01a4d25a82957ca523a65feedb3c556f96067209d53
4
+ data.tar.gz: e1c5f0179ca55a39515526c05a06560d8d1a0827c9829b0ad47087b3ad353af1
5
5
  SHA512:
6
- metadata.gz: 83bd84d4505c42a08df4b618f746f39c1548f9aa942ec37682fc95ef383bd8b46c86cb5654f6a858f1b06a1a32176a4b017bde63d2fded55e4ffcdc0157c13cd
7
- data.tar.gz: 75adc3b09a8264cf0d56346137688e82bfac9264402fe1c586b42071c470fe0582132a672cd6aa0f8c4699cf8cabfa5728c5e574d54f48121cf16aaeaf9c8064
6
+ metadata.gz: 964d0b754e3834b48c8fc1741fb74e4bf7f78b6d3efc4360e07b1d08d4178b6f13b10de4e23bda7f6a664aa757973094499da837b8aeeffc3b8368a2dce2dd6f
7
+ data.tar.gz: 7ae281e7f4141ce1960bdec92d1a126b7ee36310a150565d9a587bbabd1dfd3731a5058a822748bbb70c892828947a69e6fc6b7e3e81604198904a062759adb3
data/lib/bmg.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'path'
2
2
  require 'predicate'
3
+ require 'forwardable'
3
4
  module Bmg
4
5
 
5
6
  def in_memory(enumerable, type = Type::ANY)
@@ -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?
@@ -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 = self.predicate.rename(renaming)
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
 
@@ -2,7 +2,7 @@ module Bmg
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 16
5
- TINY = "0-rc2"
5
+ TINY = 0
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
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.pre.rc2
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-03-12 00:00:00.000000000 Z
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: 1.3.1
259
+ version: '0'
274
260
  requirements: []
275
261
  rubyforge_project:
276
- rubygems_version: 2.6.11
262
+ rubygems_version: 2.7.6
277
263
  signing_key:
278
264
  specification_version: 4
279
265
  summary: Bmg is Alf's successor.