alf 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +25 -0
- data/Gemfile +8 -8
- data/Gemfile.lock +22 -20
- data/Rakefile +1 -1
- data/alf.gemspec +31 -30
- data/alf.noespec +11 -9
- data/bin/alf +1 -1
- data/lib/alf/aggregator/avg.rb +39 -0
- data/lib/alf/aggregator/class_methods.rb +32 -14
- data/lib/alf/aggregator/collect.rb +32 -0
- data/lib/alf/aggregator/concat.rb +47 -0
- data/lib/alf/aggregator/count.rb +32 -0
- data/lib/alf/aggregator/{base.rb → instance_methods.rb} +54 -30
- data/lib/alf/aggregator/max.rb +32 -0
- data/lib/alf/aggregator/min.rb +32 -0
- data/lib/alf/aggregator/stddev.rb +25 -0
- data/lib/alf/aggregator/sum.rb +32 -0
- data/lib/alf/aggregator/variance.rb +45 -0
- data/lib/alf/aggregator.rb +51 -0
- data/lib/alf/environment/class_methods.rb +37 -35
- data/lib/alf/environment/folder.rb +26 -28
- data/lib/alf/environment/{base.rb → instance_methods.rb} +8 -19
- data/lib/alf/environment.rb +34 -0
- data/lib/alf/errors.rb +1 -0
- data/lib/alf/iterator/class_methods.rb +0 -2
- data/lib/alf/iterator/proxy.rb +7 -13
- data/lib/alf/iterator.rb +27 -0
- data/lib/alf/lispy/instance_methods.rb +14 -14
- data/lib/alf/lispy.rb +24 -0
- data/lib/alf/loader.rb +1 -1
- data/lib/alf/operator/binary.rb +4 -15
- data/lib/alf/operator/class_methods.rb +33 -83
- data/lib/alf/operator/instance_methods.rb +29 -0
- data/lib/alf/operator/non_relational/autonum.rb +17 -22
- data/lib/alf/operator/non_relational/clip.rb +18 -18
- data/lib/alf/operator/non_relational/coerce.rb +17 -19
- data/lib/alf/operator/non_relational/compact.rb +13 -57
- data/lib/alf/operator/non_relational/defaults.rb +20 -23
- data/lib/alf/operator/non_relational/generator.rb +14 -32
- data/lib/alf/operator/non_relational/sort.rb +16 -20
- data/lib/alf/operator/nullary.rb +0 -9
- data/lib/alf/operator/relational/extend.rb +17 -22
- data/lib/alf/operator/relational/group.rb +16 -27
- data/lib/alf/operator/relational/heading.rb +15 -25
- data/lib/alf/operator/relational/intersect.rb +14 -33
- data/lib/alf/operator/relational/join.rb +15 -103
- data/lib/alf/operator/relational/matching.rb +15 -42
- data/lib/alf/operator/relational/minus.rb +14 -33
- data/lib/alf/operator/relational/not_matching.rb +15 -42
- data/lib/alf/operator/relational/project.rb +20 -20
- data/lib/alf/operator/relational/quota.rb +19 -47
- data/lib/alf/operator/relational/rank.rb +19 -52
- data/lib/alf/operator/relational/rename.rb +16 -17
- data/lib/alf/operator/relational/restrict.rb +16 -18
- data/lib/alf/operator/relational/summarize.rb +19 -75
- data/lib/alf/operator/relational/ungroup.rb +16 -22
- data/lib/alf/operator/relational/union.rb +17 -29
- data/lib/alf/operator/relational/unwrap.rb +17 -19
- data/lib/alf/operator/relational/wrap.rb +18 -20
- data/lib/alf/operator/signature.rb +67 -96
- data/lib/alf/operator/unary.rb +4 -26
- data/lib/alf/operator.rb +68 -0
- data/lib/alf/reader/alf_file.rb +5 -5
- data/lib/alf/reader/class_methods.rb +47 -38
- data/lib/alf/reader/{base.rb → instance_methods.rb} +18 -40
- data/lib/alf/reader/rash.rb +3 -3
- data/lib/alf/reader.rb +37 -0
- data/lib/alf/relation/instance_methods.rb +17 -37
- data/lib/alf/relation.rb +28 -0
- data/lib/alf/renderer/{base.rb → instance_methods.rb} +13 -30
- data/lib/alf/renderer.rb +32 -0
- data/lib/alf/tools/coerce.rb +18 -7
- data/lib/alf/tools/miscellaneous.rb +56 -29
- data/lib/alf/tools/to_lispy.rb +37 -40
- data/lib/alf/tools/to_ruby_literal.rb +24 -7
- data/lib/alf/tools/tuple_handle.rb +27 -17
- data/lib/alf/tools.rb +14 -0
- data/lib/alf/types/attr_list.rb +135 -31
- data/lib/alf/types/attr_name.rb +56 -18
- data/lib/alf/types/boolean.rb +18 -5
- data/lib/alf/types/heading.rb +83 -59
- data/lib/alf/types/ordering.rb +117 -64
- data/lib/alf/types/renaming.rb +73 -33
- data/lib/alf/types/size.rb +57 -0
- data/lib/alf/types/summarization.rb +105 -43
- data/lib/alf/types/tuple_computation.rb +113 -38
- data/lib/alf/types/tuple_expression.rb +122 -31
- data/lib/alf/types/tuple_predicate.rb +64 -40
- data/lib/alf/types.rb +49 -0
- data/lib/alf/version.rb +6 -6
- data/lib/alf-csv/alf/csv/commons.rb +36 -0
- data/lib/alf-csv/alf/csv/reader.rb +33 -0
- data/lib/alf-csv/alf/csv/renderer.rb +38 -0
- data/lib/alf-csv/alf/csv.rb +3 -0
- data/lib/alf-engine/alf/engine/aggregate.rb +44 -0
- data/lib/alf-engine/alf/engine/autonum.rb +45 -0
- data/lib/{alf/operator → alf-engine/alf/engine}/cesure.rb +13 -13
- data/lib/alf-engine/alf/engine/clip.rb +53 -0
- data/lib/alf-engine/alf/engine/coerce.rb +46 -0
- data/lib/alf-engine/alf/engine/cog.rb +7 -0
- data/lib/alf-engine/alf/engine/compact/set.rb +23 -0
- data/lib/alf-engine/alf/engine/compact/uniq.rb +23 -0
- data/lib/alf-engine/alf/engine/compact.rb +26 -0
- data/lib/alf-engine/alf/engine/concat.rb +25 -0
- data/lib/alf-engine/alf/engine/defaults.rb +43 -0
- data/lib/alf-engine/alf/engine/filter.rb +41 -0
- data/lib/alf-engine/alf/engine/generator.rb +50 -0
- data/lib/alf-engine/alf/engine/group/hash.rb +40 -0
- data/lib/alf-engine/alf/engine/group.rb +7 -0
- data/lib/alf-engine/alf/engine/join/hash.rb +35 -0
- data/lib/alf-engine/alf/engine/join.rb +7 -0
- data/lib/alf-engine/alf/engine/materialize/array.rb +78 -0
- data/lib/alf-engine/alf/engine/materialize/hash.rb +122 -0
- data/lib/alf-engine/alf/engine/materialize.rb +8 -0
- data/lib/alf-engine/alf/engine/quota/cesure.rb +46 -0
- data/lib/alf-engine/alf/engine/quota.rb +7 -0
- data/lib/alf-engine/alf/engine/rank/cesure.rb +48 -0
- data/lib/alf-engine/alf/engine/rank.rb +7 -0
- data/lib/alf-engine/alf/engine/rename.rb +39 -0
- data/lib/alf-engine/alf/engine/semi/hash.rb +39 -0
- data/lib/alf-engine/alf/engine/semi.rb +7 -0
- data/lib/alf-engine/alf/engine/set_attr.rb +46 -0
- data/lib/alf-engine/alf/engine/sort/in_memory.rb +39 -0
- data/lib/alf-engine/alf/engine/sort.rb +28 -0
- data/lib/alf-engine/alf/engine/summarize/cesure.rb +51 -0
- data/lib/alf-engine/alf/engine/summarize/hash.rb +35 -0
- data/lib/alf-engine/alf/engine/summarize.rb +8 -0
- data/lib/alf-engine/alf/engine/ungroup.rb +29 -0
- data/lib/alf-engine/alf/engine/unwrap.rb +31 -0
- data/lib/alf-engine/alf/engine/wrap.rb +39 -0
- data/lib/alf-engine/alf/engine.rb +25 -0
- data/lib/{alf/extra/logs.rb → alf-logs/alf/logs/reader.rb} +14 -16
- data/lib/alf-logs/alf/logs.rb +1 -0
- data/lib/alf-sequel/alf/sequel/environment.rb +57 -0
- data/lib/alf-sequel/alf/sequel/iterator.rb +21 -0
- data/lib/alf-sequel/alf/sequel.rb +2 -0
- data/lib/{alf → alf-shell/alf/shell}/command/exec.rb +3 -4
- data/lib/{alf → alf-shell/alf/shell}/command/help.rb +3 -4
- data/lib/alf-shell/alf/shell/command/main/class_methods.rb +46 -0
- data/lib/{alf → alf-shell/alf/shell}/command/main.rb +9 -51
- data/lib/{alf → alf-shell/alf/shell}/command/show.rb +5 -7
- data/lib/alf-shell/alf/shell/command.rb +26 -0
- data/lib/{alf/command → alf-shell/alf/shell}/doc_manager.rb +3 -3
- data/lib/alf-shell/alf/shell/operator.rb +86 -0
- data/lib/alf-shell/alf/shell.rb +40 -0
- data/lib/{alf/extra/yaml.rb → alf-yaml/alf/yaml/renderer.rb} +5 -7
- data/lib/alf-yaml/alf/yaml.rb +1 -0
- data/lib/alf.rb +17 -358
- data/spec/{unit → integration}/lispy/test_relation.rb +0 -0
- data/spec/{unit → integration}/lispy/test_run.rb +0 -0
- data/spec/{unit → integration}/lispy/test_tuple.rb +0 -0
- data/spec/integration/{command → shell}/alf/alf.db +0 -0
- data/spec/integration/{command → shell}/alf/alf_e.cmd +0 -0
- data/spec/integration/{command → shell}/alf/alf_e.stdout +0 -0
- data/spec/integration/shell/alf/alf_env.cmd +1 -0
- data/spec/integration/{command → shell}/alf/alf_env.stdout +0 -0
- data/spec/integration/shell/alf/alf_env_sqlite.cmd +1 -0
- data/spec/integration/{command → shell}/alf/alf_env_sqlite.stdout +0 -0
- data/spec/integration/{command → shell}/alf/alf_help.cmd +0 -0
- data/spec/integration/{command → shell}/alf/alf_help.stdout +0 -0
- data/spec/integration/{command → shell}/alf/alf_implicit.alf +0 -0
- data/spec/integration/shell/alf/alf_implicit_exec.cmd +1 -0
- data/spec/integration/{command → shell}/alf/alf_implicit_exec.stdout +0 -0
- data/spec/integration/{command → shell}/alf/alf_r.cmd +0 -0
- data/spec/integration/{command → shell}/alf/alf_r.stdout +0 -0
- data/spec/integration/{command → shell}/alf/alf_version.cmd +0 -0
- data/spec/integration/{command → shell}/alf/alf_version.stdout +0 -0
- data/spec/integration/{command → shell}/alf/alf_yaml.cmd +0 -0
- data/spec/integration/{command → shell}/alf/alf_yaml.stdout +0 -0
- data/spec/integration/{command → shell}/alf/rel.rash +0 -0
- data/spec/integration/{command → shell}/autonum/autonum_0.cmd +0 -0
- data/spec/integration/{command → shell}/autonum/autonum_0.stdout +0 -0
- data/spec/integration/shell/autonum/autonum_1.cmd +1 -0
- data/spec/integration/{command → shell}/autonum/autonum_1.stdout +0 -0
- data/spec/integration/shell/clip/clip_0.cmd +1 -0
- data/spec/integration/{command → shell}/clip/clip_0.stdout +0 -0
- data/spec/integration/shell/clip/clip_1.cmd +1 -0
- data/spec/integration/{command → shell}/clip/clip_1.stdout +0 -0
- data/spec/integration/{command → shell}/coerce/coerce_1.cmd +0 -0
- data/spec/integration/{command → shell}/coerce/coerce_1.stdout +0 -0
- data/spec/integration/{command → shell}/compact/compact_0.cmd +0 -0
- data/spec/integration/{command → shell}/compact/compact_0.stdout +0 -0
- data/spec/integration/{command → shell}/defaults/defaults_0.cmd +0 -0
- data/spec/integration/{command → shell}/defaults/defaults_0.stdout +0 -0
- data/spec/integration/{command → shell}/defaults/defaults_1.cmd +0 -0
- data/spec/integration/{command → shell}/defaults/defaults_1.stdout +0 -0
- data/spec/integration/{command → shell}/defaults/defaults_2.cmd +0 -0
- data/spec/integration/{command → shell}/defaults/defaults_2.stdout +0 -0
- data/spec/integration/{command → shell}/extend/extend_0.cmd +0 -0
- data/spec/integration/{command → shell}/extend/extend_0.stdout +0 -0
- data/spec/integration/{command → shell}/generator/generator_1.cmd +0 -0
- data/spec/integration/{command → shell}/generator/generator_1.stdout +0 -0
- data/spec/integration/{command → shell}/generator/generator_2.cmd +0 -0
- data/spec/integration/{command → shell}/generator/generator_2.stdout +0 -0
- data/spec/integration/{command → shell}/generator/generator_3.cmd +0 -0
- data/spec/integration/{command → shell}/generator/generator_3.stdout +0 -0
- data/spec/integration/{command → shell}/group/group_0.cmd +0 -0
- data/spec/integration/{command → shell}/group/group_0.stdout +0 -0
- data/spec/integration/{command → shell}/group/group_1.cmd +0 -0
- data/spec/integration/{command → shell}/group/group_1.stdout +0 -0
- data/spec/integration/{command → shell}/help/help_1.cmd +0 -0
- data/spec/integration/{command → shell}/help/help_1.stdout +0 -0
- data/spec/integration/{command → shell}/intersect/intersect_0.cmd +0 -0
- data/spec/integration/{command → shell}/intersect/intersect_0.stdout +0 -0
- data/spec/integration/{command → shell}/join/join_0.cmd +0 -0
- data/spec/integration/{command → shell}/join/join_0.stdout +0 -0
- data/spec/integration/{command → shell}/matching/matching_0.cmd +0 -0
- data/spec/integration/{command → shell}/matching/matching_0.stdout +0 -0
- data/spec/integration/{command → shell}/minus/minus_0.cmd +0 -0
- data/spec/integration/{command → shell}/minus/minus_0.stdout +0 -0
- data/spec/integration/{command → shell}/not-matching/not-matching_0.cmd +0 -0
- data/spec/integration/{command → shell}/not-matching/not-matching_0.stdout +0 -0
- data/spec/integration/{command → shell}/project/project_0.cmd +0 -0
- data/spec/integration/{command → shell}/project/project_0.stdout +0 -0
- data/spec/integration/{command → shell}/project/project_1.cmd +0 -0
- data/spec/integration/{command → shell}/project/project_1.stdout +0 -0
- data/spec/integration/{command → shell}/quota/quota_0.cmd +0 -0
- data/spec/integration/{command → shell}/quota/quota_0.stdout +0 -0
- data/spec/integration/{command → shell}/rank/rank_1.cmd +0 -0
- data/spec/integration/{command → shell}/rank/rank_1.stdout +1 -1
- data/spec/integration/{command → shell}/rank/rank_2.cmd +0 -0
- data/spec/integration/{command → shell}/rank/rank_2.stdout +1 -1
- data/spec/integration/{command → shell}/rank/rank_3.cmd +0 -0
- data/spec/integration/{command → shell}/rank/rank_3.stdout +0 -0
- data/spec/integration/{command → shell}/rank/rank_4.cmd +0 -0
- data/spec/integration/{command → shell}/rank/rank_4.stdout +0 -0
- data/spec/integration/{command → shell}/rank/rank_5.cmd +0 -0
- data/spec/integration/{command → shell}/rank/rank_5.stdout +0 -0
- data/spec/integration/{command → shell}/rename/rename_0.cmd +0 -0
- data/spec/integration/{command → shell}/rename/rename_0.stdout +0 -0
- data/spec/integration/{command → shell}/restrict/restrict_0.cmd +0 -0
- data/spec/integration/{command → shell}/restrict/restrict_0.stdout +0 -0
- data/spec/integration/{command → shell}/restrict/restrict_1.cmd +0 -0
- data/spec/integration/{command → shell}/restrict/restrict_1.stdout +0 -0
- data/spec/integration/{command → shell}/show/show_base.cmd +0 -0
- data/spec/integration/{command → shell}/show/show_base.stdout +0 -0
- data/spec/integration/{command → shell}/show/show_base_sort_1.cmd +0 -0
- data/spec/integration/{command → shell}/show/show_base_sort_1.stdout +0 -0
- data/spec/integration/{command → shell}/show/show_base_sort_2.cmd +0 -0
- data/spec/integration/{command → shell}/show/show_base_sort_2.stdout +0 -0
- data/spec/integration/{command → shell}/show/show_conflictual.cmd +0 -0
- data/spec/integration/{command → shell}/show/show_conflictual.stdout +0 -0
- data/spec/integration/{command → shell}/show/show_csv.cmd +0 -0
- data/spec/integration/{command → shell}/show/show_csv.stdout +0 -0
- data/spec/integration/{command → shell}/show/show_ff.cmd +0 -0
- data/spec/integration/{command → shell}/show/show_ff.stdout +0 -0
- data/spec/integration/{command → shell}/show/show_rash.cmd +0 -0
- data/spec/integration/{command → shell}/show/show_rash.stdout +0 -0
- data/spec/integration/{command → shell}/show/show_rash_pretty.cmd +0 -0
- data/spec/integration/{command → shell}/show/show_rash_pretty.stdout +0 -0
- data/spec/integration/{command → shell}/show/show_yaml.cmd +0 -0
- data/spec/integration/{command → shell}/show/show_yaml.stdout +0 -0
- data/spec/integration/{command → shell}/sort/sort_0.cmd +0 -0
- data/spec/integration/{command → shell}/sort/sort_0.stdout +0 -0
- data/spec/integration/{command → shell}/sort/sort_1.cmd +0 -0
- data/spec/integration/{command → shell}/sort/sort_1.stdout +0 -0
- data/spec/integration/{command → shell}/sort/sort_2.cmd +0 -0
- data/spec/integration/{command → shell}/sort/sort_2.stdout +0 -0
- data/spec/integration/{command → shell}/sort/sort_3.cmd +0 -0
- data/spec/integration/{command → shell}/sort/sort_3.stdout +0 -0
- data/spec/integration/{command → shell}/summarize/summarize_0.cmd +0 -0
- data/spec/integration/{command → shell}/summarize/summarize_0.stdout +0 -0
- data/spec/integration/{command → shell}/ungroup/ungroup_0.cmd +0 -0
- data/spec/integration/{command → shell}/ungroup/ungroup_0.stdout +0 -0
- data/spec/integration/{command → shell}/union/union_0.cmd +0 -0
- data/spec/integration/{command → shell}/union/union_0.stdout +0 -0
- data/spec/integration/{command → shell}/unwrap/unwrap_0.cmd +0 -0
- data/spec/integration/{command → shell}/unwrap/unwrap_0.stdout +0 -0
- data/spec/integration/{command → shell}/wrap/wrap_0.cmd +0 -0
- data/spec/integration/{command → shell}/wrap/wrap_0.stdout +0 -0
- data/spec/{unit → integration}/test_lispy.rb +0 -0
- data/spec/integration/{test_command.rb → test_shell.rb} +3 -3
- data/spec/regression/heading/test_heading_with_date.rb +1 -1
- data/spec/shared/a_valid_type_implementation.rb +47 -0
- data/spec/shared/an_operator_class.rb +2 -6
- data/spec/spec_helper.rb +9 -1
- data/spec/unit/alf-core/aggregator/test_avg.rb +22 -0
- data/spec/unit/alf-core/aggregator/test_collect.rb +25 -0
- data/spec/unit/alf-core/aggregator/test_concat.rb +31 -0
- data/spec/unit/alf-core/aggregator/test_count.rb +17 -0
- data/spec/unit/alf-core/aggregator/test_max.rb +23 -0
- data/spec/unit/alf-core/aggregator/test_min.rb +23 -0
- data/spec/unit/alf-core/aggregator/test_stddev.rb +27 -0
- data/spec/unit/alf-core/aggregator/test_sum.rb +23 -0
- data/spec/unit/alf-core/aggregator/test_variance.rb +29 -0
- data/spec/unit/{assumptions → alf-core/assumptions}/test_file.rb +0 -0
- data/spec/unit/{assumptions → alf-core/assumptions}/test_instance_eval.rb +0 -0
- data/spec/unit/{assumptions → alf-core/assumptions}/test_scoping.rb +0 -0
- data/spec/unit/{assumptions → alf-core/assumptions}/test_set.rb +0 -0
- data/spec/unit/{environment → alf-core/environment}/examples/suppliers.rash +0 -0
- data/spec/unit/alf-core/environment/test_folder.rb +53 -0
- data/spec/unit/{operator → alf-core/operator}/non_relational/test_autonum.rb +18 -31
- data/spec/unit/alf-core/operator/non_relational/test_clip.rb +35 -0
- data/spec/unit/{operator → alf-core/operator}/non_relational/test_coerce.rb +11 -17
- data/spec/unit/{operator/non_relational/compact/test_sort_based.rb → alf-core/operator/non_relational/test_compact.rb} +16 -14
- data/spec/unit/{operator → alf-core/operator}/non_relational/test_defaults.rb +17 -32
- data/spec/unit/{operator → alf-core/operator}/non_relational/test_generator.rb +21 -39
- data/spec/unit/{operator → alf-core/operator}/non_relational/test_sort.rb +20 -26
- data/spec/unit/{operator → alf-core/operator}/relational/test_extend.rb +8 -14
- data/spec/unit/{operator → alf-core/operator}/relational/test_group.rb +12 -28
- data/spec/unit/alf-core/operator/relational/test_heading.rb +27 -0
- data/spec/unit/{operator → alf-core/operator}/relational/test_intersect.rb +22 -22
- data/spec/unit/{operator → alf-core/operator}/relational/test_join.rb +7 -7
- data/spec/unit/{operator → alf-core/operator}/relational/test_minus.rb +23 -23
- data/spec/unit/alf-core/operator/relational/test_project.rb +62 -0
- data/spec/unit/{operator → alf-core/operator}/relational/test_quota.rb +8 -15
- data/spec/unit/alf-core/operator/relational/test_rank.rb +48 -0
- data/spec/unit/{operator → alf-core/operator}/relational/test_rename.rb +8 -14
- data/spec/unit/alf-core/operator/relational/test_restrict.rb +45 -0
- data/spec/unit/{operator → alf-core/operator}/relational/test_summarize.rb +13 -31
- data/spec/unit/{operator → alf-core/operator}/relational/test_ungroup.rb +9 -15
- data/spec/unit/{operator → alf-core/operator}/relational/test_union.rb +11 -11
- data/spec/unit/{operator → alf-core/operator}/relational/test_unwrap.rb +10 -16
- data/spec/unit/{operator → alf-core/operator}/relational/test_wrap.rb +10 -16
- data/spec/unit/alf-core/operator/signature/test_argv2args.rb +82 -0
- data/spec/unit/alf-core/operator/signature/test_collect_on.rb +38 -0
- data/spec/unit/{operator → alf-core/operator}/signature/test_initialize.rb +0 -0
- data/spec/unit/{operator → alf-core/operator}/signature/test_install.rb +0 -0
- data/spec/unit/{operator → alf-core/operator}/signature/test_option_parser.rb +0 -0
- data/spec/unit/alf-core/operator/signature/test_parse_args.rb +90 -0
- data/spec/unit/{operator → alf-core/operator}/signature/test_to_lispy.rb +0 -0
- data/spec/unit/{operator → alf-core/operator}/signature/test_to_shell.rb +0 -0
- data/spec/unit/{operator → alf-core/operator}/test_non_relational.rb +0 -0
- data/spec/unit/{operator → alf-core/operator}/test_relational.rb +0 -0
- data/spec/unit/{reader → alf-core/reader}/input.rb +0 -0
- data/spec/unit/{reader → alf-core/reader}/test_alf_file.rb +0 -0
- data/spec/unit/{reader → alf-core/reader}/test_initialize.rb +0 -0
- data/spec/unit/alf-core/reader/test_looks_a_path.rb +20 -0
- data/spec/unit/{reader → alf-core/reader}/test_rash.rb +0 -0
- data/spec/unit/{relation → alf-core/relation}/test_coerce.rb +0 -0
- data/spec/unit/{relation → alf-core/relation}/test_inspect.rb +0 -0
- data/spec/unit/{relation → alf-core/relation}/test_relops.rb +0 -0
- data/spec/unit/{relation → alf-core/relation}/test_to_a.rb +0 -0
- data/spec/unit/{renderer → alf-core/renderer}/test_initialize.rb +0 -0
- data/spec/unit/alf-core/test_aggregator.rb +58 -0
- data/spec/unit/{test_environment.rb → alf-core/test_environment.rb} +8 -21
- data/spec/unit/{test_operator.rb → alf-core/test_operator.rb} +0 -0
- data/spec/unit/{test_reader.rb → alf-core/test_reader.rb} +0 -0
- data/spec/unit/{test_relation.rb → alf-core/test_relation.rb} +0 -0
- data/spec/unit/{test_renderer.rb → alf-core/test_renderer.rb} +0 -0
- data/spec/unit/{text → alf-core/text}/test_cell.rb +0 -0
- data/spec/unit/{text → alf-core/text}/test_row.rb +0 -0
- data/spec/unit/{text → alf-core/text}/test_table.rb +0 -0
- data/spec/unit/alf-core/tools/test_class_name.rb +16 -0
- data/spec/unit/{tools → alf-core/tools}/test_coalesce.rb +6 -2
- data/spec/unit/alf-core/tools/test_coerce.rb +16 -0
- data/spec/unit/alf-core/tools/test_ruby_case.rb +16 -0
- data/spec/unit/{tools → alf-core/tools}/test_to_lispy.rb +14 -7
- data/spec/unit/{tools → alf-core/tools}/test_to_ruby_literal.rb +5 -5
- data/spec/unit/{tools → alf-core/tools}/test_tuple_handle.rb +14 -14
- data/spec/unit/alf-core/tools/test_tuple_heading.rb +15 -0
- data/spec/unit/{tools → alf-core/tools}/test_varargs.rb +9 -6
- data/spec/unit/alf-core/types/test_attr_list.rb +188 -0
- data/spec/unit/alf-core/types/test_attr_name.rb +78 -0
- data/spec/unit/{types/test_attr_name.rb → alf-core/types/test_boolean.rb} +18 -28
- data/spec/unit/alf-core/types/test_class_methods.rb +24 -0
- data/spec/unit/alf-core/types/test_heading.rb +146 -0
- data/spec/unit/alf-core/types/test_ordering.rb +185 -0
- data/spec/unit/alf-core/types/test_renaming.rb +72 -0
- data/spec/unit/alf-core/types/test_size.rb +74 -0
- data/spec/unit/{types → alf-core/types}/test_summarization.rb +46 -14
- data/spec/unit/{types → alf-core/types}/test_tuple_computation.rb +46 -10
- data/spec/unit/alf-core/types/test_tuple_expression.rb +122 -0
- data/spec/unit/{types → alf-core/types}/test_tuple_predicate.rb +51 -22
- data/spec/unit/{csv → alf-csv}/input.csv +0 -0
- data/spec/unit/{csv → alf-csv}/test_reader.rb +0 -0
- data/spec/unit/{csv → alf-csv}/test_renderer.rb +1 -1
- data/spec/unit/alf-engine/compact/test_set.rb +33 -0
- data/spec/unit/alf-engine/compact/test_uniq.rb +33 -0
- data/spec/unit/alf-engine/group/test_hash.rb +34 -0
- data/spec/unit/{operator/relational/join/test_hash_based.rb → alf-engine/join/test_hash.rb} +21 -29
- data/spec/unit/alf-engine/materialize/test_array.rb +28 -0
- data/spec/unit/alf-engine/materialize/test_hash.rb +76 -0
- data/spec/unit/alf-engine/quota/test_cesure.rb +34 -0
- data/spec/unit/{operator/relational/test_rank.rb → alf-engine/rank/test_cesure.rb} +21 -24
- data/spec/unit/alf-engine/semi/test_hash.rb +58 -0
- data/spec/unit/alf-engine/sort/test_in_memory.rb +32 -0
- data/spec/unit/{operator/relational/summarize/test_hash_based.rb → alf-engine/summarize/test_cesure.rb} +15 -21
- data/spec/unit/{operator/relational/summarize/test_sort_based.rb → alf-engine/summarize/test_hash.rb} +15 -21
- data/spec/unit/alf-engine/test_aggregate.rb +26 -0
- data/spec/unit/alf-engine/test_autonum.rb +24 -0
- data/spec/unit/alf-engine/test_clip.rb +34 -0
- data/spec/unit/alf-engine/test_coerce.rb +35 -0
- data/spec/unit/alf-engine/test_compact.rb +33 -0
- data/spec/unit/alf-engine/test_concat.rb +38 -0
- data/spec/unit/alf-engine/test_defaults.rb +37 -0
- data/spec/unit/alf-engine/test_filter.rb +23 -0
- data/spec/unit/alf-engine/test_generator.rb +25 -0
- data/spec/unit/alf-engine/test_rename.rb +24 -0
- data/spec/unit/alf-engine/test_set_attr.rb +38 -0
- data/spec/unit/alf-engine/test_sort.rb +32 -0
- data/spec/unit/alf-engine/test_ungroup.rb +28 -0
- data/spec/unit/alf-engine/test_unwrap.rb +20 -0
- data/spec/unit/alf-engine/test_wrap.rb +26 -0
- data/spec/unit/{logs → alf-logs}/apache_combined.log +0 -0
- data/spec/unit/{logs → alf-logs}/postgresql.log +0 -0
- data/spec/unit/{logs → alf-logs}/test_reader.rb +15 -16
- data/spec/unit/{sequel → alf-sequel}/alf.db +0 -0
- data/spec/unit/alf-sequel/test_environment.rb +69 -0
- data/spec/unit/{command → alf-shell}/doc_manager/dynamic.md +0 -0
- data/spec/unit/{command → alf-shell}/doc_manager/example.md +0 -0
- data/spec/unit/{command → alf-shell}/doc_manager/example_1.txt +0 -0
- data/spec/unit/{command → alf-shell}/doc_manager/static.md +0 -0
- data/spec/unit/{command → alf-shell}/doc_manager/test_call.rb +2 -3
- data/spec/unit/alf-shell/main/test_class_methods.rb +44 -0
- data/spec/unit/alf-shell/operator/test_autonum.rb +28 -0
- data/spec/unit/alf-shell/operator/test_clip.rb +29 -0
- data/spec/unit/alf-shell/operator/test_coerce.rb +21 -0
- data/spec/unit/alf-shell/operator/test_compact.rb +16 -0
- data/spec/unit/alf-shell/operator/test_defaults.rb +29 -0
- data/spec/unit/alf-shell/operator/test_extend.rb +21 -0
- data/spec/unit/alf-shell/operator/test_generator.rb +37 -0
- data/spec/unit/alf-shell/operator/test_group.rb +32 -0
- data/spec/unit/alf-shell/operator/test_heading.rb +16 -0
- data/spec/unit/alf-shell/operator/test_intersect.rb +18 -0
- data/spec/unit/alf-shell/operator/test_join.rb +18 -0
- data/spec/unit/alf-shell/operator/test_matching.rb +18 -0
- data/spec/unit/alf-shell/operator/test_minus.rb +18 -0
- data/spec/unit/alf-shell/operator/test_not_matching.rb +18 -0
- data/spec/unit/alf-shell/operator/test_project.rb +38 -0
- data/spec/unit/alf-shell/operator/test_quota.rb +23 -0
- data/spec/unit/alf-shell/operator/test_rank.rb +30 -0
- data/spec/unit/alf-shell/operator/test_rename.rb +21 -0
- data/spec/unit/alf-shell/operator/test_restrict.rb +35 -0
- data/spec/unit/alf-shell/operator/test_sort.rb +49 -0
- data/spec/unit/alf-shell/operator/test_summarize.rb +30 -0
- data/spec/unit/alf-shell/operator/test_ungroup.rb +28 -0
- data/spec/unit/alf-shell/operator/test_union.rb +18 -0
- data/spec/unit/alf-shell/operator/test_unwrap.rb +28 -0
- data/spec/unit/alf-shell/operator/test_wrap.rb +30 -0
- data/tasks/debug_mail.rake +42 -45
- data/tasks/gem.rake +13 -13
- data/tasks/gh-pages.rake +11 -6
- data/tasks/integration_test.rake +0 -8
- data/tasks/regression_test.rake +0 -8
- data/tasks/unit_test.rake +0 -8
- data/tasks/yard.rake +13 -13
- metadata +909 -1107
- data/examples/hitradio/compact.rb +0 -48
- data/examples/hitradio/compare1.rb +0 -28
- data/examples/hitradio/gz_reader.rb +0 -23
- data/examples/hitradio/hitradio-1.alf +0 -1
- data/examples/hitradio/hitradio.log +0 -25080
- data/examples/hitradio/hitradio.mar +0 -25081
- data/examples/hitradio/hitradio.mar.gz +0 -0
- data/examples/hitradio/hitradio.rash +0 -25080
- data/examples/hitradio/mar_reader.rb +0 -18
- data/examples/northwind/customers.csv +0 -92
- data/examples/northwind/northwind.db +0 -0
- data/examples/northwind/orders.csv +0 -831
- data/lib/alf/aggregator/aggregators.rb +0 -105
- data/lib/alf/aggregator/aggregators.rbc +0 -2640
- data/lib/alf/aggregator/base.rbc +0 -1055
- data/lib/alf/aggregator/class_methods.rbc +0 -830
- data/lib/alf/buffer/sorted.rb +0 -48
- data/lib/alf/buffer/sorted.rbc +0 -715
- data/lib/alf/command/class_methods.rb +0 -27
- data/lib/alf/command/class_methods.rbc +0 -453
- data/lib/alf/command/doc_manager.rbc +0 -1604
- data/lib/alf/command/exec.rbc +0 -408
- data/lib/alf/command/help.rbc +0 -764
- data/lib/alf/command/main.rbc +0 -3612
- data/lib/alf/command/show.rbc +0 -1327
- data/lib/alf/environment/base.rbc +0 -459
- data/lib/alf/environment/class_methods.rbc +0 -1110
- data/lib/alf/environment/explicit.rb +0 -38
- data/lib/alf/environment/explicit.rbc +0 -601
- data/lib/alf/environment/folder.rbc +0 -942
- data/lib/alf/errors.rbc +0 -155
- data/lib/alf/extra/csv.rb +0 -107
- data/lib/alf/extra/csv.rbc +0 -2021
- data/lib/alf/extra/logs.rbc +0 -1957
- data/lib/alf/extra/sequel.rb +0 -77
- data/lib/alf/extra/sequel.rbc +0 -1417
- data/lib/alf/extra/yaml.rbc +0 -435
- data/lib/alf/extra.rb +0 -5
- data/lib/alf/extra.rbc +0 -101
- data/lib/alf/iterator/base.rb +0 -38
- data/lib/alf/iterator/base.rbc +0 -437
- data/lib/alf/iterator/class_methods.rbc +0 -518
- data/lib/alf/iterator/proxy.rbc +0 -599
- data/lib/alf/lispy/instance_methods.rbc +0 -2535
- data/lib/alf/loader.rbc +0 -85
- data/lib/alf/operator/base.rb +0 -74
- data/lib/alf/operator/base.rbc +0 -860
- data/lib/alf/operator/binary.rbc +0 -595
- data/lib/alf/operator/cesure.rbc +0 -883
- data/lib/alf/operator/class_methods.rbc +0 -1915
- data/lib/alf/operator/experimental.rbc +0 -200
- data/lib/alf/operator/non_relational/autonum.rbc +0 -587
- data/lib/alf/operator/non_relational/clip.rbc +0 -522
- data/lib/alf/operator/non_relational/coerce.rbc +0 -596
- data/lib/alf/operator/non_relational/compact.rbc +0 -1283
- data/lib/alf/operator/non_relational/defaults.rbc +0 -733
- data/lib/alf/operator/non_relational/generator.rbc +0 -1015
- data/lib/alf/operator/non_relational/sort.rbc +0 -665
- data/lib/alf/operator/nullary.rbc +0 -404
- data/lib/alf/operator/relational/extend.rbc +0 -616
- data/lib/alf/operator/relational/group.rbc +0 -968
- data/lib/alf/operator/relational/heading.rbc +0 -657
- data/lib/alf/operator/relational/intersect.rbc +0 -969
- data/lib/alf/operator/relational/join.rbc +0 -1708
- data/lib/alf/operator/relational/matching.rbc +0 -1047
- data/lib/alf/operator/relational/minus.rbc +0 -965
- data/lib/alf/operator/relational/not_matching.rbc +0 -1047
- data/lib/alf/operator/relational/project.rbc +0 -669
- data/lib/alf/operator/relational/quota.rbc +0 -1193
- data/lib/alf/operator/relational/rank.rbc +0 -1217
- data/lib/alf/operator/relational/rename.rbc +0 -496
- data/lib/alf/operator/relational/restrict.rbc +0 -611
- data/lib/alf/operator/relational/summarize.rbc +0 -1922
- data/lib/alf/operator/relational/ungroup.rbc +0 -643
- data/lib/alf/operator/relational/union.rbc +0 -846
- data/lib/alf/operator/relational/unwrap.rbc +0 -540
- data/lib/alf/operator/relational/wrap.rbc +0 -560
- data/lib/alf/operator/shortcut.rb +0 -53
- data/lib/alf/operator/shortcut.rbc +0 -809
- data/lib/alf/operator/signature.rbc +0 -4640
- data/lib/alf/operator/transform.rb +0 -27
- data/lib/alf/operator/transform.rbc +0 -484
- data/lib/alf/operator/unary.rbc +0 -629
- data/lib/alf/reader/alf_file.rbc +0 -464
- data/lib/alf/reader/base.rbc +0 -1613
- data/lib/alf/reader/class_methods.rbc +0 -1099
- data/lib/alf/reader/rash.rbc +0 -583
- data/lib/alf/relation/class_methods.rbc +0 -674
- data/lib/alf/relation/instance_methods.rbc +0 -2107
- data/lib/alf/renderer/base.rbc +0 -936
- data/lib/alf/renderer/class_methods.rbc +0 -875
- data/lib/alf/renderer/rash.rbc +0 -802
- data/lib/alf/renderer/text.rbc +0 -5530
- data/lib/alf/tools/coerce.rbc +0 -352
- data/lib/alf/tools/miscellaneous.rbc +0 -1497
- data/lib/alf/tools/to_lispy.rbc +0 -2618
- data/lib/alf/tools/to_ruby_literal.rbc +0 -344
- data/lib/alf/tools/tuple_handle.rbc +0 -738
- data/lib/alf/types/attr_list.rbc +0 -1535
- data/lib/alf/types/attr_name.rbc +0 -781
- data/lib/alf/types/boolean.rbc +0 -365
- data/lib/alf/types/heading.rbc +0 -1778
- data/lib/alf/types/ordering.rbc +0 -2228
- data/lib/alf/types/renaming.rbc +0 -1064
- data/lib/alf/types/summarization.rbc +0 -1394
- data/lib/alf/types/tuple_computation.rbc +0 -1061
- data/lib/alf/types/tuple_expression.rbc +0 -1016
- data/lib/alf/types/tuple_predicate.rbc +0 -1349
- data/lib/alf/version.rbc +0 -350
- data/lib/alf.rbc +0 -3884
- data/spec/integration/command/alf/alf_env.cmd +0 -1
- data/spec/integration/command/alf/alf_env_sqlite.cmd +0 -1
- data/spec/integration/command/alf/alf_implicit_exec.cmd +0 -1
- data/spec/integration/command/autonum/autonum_1.cmd +0 -1
- data/spec/integration/command/clip/clip_0.cmd +0 -1
- data/spec/integration/command/clip/clip_1.cmd +0 -1
- data/spec/integration/command/show/show_rash_2.cmd +0 -1
- data/spec/integration/command/show/show_rash_2.stdout +0 -5
- data/spec/integration/test_alf.rbc +0 -1098
- data/spec/integration/test_command.rbc +0 -1832
- data/spec/integration/test_examples.rbc +0 -559
- data/spec/integration/test_semantics.rbc +0 -991
- data/spec/regression/alf_file/test___FILE__.rbc +0 -524
- data/spec/regression/heading/test_heading_with_date.rbc +0 -381
- data/spec/regression/lispy/test_compile.rbc +0 -404
- data/spec/regression/logs/test_path_attribute.rbc +0 -687
- data/spec/regression/relation/test_relation_allbut_all.rbc +0 -468
- data/spec/regression/relation/test_relation_with_date.rbc +0 -381
- data/spec/regression/restrict/test_restrict_with_keywords.rbc +0 -628
- data/spec/shared/a_value.rbc +0 -337
- data/spec/shared/an_operator_class.rbc +0 -908
- data/spec/spec_helper.rbc +0 -453
- data/spec/unit/assumptions/test_file.rbc +0 -668
- data/spec/unit/assumptions/test_instance_eval.rbc +0 -654
- data/spec/unit/assumptions/test_scoping.rbc +0 -755
- data/spec/unit/assumptions/test_set.rbc +0 -1928
- data/spec/unit/command/doc_manager/test_call.rbc +0 -1537
- data/spec/unit/csv/test_reader.rbc +0 -2228
- data/spec/unit/csv/test_renderer.rbc +0 -2426
- data/spec/unit/environment/test_explicit.rb +0 -15
- data/spec/unit/environment/test_explicit.rbc +0 -464
- data/spec/unit/environment/test_folder.rb +0 -35
- data/spec/unit/environment/test_folder.rbc +0 -1304
- data/spec/unit/lispy/test_relation.rbc +0 -1477
- data/spec/unit/lispy/test_run.rbc +0 -1735
- data/spec/unit/lispy/test_tuple.rbc +0 -1686
- data/spec/unit/logs/test_reader.rbc +0 -1807
- data/spec/unit/operator/non_relational/compact/test_buffer_based.rb +0 -30
- data/spec/unit/operator/non_relational/compact/test_buffer_based.rbc +0 -1127
- data/spec/unit/operator/non_relational/compact/test_sort_based.rbc +0 -1127
- data/spec/unit/operator/non_relational/test_autonum.rbc +0 -1969
- data/spec/unit/operator/non_relational/test_clip.rb +0 -49
- data/spec/unit/operator/non_relational/test_clip.rbc +0 -1850
- data/spec/unit/operator/non_relational/test_coerce.rbc +0 -1290
- data/spec/unit/operator/non_relational/test_compact.rb +0 -38
- data/spec/unit/operator/non_relational/test_compact.rbc +0 -1382
- data/spec/unit/operator/non_relational/test_defaults.rbc +0 -2319
- data/spec/unit/operator/non_relational/test_generator.rbc +0 -2361
- data/spec/unit/operator/non_relational/test_sort.rbc +0 -2583
- data/spec/unit/operator/relational/join/test_hash_based.rbc +0 -2481
- data/spec/unit/operator/relational/matching/test_hash_based.rb +0 -60
- data/spec/unit/operator/relational/matching/test_hash_based.rbc +0 -2458
- data/spec/unit/operator/relational/not_matching/test_hash_based.rb +0 -37
- data/spec/unit/operator/relational/not_matching/test_hash_based.rbc +0 -1632
- data/spec/unit/operator/relational/summarize/test_hash_based.rbc +0 -1990
- data/spec/unit/operator/relational/summarize/test_sort_based.rbc +0 -1990
- data/spec/unit/operator/relational/test_extend.rbc +0 -1300
- data/spec/unit/operator/relational/test_group.rbc +0 -2142
- data/spec/unit/operator/relational/test_intersect.rbc +0 -2069
- data/spec/unit/operator/relational/test_join.rbc +0 -1282
- data/spec/unit/operator/relational/test_minus.rbc +0 -1995
- data/spec/unit/operator/relational/test_project.rb +0 -75
- data/spec/unit/operator/relational/test_project.rbc +0 -2870
- data/spec/unit/operator/relational/test_quota.rbc +0 -1788
- data/spec/unit/operator/relational/test_rank.rbc +0 -2079
- data/spec/unit/operator/relational/test_rename.rbc +0 -1158
- data/spec/unit/operator/relational/test_restrict.rb +0 -56
- data/spec/unit/operator/relational/test_restrict.rbc +0 -2305
- data/spec/unit/operator/relational/test_summarize.rbc +0 -2570
- data/spec/unit/operator/relational/test_ungroup.rbc +0 -1425
- data/spec/unit/operator/relational/test_union.rbc +0 -1089
- data/spec/unit/operator/relational/test_unwrap.rbc +0 -1176
- data/spec/unit/operator/relational/test_wrap.rbc +0 -1203
- data/spec/unit/operator/signature/test_collect_on.rb +0 -45
- data/spec/unit/operator/signature/test_collect_on.rbc +0 -1989
- data/spec/unit/operator/signature/test_initialize.rbc +0 -544
- data/spec/unit/operator/signature/test_install.rbc +0 -1671
- data/spec/unit/operator/signature/test_option_parser.rbc +0 -1348
- data/spec/unit/operator/signature/test_parse_args.rb +0 -60
- data/spec/unit/operator/signature/test_parse_args.rbc +0 -1908
- data/spec/unit/operator/signature/test_parse_argv.rb +0 -87
- data/spec/unit/operator/signature/test_parse_argv.rbc +0 -2878
- data/spec/unit/operator/signature/test_to_lispy.rbc +0 -3305
- data/spec/unit/operator/signature/test_to_shell.rbc +0 -3327
- data/spec/unit/operator/test_non_relational.rbc +0 -571
- data/spec/unit/operator/test_relational.rbc +0 -758
- data/spec/unit/reader/test_alf_file.rbc +0 -1107
- data/spec/unit/reader/test_initialize.rbc +0 -1774
- data/spec/unit/reader/test_rash.rbc +0 -1127
- data/spec/unit/relation/test_coerce.rbc +0 -2320
- data/spec/unit/relation/test_inspect.rbc +0 -502
- data/spec/unit/relation/test_relops.rbc +0 -1585
- data/spec/unit/relation/test_to_a.rbc +0 -1112
- data/spec/unit/renderer/test_initialize.rbc +0 -1766
- data/spec/unit/sequel/test_environment.rb +0 -54
- data/spec/unit/sequel/test_environment.rbc +0 -1723
- data/spec/unit/test_aggregator.rb +0 -109
- data/spec/unit/test_aggregator.rbc +0 -4358
- data/spec/unit/test_environment.rbc +0 -1271
- data/spec/unit/test_lispy.rbc +0 -879
- data/spec/unit/test_operator.rbc +0 -531
- data/spec/unit/test_reader.rbc +0 -1249
- data/spec/unit/test_relation.rbc +0 -2588
- data/spec/unit/test_renderer.rbc +0 -2011
- data/spec/unit/text/test_cell.rbc +0 -1532
- data/spec/unit/text/test_row.rbc +0 -847
- data/spec/unit/text/test_table.rbc +0 -978
- data/spec/unit/tools/test_coalesce.rbc +0 -456
- data/spec/unit/tools/test_coerce.rb +0 -10
- data/spec/unit/tools/test_coerce.rbc +0 -279
- data/spec/unit/tools/test_to_lispy.rbc +0 -5711
- data/spec/unit/tools/test_to_ruby_literal.rbc +0 -272
- data/spec/unit/tools/test_tools.rb +0 -25
- data/spec/unit/tools/test_tools.rbc +0 -672
- data/spec/unit/tools/test_tuple_handle.rbc +0 -1591
- data/spec/unit/tools/test_tuple_heading.rb +0 -20
- data/spec/unit/tools/test_tuple_heading.rbc +0 -821
- data/spec/unit/tools/test_varargs.rbc +0 -495
- data/spec/unit/types/heading/test_union.rb +0 -21
- data/spec/unit/types/heading/test_union.rbc +0 -1043
- data/spec/unit/types/test_attr_list.rb +0 -106
- data/spec/unit/types/test_attr_list.rbc +0 -4481
- data/spec/unit/types/test_attr_name.rbc +0 -1872
- data/spec/unit/types/test_heading.rb +0 -48
- data/spec/unit/types/test_heading.rbc +0 -1735
- data/spec/unit/types/test_ordering.rb +0 -127
- data/spec/unit/types/test_ordering.rbc +0 -3695
- data/spec/unit/types/test_renaming.rb +0 -55
- data/spec/unit/types/test_renaming.rbc +0 -2426
- data/spec/unit/types/test_summarization.rbc +0 -2538
- data/spec/unit/types/test_tuple_computation.rbc +0 -2340
- data/spec/unit/types/test_tuple_expression.rb +0 -64
- data/spec/unit/types/test_tuple_expression.rbc +0 -2285
- data/spec/unit/types/test_tuple_predicate.rbc +0 -3168
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
# 0.11.0 / FIX ME
|
2
|
+
|
3
|
+
## Broken APIs (private sections only)
|
4
|
+
|
5
|
+
* All pipe() methods have been removed and replaced by arguments taken at
|
6
|
+
construction time. This affects the implementation of operators and may
|
7
|
+
require changes to contributed readers and renderers.
|
8
|
+
* Alf::Operator::Base -> Alf::Operator::InstanceMethods
|
9
|
+
* Alf::Reader::Base -> Alf::Reader::InstanceMethods
|
10
|
+
* Alf::Rendered::Base -> Alf::Rendered::InstanceMethods
|
11
|
+
* Alf::Environment::Base -> Alf::Environment::InstanceMethods
|
12
|
+
* Alf::Aggregator::Base -> Alf::Aggregator::InstanceMethods
|
13
|
+
* Alf::Buffer has been removed as well as the Sorted specialization.
|
14
|
+
* Alf::Environment::Explicit has been removed as well as associated tools.
|
15
|
+
* Ordering#order_of has been removed
|
16
|
+
* Ordering#order_by has been removed
|
17
|
+
* Alf::Tools.coerce now raise a Alf::CoercionError instead of a Myrrha::Error
|
18
|
+
in case of coercion failure
|
19
|
+
|
20
|
+
## On the development side
|
21
|
+
|
22
|
+
* Bumped ruby.noe to 1.7.0
|
23
|
+
* Bumped rspec to 2.8.0
|
24
|
+
* Bumped sequel to 3.30.0
|
25
|
+
|
1
26
|
# 0.10.1 / 2011-08-31
|
2
27
|
|
3
28
|
## Miscellaneous enhancements
|
data/Gemfile
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
group :runtime do
|
4
|
-
gem "quickl", "~> 0.4.
|
4
|
+
gem "quickl", "~> 0.4.2"
|
5
5
|
gem "myrrha", "~> 1.2.1"
|
6
|
-
gem "
|
6
|
+
gem "backports", "~> 2.3.0"
|
7
7
|
end
|
8
8
|
|
9
9
|
group :test do
|
10
10
|
gem "rake", "~> 0.9.2"
|
11
|
-
gem "rspec", "~> 2.
|
11
|
+
gem "rspec", "~> 2.8.0"
|
12
12
|
end
|
13
13
|
|
14
14
|
group :release do
|
15
15
|
gem "rake", "~> 0.9.2"
|
16
|
-
gem "rspec", "~> 2.
|
16
|
+
gem "rspec", "~> 2.8.0"
|
17
17
|
gem "wlang", "~> 0.10.2"
|
18
18
|
end
|
19
19
|
|
20
20
|
group :doc do
|
21
21
|
gem "yard", "~> 0.7.2"
|
22
|
-
gem "bluecloth", "~> 2.
|
23
|
-
gem "redcarpet", "~> 1.
|
22
|
+
gem "bluecloth", "~> 2.2.0"
|
23
|
+
gem "redcarpet", "~> 2.1.0"
|
24
24
|
end
|
25
25
|
|
26
26
|
group :extra do
|
27
27
|
gem "fastercsv", "~> 1.5.4"
|
28
28
|
gem "request-log-analyzer", "~> 1.11.0"
|
29
|
-
gem "sequel", "~> 3.
|
29
|
+
gem "sequel", "~> 3.30"
|
30
30
|
gem "sqlite3", "~> 1.3.0"
|
31
|
+
gem "highline", "~> 1.6.2"
|
31
32
|
end
|
32
|
-
|
data/Gemfile.lock
CHANGED
@@ -1,43 +1,45 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
4
|
+
backports (2.3.0)
|
5
|
+
bluecloth (2.2.0)
|
5
6
|
diff-lcs (1.1.3)
|
6
7
|
fastercsv (1.5.4)
|
7
|
-
highline (1.6.
|
8
|
+
highline (1.6.11)
|
8
9
|
myrrha (1.2.1)
|
9
|
-
quickl (0.4.
|
10
|
-
rake (0.9.2)
|
11
|
-
redcarpet (1.
|
10
|
+
quickl (0.4.2)
|
11
|
+
rake (0.9.2.2)
|
12
|
+
redcarpet (2.1.0)
|
12
13
|
request-log-analyzer (1.11.1)
|
13
|
-
rspec (2.
|
14
|
-
rspec-core (~> 2.
|
15
|
-
rspec-expectations (~> 2.
|
16
|
-
rspec-mocks (~> 2.
|
17
|
-
rspec-core (2.
|
18
|
-
rspec-expectations (2.
|
14
|
+
rspec (2.8.0)
|
15
|
+
rspec-core (~> 2.8.0)
|
16
|
+
rspec-expectations (~> 2.8.0)
|
17
|
+
rspec-mocks (~> 2.8.0)
|
18
|
+
rspec-core (2.8.0)
|
19
|
+
rspec-expectations (2.8.0)
|
19
20
|
diff-lcs (~> 1.1.2)
|
20
|
-
rspec-mocks (2.
|
21
|
-
sequel (3.
|
22
|
-
sqlite3 (1.3.
|
21
|
+
rspec-mocks (2.8.0)
|
22
|
+
sequel (3.31.0)
|
23
|
+
sqlite3 (1.3.5)
|
23
24
|
wlang (0.10.2)
|
24
|
-
yard (0.7.
|
25
|
+
yard (0.7.4)
|
25
26
|
|
26
27
|
PLATFORMS
|
27
28
|
java
|
28
29
|
ruby
|
29
30
|
|
30
31
|
DEPENDENCIES
|
31
|
-
|
32
|
+
backports (~> 2.3.0)
|
33
|
+
bluecloth (~> 2.2.0)
|
32
34
|
fastercsv (~> 1.5.4)
|
33
35
|
highline (~> 1.6.2)
|
34
36
|
myrrha (~> 1.2.1)
|
35
|
-
quickl (~> 0.4.
|
37
|
+
quickl (~> 0.4.2)
|
36
38
|
rake (~> 0.9.2)
|
37
|
-
redcarpet (~> 1.
|
39
|
+
redcarpet (~> 2.1.0)
|
38
40
|
request-log-analyzer (~> 1.11.0)
|
39
|
-
rspec (~> 2.
|
40
|
-
sequel (~> 3.
|
41
|
+
rspec (~> 2.8.0)
|
42
|
+
sequel (~> 3.30)
|
41
43
|
sqlite3 (~> 1.3.0)
|
42
44
|
wlang (~> 0.10.2)
|
43
45
|
yard (~> 0.7.2)
|
data/Rakefile
CHANGED
data/alf.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# We require your library, mainly to have access to the VERSION number.
|
1
|
+
# We require your library, mainly to have access to the VERSION number.
|
2
2
|
# Feel free to set $version manually.
|
3
3
|
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
4
4
|
require "alf/version"
|
@@ -9,15 +9,15 @@ $version = Alf::Version.to_s
|
|
9
9
|
# should be correctly packaged given what you have described in the .noespec file.
|
10
10
|
#
|
11
11
|
Gem::Specification.new do |s|
|
12
|
-
|
12
|
+
|
13
13
|
################################################################### ABOUT YOUR GEM
|
14
|
-
|
15
|
-
# Gem name (required)
|
14
|
+
|
15
|
+
# Gem name (required)
|
16
16
|
s.name = "alf"
|
17
|
-
|
17
|
+
|
18
18
|
# Gem version (required)
|
19
19
|
s.version = $version
|
20
|
-
|
20
|
+
|
21
21
|
# A short summary of this gem
|
22
22
|
#
|
23
23
|
# This is displayed in `gem list -d`.
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
# The description should be more detailed than the summary. For example,
|
29
29
|
# you might wish to copy the entire README into the description.
|
30
30
|
s.description = "Alf brings the relational algebra both in Shell and in Ruby. In Shell, because \nmanipulating any relation-like data source should be as straightforward as a \none-liner. In Ruby, because I've never understood why programming languages \nprovide data structures like arrays, hashes, sets, trees and graphs but not \n_relations_... Let's stop the segregation ;-)"
|
31
|
-
|
31
|
+
|
32
32
|
# The URL of this gem home page (optional)
|
33
33
|
s.homepage = "http://blambeau.github.com/alf"
|
34
34
|
|
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
|
|
38
38
|
# you know what you do!
|
39
39
|
#
|
40
40
|
# s.date = Time.now.strftime('%Y-%m-%d')
|
41
|
-
|
41
|
+
|
42
42
|
# The license(s) for the library. Each license must be a short name, no
|
43
43
|
# more than 64 characters.
|
44
44
|
#
|
@@ -49,35 +49,35 @@ Gem::Specification.new do |s|
|
|
49
49
|
# s.rubyforge_project = nil
|
50
50
|
|
51
51
|
################################################################### ABOUT THE AUTHORS
|
52
|
-
|
52
|
+
|
53
53
|
# The list of author names who wrote this gem.
|
54
54
|
#
|
55
55
|
# If you are providing multiple authors and multiple emails they should be
|
56
56
|
# in the same order.
|
57
|
-
#
|
57
|
+
#
|
58
58
|
s.authors = ["Bernard Lambeau"]
|
59
|
-
|
59
|
+
|
60
60
|
# Contact emails for this gem
|
61
61
|
#
|
62
62
|
# If you are providing multiple authors and multiple emails they should be
|
63
63
|
# in the same order.
|
64
64
|
#
|
65
|
-
# NOTE: Somewhat strangly this attribute is always singular!
|
65
|
+
# NOTE: Somewhat strangly this attribute is always singular!
|
66
66
|
# Don't replace by s.emails = ...
|
67
67
|
s.email = ["blambeau@gmail.com"]
|
68
68
|
|
69
69
|
################################################################### PATHS, FILES, BINARIES
|
70
|
-
|
71
|
-
# Paths in the gem to add to $LOAD_PATH when this gem is
|
70
|
+
|
71
|
+
# Paths in the gem to add to $LOAD_PATH when this gem is
|
72
72
|
# activated (required).
|
73
73
|
#
|
74
74
|
# The default 'lib' is typically sufficient.
|
75
75
|
s.require_paths = ["lib"]
|
76
|
-
|
76
|
+
|
77
77
|
# Files included in this gem.
|
78
78
|
#
|
79
79
|
# By default, we take all files included in the Manifest.txt file on root
|
80
|
-
# of the project. Entries of the manifest are interpreted as Dir[...]
|
80
|
+
# of the project. Entries of the manifest are interpreted as Dir[...]
|
81
81
|
# patterns so that lazy people may use wilcards like lib/**/*
|
82
82
|
#
|
83
83
|
here = File.expand_path(File.dirname(__FILE__))
|
@@ -107,7 +107,7 @@ Gem::Specification.new do |s|
|
|
107
107
|
# <= Less than or equal to
|
108
108
|
# ~> Approximately greater than
|
109
109
|
#
|
110
|
-
# Don't forget to have a look at http://lmgtfy.com/?q=Ruby+Versioning+Policies
|
110
|
+
# Don't forget to have a look at http://lmgtfy.com/?q=Ruby+Versioning+Policies
|
111
111
|
# for setting your gem version.
|
112
112
|
#
|
113
113
|
# For your requirements to other gems, remember that
|
@@ -119,23 +119,24 @@ Gem::Specification.new do |s|
|
|
119
119
|
|
120
120
|
#
|
121
121
|
# One call to add_dependency('gem_name', 'gem version requirement') for each
|
122
|
-
# runtime dependency. These gems will be installed with your gem.
|
122
|
+
# runtime dependency. These gems will be installed with your gem.
|
123
123
|
# One call to add_development_dependency('gem_name', 'gem version requirement')
|
124
124
|
# for each development dependency. These gems are required for developers
|
125
125
|
#
|
126
126
|
s.add_development_dependency("rake", "~> 0.9.2")
|
127
|
-
s.add_development_dependency("rspec", "~> 2.
|
127
|
+
s.add_development_dependency("rspec", "~> 2.8.0")
|
128
128
|
s.add_development_dependency("wlang", "~> 0.10.2")
|
129
129
|
s.add_development_dependency("yard", "~> 0.7.2")
|
130
|
-
s.add_development_dependency("bluecloth", "~> 2.
|
131
|
-
s.add_development_dependency("redcarpet", "~> 1.
|
130
|
+
s.add_development_dependency("bluecloth", "~> 2.2.0")
|
131
|
+
s.add_development_dependency("redcarpet", "~> 2.1.0")
|
132
132
|
s.add_development_dependency("fastercsv", "~> 1.5.4")
|
133
133
|
s.add_development_dependency("request-log-analyzer", "~> 1.11.0")
|
134
|
-
s.add_development_dependency("sequel", "~> 3.
|
134
|
+
s.add_development_dependency("sequel", "~> 3.30")
|
135
135
|
s.add_development_dependency("sqlite3", "~> 1.3.0")
|
136
|
-
s.
|
136
|
+
s.add_development_dependency("highline", "~> 1.6.2")
|
137
|
+
s.add_dependency("quickl", "~> 0.4.2")
|
137
138
|
s.add_dependency("myrrha", "~> 1.2.1")
|
138
|
-
s.add_dependency("
|
139
|
+
s.add_dependency("backports", "~> 2.3.0")
|
139
140
|
|
140
141
|
# The version of ruby required by this gem
|
141
142
|
#
|
@@ -151,18 +152,18 @@ Gem::Specification.new do |s|
|
|
151
152
|
#
|
152
153
|
# s.platform = nil
|
153
154
|
|
154
|
-
# Extensions to build when installing the gem.
|
155
|
+
# Extensions to build when installing the gem.
|
155
156
|
#
|
156
|
-
# Valid types of extensions are extconf.rb files, configure scripts
|
157
|
+
# Valid types of extensions are extconf.rb files, configure scripts
|
157
158
|
# and rakefiles or mkrf_conf files.
|
158
159
|
#
|
159
160
|
s.extensions = []
|
160
|
-
|
161
|
-
# External (to RubyGems) requirements that must be met for this gem to work.
|
161
|
+
|
162
|
+
# External (to RubyGems) requirements that must be met for this gem to work.
|
162
163
|
# It’s simply information for the user.
|
163
164
|
#
|
164
165
|
s.requirements = nil
|
165
|
-
|
166
|
+
|
166
167
|
# A message that gets displayed after the gem is installed
|
167
168
|
#
|
168
169
|
# Uncomment and set this if you want to say something to the user
|
@@ -180,7 +181,7 @@ Gem::Specification.new do |s|
|
|
180
181
|
# details.
|
181
182
|
#
|
182
183
|
# s.cert_chain = []
|
183
|
-
|
184
|
+
|
184
185
|
################################################################### RDOC
|
185
186
|
|
186
187
|
# An ARGV style array of options to RDoc
|
data/alf.noespec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
template-info:
|
2
2
|
name: "ruby"
|
3
|
-
version: 1.
|
3
|
+
version: 1.7.0
|
4
4
|
manifest:
|
5
5
|
tasks/spec_test.rake:
|
6
6
|
ignore: true
|
@@ -10,13 +10,15 @@ template-info:
|
|
10
10
|
safe-override: false
|
11
11
|
tasks/debug_mail.txt:
|
12
12
|
safe-override: false
|
13
|
+
lib/__lower__/loader.rb:
|
14
|
+
ignore: true
|
13
15
|
variables:
|
14
16
|
lower:
|
15
17
|
alf
|
16
18
|
upper:
|
17
19
|
Alf
|
18
20
|
version:
|
19
|
-
0.
|
21
|
+
0.11.0
|
20
22
|
summary: |-
|
21
23
|
Relational Algebra at your fingertips
|
22
24
|
description: |-
|
@@ -33,18 +35,18 @@ variables:
|
|
33
35
|
- http://rubygems.org/gems/alf
|
34
36
|
- http://rubydoc.info/gems/alf
|
35
37
|
dependencies:
|
36
|
-
- {name: quickl, version: "~> 0.4.
|
38
|
+
- {name: quickl, version: "~> 0.4.2", groups: [runtime ]}
|
37
39
|
- {name: myrrha, version: "~> 1.2.1", groups: [runtime ]}
|
38
|
-
- {name:
|
40
|
+
- {name: backports, version: "~> 2.3.0", groups: [runtime ]}
|
39
41
|
- {name: rake, version: "~> 0.9.2", groups: [test, release]}
|
40
|
-
- {name: rspec, version: "~> 2.
|
42
|
+
- {name: rspec, version: "~> 2.8.0", groups: [test, release]}
|
41
43
|
- {name: wlang, version: "~> 0.10.2", groups: [release ]}
|
42
|
-
#- {name: rcov, version: "~> 0.9.9", groups: [doc ]}
|
43
44
|
- {name: yard, version: "~> 0.7.2", groups: [doc ]}
|
44
|
-
- {name: bluecloth, version: "~> 2.
|
45
|
-
- {name: redcarpet, version: "~> 1.
|
45
|
+
- {name: bluecloth, version: "~> 2.2.0", groups: [doc ]}
|
46
|
+
- {name: redcarpet, version: "~> 2.1.0", groups: [doc ]}
|
46
47
|
- {name: fastercsv, version: "~> 1.5.4", groups: [extra ]}
|
47
48
|
- {name: request-log-analyzer, version: "~> 1.11.0", groups: [extra]}
|
48
|
-
- {name: sequel, version: "~> 3.
|
49
|
+
- {name: sequel, version: "~> 3.30", groups: [extra ]}
|
49
50
|
- {name: sqlite3, version: "~> 1.3.0", groups: [extra ]}
|
51
|
+
- {name: highline, version: "~> 1.6.2", groups: [extra ]}
|
50
52
|
|
data/bin/alf
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
module Alf
|
2
|
+
class Aggregator
|
3
|
+
#
|
4
|
+
# Defines a `avg()` aggregation operator.
|
5
|
+
#
|
6
|
+
# Example:
|
7
|
+
#
|
8
|
+
# # direct ruby usage
|
9
|
+
# Alf::Aggregator.avg{ qty }.aggregate(...)
|
10
|
+
#
|
11
|
+
# # lispy
|
12
|
+
# (summarize :supplies, [:sid], :avg => avg{ qty })
|
13
|
+
#
|
14
|
+
class Avg < Aggregator
|
15
|
+
|
16
|
+
# Returns [0.0, 0.0] as least value.
|
17
|
+
#
|
18
|
+
# @see Aggregator::InstanceMethods#least
|
19
|
+
def least()
|
20
|
+
[0.0, 0.0]
|
21
|
+
end
|
22
|
+
|
23
|
+
# Aggregates on a tuple occurence.
|
24
|
+
#
|
25
|
+
# @see Aggregator::InstanceMethods#_happens
|
26
|
+
def _happens(memo, val)
|
27
|
+
[memo.first + val, memo.last + 1]
|
28
|
+
end
|
29
|
+
|
30
|
+
# Finalizes the computation.
|
31
|
+
#
|
32
|
+
# @see Aggregator::InstanceMethods#finalize
|
33
|
+
def finalize(memo)
|
34
|
+
memo.first / memo.last
|
35
|
+
end
|
36
|
+
|
37
|
+
end # class Avg
|
38
|
+
end # class Aggregator
|
39
|
+
end # module Alf
|
@@ -1,30 +1,42 @@
|
|
1
1
|
module Alf
|
2
2
|
class Aggregator
|
3
|
+
#
|
4
|
+
# This module installs class-level utilities of Alf's aggregators.
|
5
|
+
#
|
6
|
+
# Subclasses of Aggregator are automatically tracked so as to add
|
7
|
+
# factory methods on the Aggregator class itself. Example:
|
8
|
+
#
|
9
|
+
# class Sum < Aggregate # will give a method Aggregator.sum
|
10
|
+
# ...
|
11
|
+
# end
|
12
|
+
# Aggregator.sum{ size }
|
13
|
+
#
|
14
|
+
# All registered aggregators are available under `Aggregator.aggregators`
|
15
|
+
# Those aggregators may also be iterated as follows:
|
16
|
+
#
|
17
|
+
# Alf::Aggregator.each do |agg_class|
|
18
|
+
#
|
19
|
+
# # agg_class is a subclass of Aggregator
|
20
|
+
#
|
21
|
+
# end
|
22
|
+
#
|
3
23
|
module ClassMethods
|
4
|
-
|
5
|
-
#
|
24
|
+
|
6
25
|
# Returns registered aggregators as an Array of classes
|
7
26
|
#
|
27
|
+
# @return [Array<Class>] The list of registered aggregator classes
|
8
28
|
def aggregators
|
9
29
|
@aggregators ||= []
|
10
30
|
end
|
11
31
|
|
12
|
-
#
|
13
|
-
# Yields aggregator classes in turn
|
14
|
-
#
|
32
|
+
# Yields each aggregator class in turn
|
15
33
|
def each
|
16
34
|
aggregators.each(&Proc.new)
|
17
35
|
end
|
18
36
|
|
19
|
-
#
|
20
37
|
# Automatically installs factory methods for inherited classes.
|
21
38
|
#
|
22
|
-
#
|
23
|
-
# class Sum < Aggregate # will give a method Aggregator.sum
|
24
|
-
# ...
|
25
|
-
# end
|
26
|
-
# Aggregator.sum{ size }
|
27
|
-
#
|
39
|
+
# @param [Class] clazz a class that extends Aggregator
|
28
40
|
def inherited(clazz)
|
29
41
|
aggregators << clazz
|
30
42
|
basename = Tools.ruby_case(Tools.class_name(clazz))
|
@@ -34,10 +46,16 @@ module Alf
|
|
34
46
|
end
|
35
47
|
EOF
|
36
48
|
end
|
37
|
-
|
49
|
+
|
50
|
+
# Coerces `arg` to an Aggregator
|
38
51
|
#
|
39
|
-
#
|
52
|
+
# Implemented coercions are:
|
53
|
+
# - Aggregator -> self
|
54
|
+
# - String -> through factory methods on self
|
40
55
|
#
|
56
|
+
# @param [Object] arg a value to coerce to an aggregator
|
57
|
+
# @return [Aggregator] the coerced aggregator
|
58
|
+
# @raise [ArgumentError] if the coercion fails
|
41
59
|
def coerce(arg)
|
42
60
|
case arg
|
43
61
|
when Aggregator
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Alf
|
2
|
+
class Aggregator
|
3
|
+
#
|
4
|
+
# Defines a `collect()` aggregation operator.
|
5
|
+
#
|
6
|
+
# Example:
|
7
|
+
#
|
8
|
+
# # direct ruby usage
|
9
|
+
# Alf::Aggregator.collect{ qty }.aggregate(...)
|
10
|
+
#
|
11
|
+
# # lispy
|
12
|
+
# (summarize :supplies, [:sid], :col => collect{ qty })
|
13
|
+
#
|
14
|
+
class Collect < Aggregator
|
15
|
+
|
16
|
+
# Returns [] as least value.
|
17
|
+
#
|
18
|
+
# @see Aggregator::InstanceMethods#least
|
19
|
+
def least()
|
20
|
+
[]
|
21
|
+
end
|
22
|
+
|
23
|
+
# Aggregates on a tuple occurence.
|
24
|
+
#
|
25
|
+
# @see Aggregator::InstanceMethods#_happens
|
26
|
+
def _happens(memo, val)
|
27
|
+
memo << val
|
28
|
+
end
|
29
|
+
|
30
|
+
end # class Collect
|
31
|
+
end # class Aggregator
|
32
|
+
end # module Alf
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Alf
|
2
|
+
class Aggregator
|
3
|
+
#
|
4
|
+
# Defines a `concat()` aggregation operator.
|
5
|
+
#
|
6
|
+
# Example:
|
7
|
+
#
|
8
|
+
# # direct ruby usage
|
9
|
+
# Alf::Aggregator.concat{ qty }.aggregate(...)
|
10
|
+
#
|
11
|
+
# # lispy
|
12
|
+
# (summarize :supplies, [:sid], :cat => concat{ qty })
|
13
|
+
#
|
14
|
+
class Concat < Aggregator
|
15
|
+
|
16
|
+
# Sets default options.
|
17
|
+
#
|
18
|
+
# @see Aggregator::InstanceMethods#default_options
|
19
|
+
def default_options
|
20
|
+
{:before => "", :after => "", :between => ""}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns least value (defaults to "")
|
24
|
+
#
|
25
|
+
# @see Aggregator::InstanceMethods#least
|
26
|
+
def least()
|
27
|
+
""
|
28
|
+
end
|
29
|
+
|
30
|
+
# Aggregates on a tuple occurence.
|
31
|
+
#
|
32
|
+
# @see Aggregator::InstanceMethods#_happens
|
33
|
+
def _happens(memo, val)
|
34
|
+
memo << options[:between].to_s unless memo.empty?
|
35
|
+
memo << val.to_s
|
36
|
+
end
|
37
|
+
|
38
|
+
# Finalizes computation
|
39
|
+
#
|
40
|
+
# @see Aggregator::InstanceMethods#finalize
|
41
|
+
def finalize(memo)
|
42
|
+
options[:before].to_s + memo + options[:after].to_s
|
43
|
+
end
|
44
|
+
|
45
|
+
end # class Concat
|
46
|
+
end # class Aggregator
|
47
|
+
end # module Alf
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Alf
|
2
|
+
class Aggregator
|
3
|
+
#
|
4
|
+
# Defines a `count()` aggregation operator.
|
5
|
+
#
|
6
|
+
# Example:
|
7
|
+
#
|
8
|
+
# # direct ruby usage
|
9
|
+
# Alf::Aggregator.count.aggregate(...)
|
10
|
+
#
|
11
|
+
# # lispy
|
12
|
+
# (summarize :supplies, [:sid], :num_orders => count)
|
13
|
+
#
|
14
|
+
class Count < Aggregator
|
15
|
+
|
16
|
+
# Returns 0 as least value.
|
17
|
+
#
|
18
|
+
# @see Aggregator::InstanceMethods#least
|
19
|
+
def least()
|
20
|
+
0
|
21
|
+
end
|
22
|
+
|
23
|
+
# Aggregates on a tuple occurence through `memo + 1`
|
24
|
+
#
|
25
|
+
# @see Aggregator::InstanceMethods#happens
|
26
|
+
def happens(memo, tuple)
|
27
|
+
memo + 1
|
28
|
+
end
|
29
|
+
|
30
|
+
end # class Count
|
31
|
+
end # class Aggregator
|
32
|
+
end # module Alf
|