alf 0.15.0 → 0.16.0
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.
- data/CHANGELOG.md +19 -482
- data/Gemfile +10 -0
- data/Gemfile.lock +63 -17
- data/Rakefile +1 -0
- data/alf.gemspec +6 -5
- data/alf.noespec +11 -6
- data/lib/alf/loader.rb +2 -0
- data/lib/alf/version.rb +1 -1
- data/spec/dd-operators/test_shortcut_operator.rb +19 -0
- data/spec/facade/test_query.rb +9 -0
- data/spec/facade/test_tuple.rb +10 -0
- data/spec/io/suppliers.rash +1 -0
- data/spec/io/test_rash_loader.rb +12 -0
- data/spec/operators/test_image.rb +33 -0
- data/spec/optimizer/project/minus.yml +7 -0
- data/spec/regression/test_0001.rb +12 -0
- data/spec/regression/test_0002.rb +12 -0
- data/spec/sql/queries/06-join.yml +19 -0
- data/spec/sql/queries/11-project.yml +18 -0
- data/spec/typing/test_typing_on_coerce.rb +14 -0
- data/tasks/mod.rake +21 -0
- data/tasks/release.rake +46 -2
- metadata +46 -14
data/CHANGELOG.md
CHANGED
@@ -1,482 +1,19 @@
|
|
1
|
-
# 0.
|
2
|
-
|
3
|
-
*
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
*
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
* Added
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
Alf.connect(adapter: "sqlite", database: "test.sqlite3") ...
|
21
|
-
|
22
|
-
* Evaluation of queries are now sent to a connection specifically:
|
23
|
-
|
24
|
-
Alf.connect(...) do |conn|
|
25
|
-
conn.query{ (restrict :suppliers, ->{ status > 10 } )}
|
26
|
-
end
|
27
|
-
|
28
|
-
* Alf::Relation now respond to aggregation functions with an object-oriented syntax:
|
29
|
-
|
30
|
-
Relation(...).sum{ qty }
|
31
|
-
|
32
|
-
* Alf::Relation(...) (aliased as Alf.relation) now recognize IO objects and Path.like instances and load them with available readers in the easiest possible way:
|
33
|
-
|
34
|
-
Alf::Relation("path/to/a/suppliers.csv")
|
35
|
-
# => Alf::Relation[...]
|
36
|
-
|
37
|
-
* Alf::Relation(...) ensures that attribute names are Symbols and symbolize them if needed.
|
38
|
-
|
39
|
-
* Added Relation#tuple_extract, aliased as Relation#tuple! that returns the only tuple of the relation, or raises a NoSuchTupleError if no tuple or more than one.
|
40
|
-
|
41
|
-
* Added Alf::Tuple(...) that behaves similarly to Alf::Relation(...) but for tuples.
|
42
|
-
|
43
|
-
* Added Alf.reader as a convenient shortcut for Alf::Reader.reader.
|
44
|
-
|
45
|
-
Alf.reader("path/to/a/suppliers.csv")
|
46
|
-
# => #<Alf::CSV::Reader:0x007fd554058440 ...>
|
47
|
-
|
48
|
-
* Added Alf::Reader#path that always returns a Path instance, unless the reader operates on an IO/StringIO. Use Alf::Reader#input to get the source passed at construction.
|
49
|
-
|
50
|
-
* All queries as well as tuple expressions (in restrictions, extensions, summarizations, etc.) are now evaluated in a cleaner and extended scope through a BasicObject extended with all database helpers. This has multiple advantages and one drawback:
|
51
|
-
* It allows you to have all database helpers available in those expressions.
|
52
|
-
* You no longer have to worry about name clashes with Kernel's methods.
|
53
|
-
* Kernel's functions are no longer accessible whithout prefixing with ::Kernel.
|
54
|
-
|
55
|
-
* In sync with the previous point, Relation (the class), DUM and DEE are now defined globally (unless you define `ALF_NO_CORE_EXTENSIONS` before loading Alf). Those constants can thus be safely used in query expressions without experiencing a NameError.
|
56
|
-
|
57
|
-
* Added a JSON renderer.
|
58
|
-
|
59
|
-
## Bug fixes
|
60
|
-
|
61
|
-
* The Aggregator class, Summarization type and Summarize operator have been made thread-safe through #happens that now takes a TupleScope instead of a tuple.
|
62
|
-
|
63
|
-
* Sequel::Connection#relvar correctly raises a NoSuchRelvarError if no table can be found.
|
64
|
-
|
65
|
-
## Broken stuff
|
66
|
-
|
67
|
-
* The `heading` operator has been renamed `infer-heading` (Heading -> InferHeading accordingly).
|
68
|
-
|
69
|
-
* `Alf.lispy` has been removed from the public API. Please use `connect` instead:
|
70
|
-
|
71
|
-
Alf.lipsy(db_params).query{ ... }
|
72
|
-
|
73
|
-
becomes:
|
74
|
-
|
75
|
-
Alf.connect(db_params) do |conn|
|
76
|
-
conn.query{ ... }
|
77
|
-
end
|
78
|
-
|
79
|
-
* The Environment concept as been removed and replaced by Connection. That also means that `environment` readers and writers here have been replaced according to cases. Also, the --env option has been renamed to --db in the shell command. This is a major incompatible change of Alf internals that might break existing code that extends Alf::Environment, Alf::Reader or any subclass.
|
80
|
-
|
81
|
-
* Connection#dataset has been replaced to Connection#relvar and now serves relation variables instead of pure iterators.
|
82
|
-
|
83
|
-
* You now have to explicitely use 'alf show --text > ...' or 'alf --text ... > ' if you don't want ruby hashes to be outputted to output files. This is a consequence of tty detection that ensures a better shell experience.
|
84
|
-
|
85
|
-
* Kernel's functions are no longer accessible in tuple expressions that are executed within a BasicObject's scope.
|
86
|
-
|
87
|
-
* The syntax (Relation :relvar_name) is no longer supported as it does not denote a relation literal at all.
|
88
|
-
|
89
|
-
* `Iterator#to_rel` has been removed. Use `Iterator#to_relation` instead.
|
90
|
-
|
91
|
-
* Renderers are no longer able to coerce their input from a Symbol.
|
92
|
-
|
93
|
-
* Renderer.renderers and Renderer.each_renderer have been removed. Use Renderer.all and Renderer.each instead, respectively.
|
94
|
-
|
95
|
-
* Reader.readers has been removed. Use Reader.all or Reader.each instead.
|
96
|
-
|
97
|
-
* Aggregator.aggregators has been removed. Use Aggregator.all or Aggregator.each instead.
|
98
|
-
|
99
|
-
* TupleExpression#call and TupleExpression#[] have been removed.
|
100
|
-
|
101
|
-
* TuplePredicate has been replaced by Predicate. The latter is no longer a subclass of TupleExpression.
|
102
|
-
|
103
|
-
## Bug fixes
|
104
|
-
|
105
|
-
* The backports gem is no longer required on ruby =1.9
|
106
|
-
|
107
|
-
# 0.12.2 / 2012-06-12
|
108
|
-
|
109
|
-
* Bumped and weakened backports dependency to '~> 2.6'
|
110
|
-
|
111
|
-
# 0.12.1 / 2012-03-13
|
112
|
-
|
113
|
-
## Enhancements
|
114
|
-
|
115
|
-
* Add `Alf::Relation()`, with the same semantics as the main `Relation()` function
|
116
|
-
added in 0.12.0.
|
117
|
-
|
118
|
-
## Bugfixes
|
119
|
-
|
120
|
-
* Ensure that `Relation()` reads a reader/operator only once.
|
121
|
-
* The Sequel environment now correctly uses the jdbc driver when attempting to connect
|
122
|
-
to a sqlite database/file.
|
123
|
-
|
124
|
-
# 0.12.0 / 2012-02-09
|
125
|
-
|
126
|
-
* Add a Relation() toplevel method that mimics Array(), Integer(), and so on.
|
127
|
-
That method uses Tools::ToRelation which is a set of Myrrha coercion rules.
|
128
|
-
The Relation() method helps building relation "literals" (say) for common
|
129
|
-
cases, such as the following:
|
130
|
-
|
131
|
-
Relation(:name => "Alf")
|
132
|
-
# => (Relation (Tuple :name => "Alf"))
|
133
|
-
|
134
|
-
Relation([{:name => "Alf"}, {:name => "Myrrha"}])
|
135
|
-
# => (Relation (Tuple :name => "Alf"), (Tuple :name => "Myrrha"))
|
136
|
-
|
137
|
-
Relation(:name => ["Alf", "Myrrha"])
|
138
|
-
# => (Relation (Tuple :name => "Alf"), (Tuple :name => "Myrrha"))
|
139
|
-
|
140
|
-
# 0.11.1 / 2012-01-25
|
141
|
-
|
142
|
-
## Bugfixes
|
143
|
-
|
144
|
-
* Fix Aggregator.stddev and Lispy.stddev that were missing
|
145
|
-
|
146
|
-
# 0.11.0 / 2012-01-25
|
147
|
-
|
148
|
-
## Broken APIs (private sections only)
|
149
|
-
|
150
|
-
* All pipe() methods have been removed and replaced by arguments taken at
|
151
|
-
construction time. This affects the implementation of operators and may
|
152
|
-
require changes to contributed readers and renderers.
|
153
|
-
* Alf::Operator::Base -> Alf::Operator::InstanceMethods
|
154
|
-
* Alf::Reader::Base -> Alf::Reader::InstanceMethods
|
155
|
-
* Alf::Rendered::Base -> Alf::Rendered::InstanceMethods
|
156
|
-
* Alf::Environment::Base -> Alf::Environment::InstanceMethods
|
157
|
-
* Alf::Aggregator::Base -> Alf::Aggregator::InstanceMethods
|
158
|
-
* Alf::Buffer has been removed as well as the Sorted specialization.
|
159
|
-
* Alf::Environment::Explicit has been removed as well as associated tools.
|
160
|
-
* Ordering#order_of has been removed
|
161
|
-
* Ordering#order_by has been removed
|
162
|
-
* Alf::Tools.coerce now raise a Alf::CoercionError instead of a Myrrha::Error
|
163
|
-
in case of coercion failure
|
164
|
-
|
165
|
-
## On the development side
|
166
|
-
|
167
|
-
* Bumped ruby.noe to 1.7.0
|
168
|
-
* Bumped rspec to 2.8.0
|
169
|
-
* Bumped sequel to 3.30.0
|
170
|
-
|
171
|
-
# 0.10.1 / 2011-08-31
|
172
|
-
|
173
|
-
## Miscellaneous enhancements
|
174
|
-
|
175
|
-
* Added Variance and Stddev aggregation operators; they are available under
|
176
|
-
Aggregator.variance{} and Aggregator.stddev{}, respectively
|
177
|
-
* Added a --pretty option to 'alf', whose semantics is delegated to the output
|
178
|
-
renderer. Same option is available on 'alf show'.
|
179
|
-
* 'alf show' now accepts an optional ordering argument. This avoids explicitely
|
180
|
-
including non-relational sort invocations in your pipe (sorting should be
|
181
|
-
seen as a displaying issue)
|
182
|
-
* Added an options hash to text renderer, :float_format among others
|
183
|
-
* Added a --ff option to 'alf show', for float format in text rendering
|
184
|
-
|
185
|
-
## Bugfixes
|
186
|
-
|
187
|
-
* Alf::Environment::(Folder/Explicit)#dataset now correctly raises a
|
188
|
-
NoSuchDatasetError when the dataset cannot be found, as required by the
|
189
|
-
specification.
|
190
|
-
* Alf::Reader.reader now correctly returns a Rash reader when invoked on a
|
191
|
-
StringIO
|
192
|
-
|
193
|
-
# 0.10.0 / 2011-08-15
|
194
|
-
|
195
|
-
## New recognized data sources
|
196
|
-
|
197
|
-
* Alf now provides an Environment implementation on top of a SQL database.
|
198
|
-
This means that SQL tables can now be used as data-sources. This feature
|
199
|
-
relies on the sequel gem ('gem install sequel' is required), that drives
|
200
|
-
recognized SQL servers. Then (don't forget that ALF_OPTS also exists):
|
201
|
-
|
202
|
-
% alf --env=postgres://user:password@host/database show table
|
203
|
-
|
204
|
-
* Alf now recognizes and allows manipulating .csv files as first-class data
|
205
|
-
sources. CSV output is also supported of course. Under ruby <= 1.9, the
|
206
|
-
fastercsv gem is required ('gem install fastercsv' is required). Then:
|
207
|
-
|
208
|
-
% alf restrict suppliers.csv -- "city == 'Paris'" (input)
|
209
|
-
% alf show suppliers --csv (output)
|
210
|
-
|
211
|
-
* Alf now recognizes and allows manipulating .log files as first-class data
|
212
|
-
sources. This feature relies on request-log-analyzer gem that provides the
|
213
|
-
parsers that Alf uses, and the log formats it recognizes
|
214
|
-
('gem install request-log-analyzer' is required). See examples/logs.
|
215
|
-
|
216
|
-
## New operators and enhancements
|
217
|
-
|
218
|
-
* A GENERATOR operator is introduced. It allows generating a relation with one
|
219
|
-
auto-number attribute, up to a given size.
|
220
|
-
|
221
|
-
* A COERCE operator is introduced. It provides a quick way to obtain type-safe
|
222
|
-
relations from type-unsafe sources like .csv files. For example:
|
223
|
-
|
224
|
-
% alf coerce mydirtyfile.csv -- name String price Float at Time
|
225
|
-
|
226
|
-
The coerce operator is of course available in Ruby as well:
|
227
|
-
|
228
|
-
(coerce "mydirtyfile.csv", :name => String, :price => Float, :at => Time)
|
229
|
-
|
230
|
-
* The DEFAULTS (non-relational) operator now accepts default values as tuple
|
231
|
-
expressions. When used in shell, provided default values are now evaluated
|
232
|
-
that way. This allows specifying default values as being computed on the
|
233
|
-
current tuple.
|
234
|
-
|
235
|
-
* Aggregations in the Lispy DSL must not be prefixed by Agg:: anymore.
|
236
|
-
|
237
|
-
## Miscellaneous enhancements
|
238
|
-
|
239
|
-
* Added 'alf --input-reader' to specify $stdin format (csv, rash, etc.)
|
240
|
-
* Added 'alf -Ipath' that mimics ruby's -I (add path to $LOAD_PATH before run)
|
241
|
-
* Lispy#run supports command arguments to be passed as a string
|
242
|
-
* Lispy#run supports piped commands, with '|' as in shell
|
243
|
-
|
244
|
-
## Hurting changes to Lispy DSL (and therefore to Relation)
|
245
|
-
|
246
|
-
* The attribute-name syntax of aggregation operators has been removed. The Agg::
|
247
|
-
prefix must not be specified anymore.
|
248
|
-
|
249
|
-
Agg::sum(:qty) # !! error !!
|
250
|
-
Agg::sum{ qty } # !! error !!
|
251
|
-
sum{ qty } # simply, and only!
|
252
|
-
|
253
|
-
* The group aggregation operator has been removed. It will probably be replaced
|
254
|
-
in a future version. In the meantime, the GROUP relational operator allows
|
255
|
-
obtaining similar results.
|
256
|
-
|
257
|
-
* Lispy syntax of CLIP has changed (when used with --allbut option)
|
258
|
-
|
259
|
-
(clip :suppliers, [:name, :city], true) (before)
|
260
|
-
(clip :suppliers, [:name, :city], :allbut => true) (after)
|
261
|
-
|
262
|
-
* Lispy syntax of DEFAULTS has changed (when used with --strict option)
|
263
|
-
|
264
|
-
(defaults :suppliers, {:country => 'Belgium'}, true) (before)
|
265
|
-
(defaults :suppliers, {:country => 'Belgium'}, :strict => true) (after)
|
266
|
-
|
267
|
-
* Lispy syntax of GROUP has changed (when used with --allbut option)
|
268
|
-
|
269
|
-
(group :supplies, [:sid], :supplying, true) (before)
|
270
|
-
(group :supplies, [:sid], :supplying, :allbut => true) (after)
|
271
|
-
|
272
|
-
* Lispy syntax of PROJECT has changed (when used with --allbut option)
|
273
|
-
|
274
|
-
(project :suppliers, [:name, :city], true) (before)
|
275
|
-
(project :suppliers, [:name, :city], :allbut => true) (after)
|
276
|
-
|
277
|
-
* Lispy syntax of SUMMARIZE has changed (when used with --allbut option)
|
278
|
-
|
279
|
-
(summarize :supplies, [:qty, :pid], {...}, true) (before)
|
280
|
-
(summarize :supplies, [:qty, :pid], {...}, :allbut => true) (after)
|
281
|
-
|
282
|
-
## Hurting changes in shell
|
283
|
-
|
284
|
-
* The attribute-name syntax of aggregation operators has been removed
|
285
|
-
|
286
|
-
sum(:qty) # !! error !!
|
287
|
-
sum{ qty } # works
|
288
|
-
|
289
|
-
* Shell syntax of GROUP has changed (option separator before introduced name)
|
290
|
-
|
291
|
-
% alf --text group supplies -- pid qty supplying (before)
|
292
|
-
% alf --text group supplies -- pid qty -- supplying (after)
|
293
|
-
|
294
|
-
* Shell syntax of WRAP has changed (option separator before introduced name)
|
295
|
-
|
296
|
-
% alf --text wrap suppliers -- city status loc_and_status (before)
|
297
|
-
% alf --text wrap suppliers -- city status -- loc_and_status (after)
|
298
|
-
|
299
|
-
* Shell syntax of QUOTA has changed (--by and --order become pure arguments)
|
300
|
-
|
301
|
-
% alf quota supplies --by=sid --order=qty -- position count sum_qty "sum{ qty }" (before)
|
302
|
-
% alf quota supplies -- sid -- qty -- position count sum_qty "sum{ qty }" (after)
|
303
|
-
|
304
|
-
* Shell syntax of RANK has changed (--order becomes a pure argument)
|
305
|
-
|
306
|
-
% alf rank parts --order=weight,desc,pid,asc -- position (before)
|
307
|
-
% alf rank parts -- weight desc pid asc -- position (after)
|
308
|
-
|
309
|
-
* Shell syntax of SUMMARIZE has changed (--by becomes a pure argument)
|
310
|
-
|
311
|
-
% alf summarize supplies --by=sid -- total_qty "sum{ qty }" (before)
|
312
|
-
% alf summarize supplies -- sid -- total_qty "sum{ qty }" (after)
|
313
|
-
|
314
|
-
## Bug fixes
|
315
|
-
|
316
|
-
* [In shell] Options are now correctly parsed in presence of option separators.
|
317
|
-
That is, every argument after a '--' separator is considered a non-option
|
318
|
-
argument.
|
319
|
-
|
320
|
-
# 0.9.3 / 2011-07-23
|
321
|
-
|
322
|
-
## New operators (available both in shell and in Lispy DSL)
|
323
|
-
|
324
|
-
* Added MATCHING and NOT MATCHING operators. These operators are useful
|
325
|
-
shortcuts for the following expressions.
|
326
|
-
|
327
|
-
(matching l, r) := (project (join l, r), [l's attributes])
|
328
|
-
(not_matching l, r) := (minus l, (matching l, r))
|
329
|
-
|
330
|
-
For example:
|
331
|
-
|
332
|
-
# Give suppliers who supply at least one part
|
333
|
-
(matching suppliers, supplies)
|
334
|
-
|
335
|
-
# Give suppliers who don't supply any part
|
336
|
-
(not_matching suppliers, supplies)
|
337
|
-
|
338
|
-
* Added RANK operator, which is useful for for computing quota queries as
|
339
|
-
illustrated below. See 'alf help rank' for details.
|
340
|
-
|
341
|
-
# Give the three heaviest parts
|
342
|
-
(restrict (rank :parts, [[:weight, :desc]], :pos), lambda{ pos < 3 })
|
343
|
-
|
344
|
-
## Enhancements when using Alf in shell
|
345
|
-
|
346
|
-
* added 'alf -r', that mimics 'ruby -r' (require library before run)
|
347
|
-
|
348
|
-
* When alf is invoked in shell (and only in this case), ALF_OPTS is used as
|
349
|
-
global options to apply as if they were specified inline:
|
350
|
-
|
351
|
-
% export ALF_OPTS="--env=. --yaml"
|
352
|
-
% alf show suppliers
|
353
|
-
|
354
|
-
is the same as
|
355
|
-
|
356
|
-
% alf --env=. --yaml show suppliers
|
357
|
-
|
358
|
-
* 'alf --help' now distinguishes experimental operators (quota in particular)
|
359
|
-
from those coming from the (much more stable) **Tutorial D** specification. The
|
360
|
-
former should be used with care as their specification may change at any
|
361
|
-
time.
|
362
|
-
|
363
|
-
## Enhancements when using Alf in Ruby
|
364
|
-
|
365
|
-
* Alf.lispy now accepts any argument recognized by Environment.autodetect; it
|
366
|
-
obtains its working Environment that way. Among others:
|
367
|
-
|
368
|
-
Alf.lispy(Alf::Environment.folder("path/to/an/existing/folder"))
|
369
|
-
|
370
|
-
is the same as:
|
371
|
-
|
372
|
-
Alf.lispy("path/to/an/existing/folder")
|
373
|
-
|
374
|
-
* Added Relation::DUM and Relation::DEE constants (relations of empty heading
|
375
|
-
with no and one tuple, respectively). They are also available as DUM and DEE
|
376
|
-
in Lispy functional expressions.
|
377
|
-
|
378
|
-
* Added a Heading abstraction, as a set of attribute (name, type) pairs.
|
379
|
-
|
380
|
-
## Internal enhancements (extension points)
|
381
|
-
|
382
|
-
* The Reader and Renderer classes accept a Hash of options as third
|
383
|
-
constructor argument. These options can be used by extension points.
|
384
|
-
|
385
|
-
* The Environment class now provides a class-based registering mechanism 'ala'
|
386
|
-
Reader and Renderer. This allows auto-detecting the target environment when
|
387
|
-
--env=... is used in shell. See Environment.autodetect and
|
388
|
-
Environment#recognizes? for contributing to this extension point.
|
389
|
-
|
390
|
-
* Internals now rely on Myrrha for code generation. This means that all
|
391
|
-
datatypes can now be safely used in relations and dumped to .rash files in
|
392
|
-
particular.
|
393
|
-
|
394
|
-
## Bug fixes
|
395
|
-
|
396
|
-
* Added Relation#allbut, forgotten in two previous releases
|
397
|
-
* Fixed (join xxx, DEE) and (join xxx, DUM)
|
398
|
-
* Fixed scoping bug when using attributes named :path, :expr or :block in
|
399
|
-
Lispy compiled expressions (coming from .alf files)
|
400
|
-
* Fixed 'alf --yaml show suppliers' that renderer a --text table instead of
|
401
|
-
a yaml output
|
402
|
-
* Fixed bugs when using Date and Time attributes with .rash files
|
403
|
-
* Fixed bugs when using Date and Time attributes in restrict expressions
|
404
|
-
compiled from the commandline
|
405
|
-
* Fixed a few bugs when using attribute names that are ruby keywords
|
406
|
-
(restrict & extend)
|
407
|
-
|
408
|
-
# 0.9.2 / 2011.07.13
|
409
|
-
|
410
|
-
# Bug fixes
|
411
|
-
|
412
|
-
* Fixed the "alf show" command (undefined method `chain')
|
413
|
-
|
414
|
-
# 0.9.1 / 2011.07.13
|
415
|
-
|
416
|
-
## Enhancements (public APIs)
|
417
|
-
|
418
|
-
* Added the in-memory Alf::Relation data structure and associated tooling.
|
419
|
-
This allows using Alf in a object-oriented usual way, in addition to the
|
420
|
-
functional DSL:
|
421
|
-
|
422
|
-
Alf.lispy.evaluate {
|
423
|
-
(join (restrict :suppliers, lambda{ status > 10 }), :cities)
|
424
|
-
}
|
425
|
-
|
426
|
-
is equivalent to
|
427
|
-
|
428
|
-
suppliers, cities = [...], [...]
|
429
|
-
suppliers.restrict(lambda{ status > 10 }).join(cities)
|
430
|
-
|
431
|
-
see README about how to obtain suppliers and cities relations in the first
|
432
|
-
place.
|
433
|
-
|
434
|
-
* Summarize now accepts a --allbut option, to specify 'by' attributes from an
|
435
|
-
exclusion perspective
|
436
|
-
|
437
|
-
* .alf files are now evaluated in such a way that backtraces are "traceability
|
438
|
-
friendly"
|
439
|
-
|
440
|
-
## Non backward-compatible changes to public APIs
|
441
|
-
|
442
|
-
* Lispy#with has been removed because not being stable enough. The clean way
|
443
|
-
of reusing sub-queries is as follows (non purely functional, so far)
|
444
|
-
|
445
|
-
kept_suppliers = (restrict :suppliers, lambda{ status > 10 })
|
446
|
-
with_countries = (join kept_suppliers, :cities)
|
447
|
-
supplying = (join with_countries, :supplies)
|
448
|
-
(summarize supplying,
|
449
|
-
[:country],
|
450
|
-
:which => Agg::group(:pid),
|
451
|
-
:total => Agg::sum{ qty })
|
452
|
-
|
453
|
-
* As a consequence, named data sources (Symbols, like :suppliers above) are
|
454
|
-
now resolved at compile time, which is less powerful, yet much simpler and
|
455
|
-
sound.
|
456
|
-
|
457
|
-
* Nest and Unnest have been renamed to Wrap and Unwrap respectively. This is
|
458
|
-
to better conform to **Tutorial D**'s terminology.
|
459
|
-
|
460
|
-
* Lispy#chain was kept public in 0.9.0 by error and has been entirely removed
|
461
|
-
from the DSL.
|
462
|
-
|
463
|
-
## Enhancements (internals)
|
464
|
-
|
465
|
-
* Reader.reader delegates to Reader.coerce when its first argument is not
|
466
|
-
a String. This allows calling Reader.reader(args.first || $stdin) in quickl
|
467
|
-
commands for example.
|
468
|
-
|
469
|
-
* Operator, Operator::Relational and Operator::NonRelational have a .each
|
470
|
-
class method that yields operator classes
|
471
|
-
|
472
|
-
## Bug fixes
|
473
|
-
|
474
|
-
* Fixed a bug that led to an Nil error when using unary operators on $stdin
|
475
|
-
* Fixed a bug when summarizing or sorting on Symbol attributes with ruby 1.8
|
476
|
-
* Fixed numerous crashes under rubinius
|
477
|
-
|
478
|
-
# 0.9.0 / 2011.06.19
|
479
|
-
|
480
|
-
## Enhancements
|
481
|
-
|
482
|
-
* Birthday!
|
1
|
+
# 0.16.0 - 2014-02-18
|
2
|
+
|
3
|
+
* Fixed SQL compilation when projecting over set operators (minus, union,
|
4
|
+
intersection)
|
5
|
+
* Fixed SQL compilation of join with DEE/DUM.
|
6
|
+
* Removed `is_table_dee` attribute when projecting all attributes away from
|
7
|
+
a SQL data source.
|
8
|
+
* Fixed compilation of shortcut operators involving complex expressions.
|
9
|
+
* Fixed Tuple() that now accepts no arg and returns an empty tuple.
|
10
|
+
* Fixed "comparison failure" errors in the presence of `nil`. You should NOT
|
11
|
+
use `nil`, but robustness is probably necessary anyway.
|
12
|
+
* Added the ability to load a .rash file through Path#load. Result is an array
|
13
|
+
of hashes.
|
14
|
+
* Fixed default signature of Hierarchize.
|
15
|
+
* Added a basic `image` operator as a shortcut expression.
|
16
|
+
|
17
|
+
# 0.15.0 - 2013-11-01
|
18
|
+
|
19
|
+
New birthday.
|
data/Gemfile
CHANGED
@@ -7,6 +7,7 @@ group :runtime do
|
|
7
7
|
gem "alf-shell", path: "./alf-shell"
|
8
8
|
gem "alf-sequel", path: "./alf-sequel"
|
9
9
|
gem "alf-rack", path: "./alf-rack"
|
10
|
+
gem "alf-repl", path: "./alf-repl"
|
10
11
|
end
|
11
12
|
|
12
13
|
group :test do
|
@@ -15,9 +16,18 @@ group :test do
|
|
15
16
|
gem "sqlite3", "~> 1.3", :platforms => ['mri', 'rbx']
|
16
17
|
gem "jdbc-sqlite3", "~> 3.7", :platforms => ['jruby']
|
17
18
|
gem "pg", "~> 0.14", :platforms => ['mri', 'rbx']
|
19
|
+
gem "highline", "~> 1.6"
|
18
20
|
end
|
19
21
|
|
20
22
|
group :release do
|
21
23
|
gem "rake", "~> 10.1"
|
22
24
|
gem "rspec", "~> 2.14"
|
23
25
|
end
|
26
|
+
|
27
|
+
group :devel do
|
28
|
+
gem "rack", "~> 1.5"
|
29
|
+
gem "rack-robustness", "~> 1.1"
|
30
|
+
gem "sinatra", "~> 1.4"
|
31
|
+
gem "wlang", "~> 2.2"
|
32
|
+
gem "sprockets", "~> 2.10"
|
33
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
alf (0.
|
5
|
-
alf-core (~> 0.
|
6
|
-
alf-rack (~> 0.
|
7
|
-
alf-
|
8
|
-
alf-
|
9
|
-
alf-
|
4
|
+
alf (0.16.0)
|
5
|
+
alf-core (~> 0.16.0)
|
6
|
+
alf-rack (~> 0.16.0)
|
7
|
+
alf-repl (~> 0.16.0)
|
8
|
+
alf-sequel (~> 0.16.0)
|
9
|
+
alf-shell (~> 0.16.0)
|
10
|
+
alf-sql (~> 0.16.0)
|
10
11
|
|
11
12
|
PATH
|
12
13
|
remote: ./alf-core
|
13
14
|
specs:
|
14
|
-
alf-core (0.
|
15
|
+
alf-core (0.16.0)
|
15
16
|
domain (~> 1.0)
|
16
17
|
myrrha (~> 3.0)
|
17
18
|
path (~> 1.3)
|
@@ -20,39 +21,57 @@ PATH
|
|
20
21
|
PATH
|
21
22
|
remote: ./alf-rack
|
22
23
|
specs:
|
23
|
-
alf-rack (0.
|
24
|
-
alf-core (
|
24
|
+
alf-rack (0.16.0)
|
25
|
+
alf-core (= 0.16.0)
|
25
26
|
rack (~> 1.5)
|
26
27
|
rack-accept (~> 0.4.5)
|
27
28
|
ruby_cop (~> 1.0)
|
28
29
|
|
30
|
+
PATH
|
31
|
+
remote: ./alf-repl
|
32
|
+
specs:
|
33
|
+
alf-repl (0.16.0)
|
34
|
+
alf-core (= 0.16.0)
|
35
|
+
alf-rack (= 0.16.0)
|
36
|
+
rack (~> 1.5)
|
37
|
+
rack-robustness (~> 1.1)
|
38
|
+
sinatra (~> 1.4)
|
39
|
+
sprockets (~> 2.10)
|
40
|
+
wlang (~> 2.2)
|
41
|
+
|
29
42
|
PATH
|
30
43
|
remote: ./alf-sequel
|
31
44
|
specs:
|
32
|
-
alf-sequel (0.
|
33
|
-
alf-core (
|
34
|
-
alf-sql (
|
45
|
+
alf-sequel (0.16.0)
|
46
|
+
alf-core (= 0.16.0)
|
47
|
+
alf-sql (= 0.16.0)
|
35
48
|
sequel (~> 4.2)
|
36
49
|
|
37
50
|
PATH
|
38
51
|
remote: ./alf-shell
|
39
52
|
specs:
|
40
|
-
alf-shell (0.
|
41
|
-
alf-core (
|
53
|
+
alf-shell (0.16.0)
|
54
|
+
alf-core (= 0.16.0)
|
55
|
+
highline (~> 1.6)
|
42
56
|
quickl (~> 0.4.3)
|
43
57
|
|
44
58
|
PATH
|
45
59
|
remote: ./alf-sql
|
46
60
|
specs:
|
47
|
-
alf-sql (0.
|
48
|
-
alf-core (
|
61
|
+
alf-sql (0.16.0)
|
62
|
+
alf-core (= 0.16.0)
|
49
63
|
sexpr (~> 0.6.0)
|
50
64
|
|
51
65
|
GEM
|
52
66
|
remote: http://rubygems.org/
|
53
67
|
specs:
|
68
|
+
backports (2.8.2)
|
69
|
+
citrus (2.4.1)
|
54
70
|
diff-lcs (1.2.4)
|
55
71
|
domain (1.0.0)
|
72
|
+
highline (1.6.20)
|
73
|
+
hike (1.2.3)
|
74
|
+
multi_json (1.8.2)
|
56
75
|
myrrha (3.0.0)
|
57
76
|
domain (~> 1.0)
|
58
77
|
path (1.3.3)
|
@@ -61,6 +80,9 @@ GEM
|
|
61
80
|
rack (1.5.2)
|
62
81
|
rack-accept (0.4.5)
|
63
82
|
rack (>= 0.4)
|
83
|
+
rack-protection (1.5.1)
|
84
|
+
rack
|
85
|
+
rack-robustness (1.1.0)
|
64
86
|
rake (10.1.0)
|
65
87
|
rspec (2.14.1)
|
66
88
|
rspec-core (~> 2.14.0)
|
@@ -71,9 +93,26 @@ GEM
|
|
71
93
|
diff-lcs (>= 1.1.3, < 2.0)
|
72
94
|
rspec-mocks (2.14.4)
|
73
95
|
ruby_cop (1.0.5)
|
74
|
-
sequel (4.
|
96
|
+
sequel (4.4.0)
|
75
97
|
sexpr (0.6.0)
|
98
|
+
sinatra (1.4.4)
|
99
|
+
rack (~> 1.4)
|
100
|
+
rack-protection (~> 1.4)
|
101
|
+
tilt (~> 1.3, >= 1.3.4)
|
102
|
+
sprockets (2.10.0)
|
103
|
+
hike (~> 1.2)
|
104
|
+
multi_json (~> 1.0)
|
105
|
+
rack (~> 1.0)
|
106
|
+
tilt (~> 1.1, != 1.3.0)
|
76
107
|
sqlite3 (1.3.8)
|
108
|
+
temple (0.6.7)
|
109
|
+
tilt (1.4.1)
|
110
|
+
wlang (2.2.3)
|
111
|
+
backports (~> 2.6)
|
112
|
+
citrus (~> 2.4.1)
|
113
|
+
path (~> 1.3)
|
114
|
+
quickl (~> 0.4.3)
|
115
|
+
temple (~> 0.6)
|
77
116
|
|
78
117
|
PLATFORMS
|
79
118
|
ruby
|
@@ -82,11 +121,18 @@ DEPENDENCIES
|
|
82
121
|
alf!
|
83
122
|
alf-core!
|
84
123
|
alf-rack!
|
124
|
+
alf-repl!
|
85
125
|
alf-sequel!
|
86
126
|
alf-shell!
|
87
127
|
alf-sql!
|
128
|
+
highline (~> 1.6)
|
88
129
|
jdbc-sqlite3 (~> 3.7)
|
89
130
|
pg (~> 0.14)
|
131
|
+
rack (~> 1.5)
|
132
|
+
rack-robustness (~> 1.1)
|
90
133
|
rake (~> 10.1)
|
91
134
|
rspec (~> 2.14)
|
135
|
+
sinatra (~> 1.4)
|
136
|
+
sprockets (~> 2.10)
|
92
137
|
sqlite3 (~> 1.3)
|
138
|
+
wlang (~> 2.2)
|
data/Rakefile
CHANGED
data/alf.gemspec
CHANGED
@@ -125,11 +125,12 @@ Gem::Specification.new do |s|
|
|
125
125
|
#
|
126
126
|
s.add_development_dependency("rake", "~> 10.1")
|
127
127
|
s.add_development_dependency("rspec", "~> 2.14")
|
128
|
-
s.add_dependency("alf-core", "~> 0.
|
129
|
-
s.add_dependency("alf-sql", "~> 0.
|
130
|
-
s.add_dependency("alf-sequel", "~> 0.
|
131
|
-
s.add_dependency("alf-shell", "~> 0.
|
132
|
-
s.add_dependency("alf-rack", "~> 0.
|
128
|
+
s.add_dependency("alf-core", "~> 0.16.0")
|
129
|
+
s.add_dependency("alf-sql", "~> 0.16.0")
|
130
|
+
s.add_dependency("alf-sequel", "~> 0.16.0")
|
131
|
+
s.add_dependency("alf-shell", "~> 0.16.0")
|
132
|
+
s.add_dependency("alf-rack", "~> 0.16.0")
|
133
|
+
s.add_dependency("alf-repl", "~> 0.16.0")
|
133
134
|
|
134
135
|
# The version of ruby required by this gem
|
135
136
|
#
|
data/alf.noespec
CHANGED
@@ -4,19 +4,23 @@ template-info:
|
|
4
4
|
manifest:
|
5
5
|
Gemfile:
|
6
6
|
safe-override: false
|
7
|
+
Gemfile.ci:
|
8
|
+
safe-override: false
|
7
9
|
tasks/spec_test.rake:
|
8
10
|
ignore: true
|
9
11
|
spec/spec_helper.rb:
|
10
12
|
ignore: true
|
11
13
|
spec/test___lower__.rb:
|
12
14
|
ignore: true
|
15
|
+
Rakefile:
|
16
|
+
safe-override: false
|
13
17
|
variables:
|
14
18
|
lower:
|
15
19
|
alf
|
16
20
|
upper:
|
17
21
|
Alf
|
18
22
|
version:
|
19
|
-
0.
|
23
|
+
0.16.0
|
20
24
|
summary: |-
|
21
25
|
Relational Algebra at your fingertips
|
22
26
|
description: |-
|
@@ -29,10 +33,11 @@ variables:
|
|
29
33
|
- http://rubygems.org/gems/alf
|
30
34
|
- http://rubydoc.info/gems/alf
|
31
35
|
dependencies:
|
32
|
-
- {name: alf-core, version: "~> 0.
|
33
|
-
- {name: alf-sql, version: "~> 0.
|
34
|
-
- {name: alf-sequel, version: "~> 0.
|
35
|
-
- {name: alf-shell, version: "~> 0.
|
36
|
-
- {name: alf-rack, version: "~> 0.
|
36
|
+
- {name: alf-core, version: "~> 0.16.0", groups: [runtime]}
|
37
|
+
- {name: alf-sql, version: "~> 0.16.0", groups: [runtime]}
|
38
|
+
- {name: alf-sequel, version: "~> 0.16.0", groups: [runtime]}
|
39
|
+
- {name: alf-shell, version: "~> 0.16.0", groups: [runtime]}
|
40
|
+
- {name: alf-rack, version: "~> 0.16.0", groups: [runtime]}
|
41
|
+
- {name: alf-repl, version: "~> 0.16.0", groups: [runtime]}
|
37
42
|
- {name: rake, version: "~> 10.1", groups: [test, release]}
|
38
43
|
- {name: rspec, version: "~> 2.14", groups: [test, release]}
|
data/lib/alf/loader.rb
CHANGED
data/lib/alf/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'test_helpers'
|
2
|
+
describe Alf, "the ability to define shortcut operators" do
|
3
|
+
|
4
|
+
class MyShortcutOperator
|
5
|
+
include Alf::Algebra::Shortcut
|
6
|
+
include Alf::Algebra::Unary
|
7
|
+
|
8
|
+
def expand
|
9
|
+
allbut(rename(operand, foo: :bar), [:bar])
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'works as expected' do
|
14
|
+
input = Relation(foo: 12, baz: 13)
|
15
|
+
expected = Relation(baz: 13)
|
16
|
+
input.my_shortcut_operator.should eq(expected)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/spec/facade/test_query.rb
CHANGED
@@ -9,4 +9,13 @@ describe Alf, "query" do
|
|
9
9
|
subject.heading.should eq(Heading(sid: String, name: String, status: Integer, city: String))
|
10
10
|
end
|
11
11
|
|
12
|
+
it 'should have all tuples of exact same class' do
|
13
|
+
clazz = nil
|
14
|
+
subject.each do |tuple|
|
15
|
+
clazz ||= tuple.class
|
16
|
+
tuple.class.object_id.should eq(clazz.object_id)
|
17
|
+
end
|
18
|
+
clazz.should_not be_nil
|
19
|
+
end
|
20
|
+
|
12
21
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{sid: "S1", name: "Smith"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'test_helpers'
|
2
|
+
module Alf
|
3
|
+
module Algebra
|
4
|
+
describe Image do
|
5
|
+
|
6
|
+
context 'on sap' do
|
7
|
+
|
8
|
+
subject{
|
9
|
+
db.connect do |c|
|
10
|
+
c.query{ image(suppliers, supplies, :supplying) }
|
11
|
+
end
|
12
|
+
}
|
13
|
+
|
14
|
+
it{ should be_a(Relation) }
|
15
|
+
|
16
|
+
it 'should have all suppliers' do
|
17
|
+
subject.size.should eq(5)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should have the supplying attr' do
|
21
|
+
subject.each do |tuple|
|
22
|
+
tuple.supplying.should be_a(Relation)
|
23
|
+
if tuple.sid == 'S5'
|
24
|
+
tuple.supplying.should be_empty
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -7,3 +7,10 @@
|
|
7
7
|
in Paris and in London, the minus simply returns the left operand. In
|
8
8
|
contrast, if we project first then the city information is lost and we
|
9
9
|
could restrict the left operand through common names, which is wrong.
|
10
|
+
- alf: |-
|
11
|
+
project(minus(suppliers, suppliers_in_paris), [])
|
12
|
+
optimized: |-
|
13
|
+
project(minus(suppliers, suppliers_in_paris), [])
|
14
|
+
comment: |-
|
15
|
+
This is NOT minus(project, project), cfr. counterexample provided by Kim
|
16
|
+
Mens project/master thesis at UCL.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'test_helpers'
|
2
|
+
describe Alf do
|
3
|
+
|
4
|
+
it 'should allow joining with an empty projection' do
|
5
|
+
db.connect do |conn|
|
6
|
+
rel = conn.query{ join(suppliers, project(suppliers, [])) }
|
7
|
+
exp = conn.query{ suppliers }
|
8
|
+
rel.should eq(exp)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -205,3 +205,22 @@
|
|
205
205
|
# joining from Relation::DEE
|
206
206
|
- alf: |-
|
207
207
|
join(Relation::DEE, suppliers)
|
208
|
+
# joining with Relation::DEE
|
209
|
+
- alf: |-
|
210
|
+
join(suppliers, Relation::DEE)
|
211
|
+
# joining with Relation::DEE-like
|
212
|
+
- alf: |-
|
213
|
+
join(suppliers, project(suppliers, []))
|
214
|
+
sql: |-
|
215
|
+
SELECT t1.sid, t1.name, t1.status, t1.city
|
216
|
+
FROM suppliers AS t1 WHERE EXISTS(
|
217
|
+
SELECT * FROM suppliers AS t2
|
218
|
+
)
|
219
|
+
# joining from Relation::DEE-like
|
220
|
+
- alf: |-
|
221
|
+
join(project(suppliers, []), suppliers)
|
222
|
+
sql: |-
|
223
|
+
SELECT t2.sid, t2.name, t2.status, t2.city
|
224
|
+
FROM suppliers AS t2 WHERE EXISTS(
|
225
|
+
SELECT * FROM suppliers AS t1
|
226
|
+
)
|
@@ -46,3 +46,21 @@
|
|
46
46
|
WHERE EXISTS(
|
47
47
|
SELECT TRUE AS is_table_dee
|
48
48
|
WHERE EXISTS(SELECT * FROM suppliers AS t1))
|
49
|
+
# projection of minus
|
50
|
+
- alf: |-
|
51
|
+
project(minus(suppliers, suppliers_in_london), [:sid])
|
52
|
+
sql: |-
|
53
|
+
WITH t3 AS (
|
54
|
+
(SELECT t1.sid, t1.name, t1.status, t1.city FROM suppliers AS t1)
|
55
|
+
EXCEPT
|
56
|
+
(SELECT t2.sid, t2.name, t2.status, t2.city FROM suppliers AS t2 WHERE t2.city = 'London')
|
57
|
+
) SELECT t3.sid FROM t3 AS t3
|
58
|
+
# empty projection of of minus
|
59
|
+
- alf: |-
|
60
|
+
project(minus(suppliers, suppliers_in_london), [])
|
61
|
+
sql: |-
|
62
|
+
WITH t3 AS (
|
63
|
+
(SELECT t1.sid, t1.name, t1.status, t1.city FROM suppliers AS t1)
|
64
|
+
EXCEPT
|
65
|
+
(SELECT t2.sid, t2.name, t2.status, t2.city FROM suppliers AS t2 WHERE t2.city = 'London')
|
66
|
+
) SELECT TRUE AS is_table_dee WHERE EXISTS(SELECT * FROM t3 AS t3)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'test_helpers'
|
2
|
+
describe Alf, "resulting type on coerce" do
|
3
|
+
|
4
|
+
it 'should use the coerced info' do
|
5
|
+
db.connect do |conn|
|
6
|
+
rel = conn.query{
|
7
|
+
project(coerce(suppliers, status: Integer), [:status])
|
8
|
+
}
|
9
|
+
exp = Relation[status: Integer]
|
10
|
+
rel.class.should eq(exp)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
data/tasks/mod.rake
CHANGED
@@ -47,4 +47,25 @@ namespace :mod do
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
desc "Display 'git status' on each sub-module"
|
51
|
+
task :status do
|
52
|
+
in_each_sub_module("git status") do |sub|
|
53
|
+
system "git status"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
desc "Run 'git reset --hard' on each sub-module"
|
58
|
+
task :'reset-hard' do
|
59
|
+
in_each_sub_module("git reset --hard") do |sub|
|
60
|
+
system "git reset --hard"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
desc "Display 'git diff' on each sub-module"
|
65
|
+
task :diff do
|
66
|
+
in_each_sub_module("git diff") do |sub|
|
67
|
+
system "git diff"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
50
71
|
end
|
data/tasks/release.rake
CHANGED
@@ -1,7 +1,51 @@
|
|
1
1
|
namespace :release do
|
2
2
|
|
3
|
+
desc "Bump the version number"
|
4
|
+
task :bump, :to do |t, args|
|
5
|
+
require 'path'
|
6
|
+
raise "Missing version number" unless to = args[:to]
|
7
|
+
in_each_sub_module("bump to #{to}") do |sub|
|
8
|
+
noespec = Path("alf-#{sub}.noespec")
|
9
|
+
content = noespec.read.gsub(/^ version:\n (.*?)\n/){|x|
|
10
|
+
" version:\n #{to}\n"
|
11
|
+
}
|
12
|
+
noespec.write(content)
|
13
|
+
system("noe go -s")
|
14
|
+
system("git commit -a -m 'Bump version to #{to}'")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "Set the CHANGELOG 'FIX ME' to the current date"
|
19
|
+
task :stamp do
|
20
|
+
require 'time'
|
21
|
+
require 'path'
|
22
|
+
require 'alf/version'
|
23
|
+
date = Time.now.strftime("%Y-%m-%d")
|
24
|
+
version = Alf::VERSION
|
25
|
+
cmd = "git commit -a -m 'Releasing #{version}'"
|
26
|
+
doit = ->{
|
27
|
+
clog = Path('CHANGELOG.md')
|
28
|
+
clog.write clog.read.gsub(/FIX ME/, date)
|
29
|
+
system(cmd)
|
30
|
+
}
|
31
|
+
in_each_sub_module("stamping CHANGELOG in") do |sub|
|
32
|
+
doit()
|
33
|
+
end
|
34
|
+
doit()
|
35
|
+
end
|
36
|
+
|
37
|
+
desc "Tag the version and push everything"
|
38
|
+
task :tag => :stamp do
|
39
|
+
require 'alf/version'
|
40
|
+
version = Alf::VERSION
|
41
|
+
cmd = "git tag v#{version} && git push origin master --tags"
|
42
|
+
in_each_sub_module("'git tag and push' in") do |sub|
|
43
|
+
system(cmd)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
3
47
|
desc "Create all gems, including in sub-modules"
|
4
|
-
task :gem do
|
48
|
+
task :gem => :doc do
|
5
49
|
cmd = "rm -rf pkg && rake gem"
|
6
50
|
in_each_sub_module("'rake gem' in") do |sub|
|
7
51
|
system(cmd)
|
@@ -22,7 +66,7 @@ namespace :release do
|
|
22
66
|
task :go => :gem do
|
23
67
|
require 'alf/version'
|
24
68
|
version = Alf::VERSION
|
25
|
-
cmd = "gem push pkg/*.gem
|
69
|
+
cmd = "gem push pkg/*.gem"
|
26
70
|
in_each_sub_module("'gem push & git tag' in") do |sub|
|
27
71
|
system(cmd)
|
28
72
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.
|
53
|
+
version: 0.16.0
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.16.0
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: alf-sql
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 0.16.0
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.
|
77
|
+
version: 0.16.0
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: alf-sequel
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.
|
85
|
+
version: 0.16.0
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 0.
|
93
|
+
version: 0.16.0
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: alf-shell
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - ~>
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 0.
|
101
|
+
version: 0.16.0
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 0.
|
109
|
+
version: 0.16.0
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: alf-rack
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
117
|
+
version: 0.16.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,23 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - ~>
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.
|
125
|
+
version: 0.16.0
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: alf-repl
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ~>
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 0.16.0
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ~>
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: 0.16.0
|
126
142
|
description: Alf brings a beautiful yet powerful relational algebra to the Shell and
|
127
143
|
to Ruby.
|
128
144
|
email:
|
@@ -146,11 +162,16 @@ files:
|
|
146
162
|
- Manifest.txt
|
147
163
|
- Rakefile
|
148
164
|
- README.md
|
165
|
+
- spec/dd-operators/test_shortcut_operator.rb
|
149
166
|
- spec/facade/test_query.rb
|
167
|
+
- spec/facade/test_tuple.rb
|
168
|
+
- spec/io/suppliers.rash
|
169
|
+
- spec/io/test_rash_loader.rb
|
150
170
|
- spec/key-inference/queries.yml
|
151
171
|
- spec/key-inference/test_all.rb
|
152
172
|
- spec/migrations/test_folder_migration.rb
|
153
173
|
- spec/migrations/test_sequel_migration.rb
|
174
|
+
- spec/operators/test_image.rb
|
154
175
|
- spec/operators/ungroup/grouped.json
|
155
176
|
- spec/operators/ungroup/test_on_json_content.rb
|
156
177
|
- spec/operators/unwrap/test_on_json_content.rb
|
@@ -176,6 +197,8 @@ files:
|
|
176
197
|
- spec/optimizer/restrict/sort.yml
|
177
198
|
- spec/optimizer/restrict/union.yml
|
178
199
|
- spec/optimizer/test_all.rb
|
200
|
+
- spec/regression/test_0001.rb
|
201
|
+
- spec/regression/test_0002.rb
|
179
202
|
- spec/sql/helpers.rb
|
180
203
|
- spec/sql/queries/01-leaf-operand.yml
|
181
204
|
- spec/sql/queries/02-clip.yml
|
@@ -197,6 +220,7 @@ files:
|
|
197
220
|
- spec/sql/test_sql_compiler.rb
|
198
221
|
- spec/test_alf.rb
|
199
222
|
- spec/test_helpers.rb
|
223
|
+
- spec/typing/test_typing_on_coerce.rb
|
200
224
|
- tasks/doc.rake
|
201
225
|
- tasks/fixtures.rake
|
202
226
|
- tasks/gem.rake
|
@@ -217,7 +241,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
217
241
|
version: '0'
|
218
242
|
segments:
|
219
243
|
- 0
|
220
|
-
hash:
|
244
|
+
hash: -1931769678054539313
|
221
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
246
|
none: false
|
223
247
|
requirements:
|
@@ -226,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
250
|
version: '0'
|
227
251
|
segments:
|
228
252
|
- 0
|
229
|
-
hash:
|
253
|
+
hash: -1931769678054539313
|
230
254
|
requirements: []
|
231
255
|
rubyforge_project:
|
232
256
|
rubygems_version: 1.8.25
|
@@ -234,11 +258,16 @@ signing_key:
|
|
234
258
|
specification_version: 3
|
235
259
|
summary: Relational Algebra at your fingertips
|
236
260
|
test_files:
|
261
|
+
- spec/dd-operators/test_shortcut_operator.rb
|
237
262
|
- spec/facade/test_query.rb
|
263
|
+
- spec/facade/test_tuple.rb
|
264
|
+
- spec/io/suppliers.rash
|
265
|
+
- spec/io/test_rash_loader.rb
|
238
266
|
- spec/key-inference/queries.yml
|
239
267
|
- spec/key-inference/test_all.rb
|
240
268
|
- spec/migrations/test_folder_migration.rb
|
241
269
|
- spec/migrations/test_sequel_migration.rb
|
270
|
+
- spec/operators/test_image.rb
|
242
271
|
- spec/operators/ungroup/grouped.json
|
243
272
|
- spec/operators/ungroup/test_on_json_content.rb
|
244
273
|
- spec/operators/unwrap/test_on_json_content.rb
|
@@ -264,6 +293,8 @@ test_files:
|
|
264
293
|
- spec/optimizer/restrict/sort.yml
|
265
294
|
- spec/optimizer/restrict/union.yml
|
266
295
|
- spec/optimizer/test_all.rb
|
296
|
+
- spec/regression/test_0001.rb
|
297
|
+
- spec/regression/test_0002.rb
|
267
298
|
- spec/sql/helpers.rb
|
268
299
|
- spec/sql/queries/01-leaf-operand.yml
|
269
300
|
- spec/sql/queries/02-clip.yml
|
@@ -285,3 +316,4 @@ test_files:
|
|
285
316
|
- spec/sql/test_sql_compiler.rb
|
286
317
|
- spec/test_alf.rb
|
287
318
|
- spec/test_helpers.rb
|
319
|
+
- spec/typing/test_typing_on_coerce.rb
|