bmg 0.14.2 → 0.14.3

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
2
  SHA1:
3
- metadata.gz: 6c5a5a369833a57501c77ea1f3e71f96d82f574d
4
- data.tar.gz: 57dcfc425645f23cbef74ab398c10a04de7991b6
3
+ metadata.gz: 056b65d68a70e321b0b7d5583ef2d755f0c3c8d2
4
+ data.tar.gz: d554cd62aa4c63cde6093efda36a183e07bcea21
5
5
  SHA512:
6
- metadata.gz: c2fb9d06219a133708f68de90242c9528077536c7f401373448cac5f20de7775f683cc5ebda23f4132f1449e2cb6409ce81ac6cd245648d96a193e5acb70e601
7
- data.tar.gz: 181efad42653a1ab288336b46c9f21cfa1405821b3a84849a50bd7f7de3639de9195d4e91b310bf6eb5d8344761969968ef9a39db8c3180a6e28753c50f94674
6
+ metadata.gz: b1482290a291d2e71e9f4cbf3848fc9d316708a8068bb3812c206eaa5d90fd44167119815d5d63277845b2ec9f55511289db9796b672d60a9efad05890330077
7
+ data.tar.gz: b53fc761adc3321fb83e5b20e89811512c3d2dadf879f35857dab12e2098e5e2cbe049d307cc9f9b4ac68f3bdebab99d16cdb99c974b4bada65f824f6480edb0
data/lib/bmg.rb CHANGED
@@ -40,6 +40,7 @@ module Bmg
40
40
  require_relative 'bmg/relation/empty'
41
41
  require_relative 'bmg/relation/in_memory'
42
42
  require_relative 'bmg/relation/spied'
43
+ require_relative 'bmg/relation/materialized'
43
44
 
44
45
  # Deprecated
45
46
  Leaf = Relation::InMemory
@@ -161,6 +161,10 @@ module Bmg
161
161
  self
162
162
  end
163
163
 
164
+ def materialize
165
+ Relation::Materialized.new(self)
166
+ end
167
+
164
168
  require_relative 'algebra/shortcuts'
165
169
  include Shortcuts
166
170
  end # module Algebra
@@ -0,0 +1,36 @@
1
+ module Bmg
2
+ module Relation
3
+ class Materialized
4
+ include Operator::Unary
5
+
6
+ def initialize(operand)
7
+ @operand = operand
8
+ end
9
+
10
+ def type
11
+ operand.type
12
+ end
13
+
14
+ def type=(type)
15
+ operand.type = type
16
+ end
17
+ protected :type=
18
+
19
+ public
20
+
21
+ def each(&bl)
22
+ @operand = Relation::InMemory.new(operand.type, operand.to_a) unless @operand.is_a?(Relation::InMemory)
23
+ @operand.each(&bl)
24
+ end
25
+
26
+ def to_ast
27
+ [ :materizalized, operand ]
28
+ end
29
+
30
+ def args
31
+ []
32
+ end
33
+
34
+ end # class Materialized
35
+ end # module Relation
36
+ end # module Bmg
@@ -2,7 +2,7 @@ module Bmg
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 14
5
- TINY = 2
5
+ TINY = 3
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.14.2
4
+ version: 0.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-28 00:00:00.000000000 Z
11
+ date: 2018-08-29 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
@@ -146,6 +132,7 @@ files:
146
132
  - lib/bmg/relation.rb
147
133
  - lib/bmg/relation/empty.rb
148
134
  - lib/bmg/relation/in_memory.rb
135
+ - lib/bmg/relation/materialized.rb
149
136
  - lib/bmg/relation/spied.rb
150
137
  - lib/bmg/sequel.rb
151
138
  - lib/bmg/sequel/ext.rb
@@ -254,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
241
  version: '0'
255
242
  requirements: []
256
243
  rubyforge_project:
257
- rubygems_version: 2.6.11
244
+ rubygems_version: 2.5.2
258
245
  signing_key:
259
246
  specification_version: 4
260
247
  summary: Bmg is Alf's successor.