axiom 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +37 -0
- data/.rspec +4 -0
- data/.rvmrc +1 -0
- data/.travis.yml +35 -0
- data/.yardopts +4 -0
- data/CONTRIBUTING.md +11 -0
- data/Gemfile +8 -0
- data/Gemfile.devtools +57 -0
- data/Guardfile +23 -0
- data/LICENSE +20 -0
- data/README.md +187 -0
- data/Rakefile +5 -0
- data/TODO +107 -0
- data/axiom.gemspec +28 -0
- data/benchmarks/memory.rb +173 -0
- data/benchmarks/speed.rb +100 -0
- data/config/flay.yml +3 -0
- data/config/flog.yml +2 -0
- data/config/mutant.yml +3 -0
- data/config/reek.yml +171 -0
- data/config/roodi.yml +18 -0
- data/config/yardstick.yml +2 -0
- data/lib/axiom.rb +216 -0
- data/lib/axiom/aggregate.rb +94 -0
- data/lib/axiom/aggregate/count.rb +58 -0
- data/lib/axiom/aggregate/maximum.rb +62 -0
- data/lib/axiom/aggregate/mean.rb +84 -0
- data/lib/axiom/aggregate/minimum.rb +62 -0
- data/lib/axiom/aggregate/standard_deviation.rb +61 -0
- data/lib/axiom/aggregate/sum.rb +83 -0
- data/lib/axiom/aggregate/variance.rb +84 -0
- data/lib/axiom/algebra/difference.rb +89 -0
- data/lib/axiom/algebra/extension.rb +174 -0
- data/lib/axiom/algebra/intersection.rb +83 -0
- data/lib/axiom/algebra/join.rb +204 -0
- data/lib/axiom/algebra/product.rb +124 -0
- data/lib/axiom/algebra/projection.rb +196 -0
- data/lib/axiom/algebra/rename.rb +115 -0
- data/lib/axiom/algebra/rename/aliases.rb +221 -0
- data/lib/axiom/algebra/restriction.rb +166 -0
- data/lib/axiom/algebra/summarization.rb +244 -0
- data/lib/axiom/algebra/summarization/summaries.rb +60 -0
- data/lib/axiom/algebra/summarization/summary.rb +83 -0
- data/lib/axiom/algebra/union.rb +85 -0
- data/lib/axiom/attribute.rb +207 -0
- data/lib/axiom/attribute/boolean.rb +41 -0
- data/lib/axiom/attribute/class.rb +23 -0
- data/lib/axiom/attribute/comparable.rb +44 -0
- data/lib/axiom/attribute/date.rb +38 -0
- data/lib/axiom/attribute/date_time.rb +38 -0
- data/lib/axiom/attribute/decimal.rb +23 -0
- data/lib/axiom/attribute/float.rb +25 -0
- data/lib/axiom/attribute/integer.rb +23 -0
- data/lib/axiom/attribute/numeric.rb +74 -0
- data/lib/axiom/attribute/object.rb +28 -0
- data/lib/axiom/attribute/string.rb +100 -0
- data/lib/axiom/attribute/time.rb +38 -0
- data/lib/axiom/core_ext/date.rb +20 -0
- data/lib/axiom/core_ext/range.rb +41 -0
- data/lib/axiom/core_ext/time.rb +20 -0
- data/lib/axiom/function.rb +46 -0
- data/lib/axiom/function/binary.rb +90 -0
- data/lib/axiom/function/comparable.rb +44 -0
- data/lib/axiom/function/connective.rb +21 -0
- data/lib/axiom/function/connective/conjunction.rb +78 -0
- data/lib/axiom/function/connective/disjunction.rb +78 -0
- data/lib/axiom/function/connective/negation.rb +103 -0
- data/lib/axiom/function/numeric.rb +11 -0
- data/lib/axiom/function/numeric/absolute.rb +48 -0
- data/lib/axiom/function/numeric/addition.rb +62 -0
- data/lib/axiom/function/numeric/binary.rb +26 -0
- data/lib/axiom/function/numeric/division.rb +71 -0
- data/lib/axiom/function/numeric/exponentiation.rb +69 -0
- data/lib/axiom/function/numeric/modulo.rb +53 -0
- data/lib/axiom/function/numeric/multiplication.rb +62 -0
- data/lib/axiom/function/numeric/square_root.rb +75 -0
- data/lib/axiom/function/numeric/subtraction.rb +62 -0
- data/lib/axiom/function/numeric/unary.rb +26 -0
- data/lib/axiom/function/numeric/unary_minus.rb +60 -0
- data/lib/axiom/function/numeric/unary_plus.rb +60 -0
- data/lib/axiom/function/predicate.rb +26 -0
- data/lib/axiom/function/predicate/enumerable.rb +57 -0
- data/lib/axiom/function/predicate/equality.rb +67 -0
- data/lib/axiom/function/predicate/exclusion.rb +60 -0
- data/lib/axiom/function/predicate/greater_than.rb +67 -0
- data/lib/axiom/function/predicate/greater_than_or_equal_to.rb +67 -0
- data/lib/axiom/function/predicate/inclusion.rb +60 -0
- data/lib/axiom/function/predicate/inequality.rb +82 -0
- data/lib/axiom/function/predicate/less_than.rb +67 -0
- data/lib/axiom/function/predicate/less_than_or_equal_to.rb +67 -0
- data/lib/axiom/function/predicate/match.rb +67 -0
- data/lib/axiom/function/predicate/no_match.rb +70 -0
- data/lib/axiom/function/proposition.rb +97 -0
- data/lib/axiom/function/proposition/contradiction.rb +66 -0
- data/lib/axiom/function/proposition/tautology.rb +66 -0
- data/lib/axiom/function/string/length.rb +55 -0
- data/lib/axiom/function/unary.rb +124 -0
- data/lib/axiom/relation.rb +268 -0
- data/lib/axiom/relation/base.rb +39 -0
- data/lib/axiom/relation/empty.rb +52 -0
- data/lib/axiom/relation/header.rb +349 -0
- data/lib/axiom/relation/keys.rb +282 -0
- data/lib/axiom/relation/materialized.rb +71 -0
- data/lib/axiom/relation/operation/binary.rb +77 -0
- data/lib/axiom/relation/operation/combination.rb +37 -0
- data/lib/axiom/relation/operation/deletion.rb +45 -0
- data/lib/axiom/relation/operation/insertion.rb +45 -0
- data/lib/axiom/relation/operation/limit.rb +211 -0
- data/lib/axiom/relation/operation/offset.rb +174 -0
- data/lib/axiom/relation/operation/order.rb +204 -0
- data/lib/axiom/relation/operation/order/direction.rb +182 -0
- data/lib/axiom/relation/operation/order/direction_set.rb +107 -0
- data/lib/axiom/relation/operation/reverse.rb +86 -0
- data/lib/axiom/relation/operation/set.rb +79 -0
- data/lib/axiom/relation/operation/unary.rb +24 -0
- data/lib/axiom/relation/proxy.rb +84 -0
- data/lib/axiom/support/aliasable.rb +44 -0
- data/lib/axiom/support/equalizer.rb +22 -0
- data/lib/axiom/support/evaluator.rb +122 -0
- data/lib/axiom/support/operation/binary.rb +45 -0
- data/lib/axiom/support/operation/unary.rb +32 -0
- data/lib/axiom/support/visitable.rb +25 -0
- data/lib/axiom/tuple.rb +161 -0
- data/lib/axiom/version.rb +8 -0
- data/spec/integration/axiom/algebra/join_spec.rb +16 -0
- data/spec/integration/axiom/algebra/product_spec.rb +16 -0
- data/spec/integration/axiom/algebra/projection_spec.rb +18 -0
- data/spec/integration/axiom/algebra/summarization_spec.rb +35 -0
- data/spec/integration/axiom/relation/efficient_enumerable_spec.rb +83 -0
- data/spec/integration/axiom/relation/writable_relations_spec.rb +68 -0
- data/spec/shared/invertible_method_behaviour.rb +9 -0
- data/spec/spec_helper.rb +46 -0
- data/spec/support/config_alias.rb +3 -0
- data/spec/support/ice_nine_config.rb +6 -0
- data/spec/support/lazy_enumerable.rb +18 -0
- data/spec/unit/axiom/aggregate/call_spec.rb +43 -0
- data/spec/unit/axiom/aggregate/class_methods/call_spec.rb +11 -0
- data/spec/unit/axiom/aggregate/class_methods/default_spec.rb +11 -0
- data/spec/unit/axiom/aggregate/class_methods/finalize_spec.rb +12 -0
- data/spec/unit/axiom/aggregate/count/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/aggregate/count/class_methods/default_spec.rb +13 -0
- data/spec/unit/axiom/aggregate/count/methods/count_spec.rb +14 -0
- data/spec/unit/axiom/aggregate/count/type_spec.rb +12 -0
- data/spec/unit/axiom/aggregate/default_spec.rb +17 -0
- data/spec/unit/axiom/aggregate/equality_operator_spec.rb +52 -0
- data/spec/unit/axiom/aggregate/finalize_spec.rb +18 -0
- data/spec/unit/axiom/aggregate/hash_spec.rb +15 -0
- data/spec/unit/axiom/aggregate/maximum/class_methods/call_spec.rb +36 -0
- data/spec/unit/axiom/aggregate/maximum/class_methods/default_spec.rb +13 -0
- data/spec/unit/axiom/aggregate/maximum/methods/maximum_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/maximum/type_spec.rb +20 -0
- data/spec/unit/axiom/aggregate/mean/class_methods/call_spec.rb +38 -0
- data/spec/unit/axiom/aggregate/mean/class_methods/default_spec.rb +15 -0
- data/spec/unit/axiom/aggregate/mean/class_methods/finalize_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/mean/methods/mean_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/mean/type_spec.rb +12 -0
- data/spec/unit/axiom/aggregate/minimum/class_methods/call_spec.rb +36 -0
- data/spec/unit/axiom/aggregate/minimum/class_methods/default_spec.rb +13 -0
- data/spec/unit/axiom/aggregate/minimum/methods/minimum_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/minimum/type_spec.rb +20 -0
- data/spec/unit/axiom/aggregate/standard_deviation/class_methods/finalize_spec.rb +34 -0
- data/spec/unit/axiom/aggregate/standard_deviation/methods/standard_deviation_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/standard_deviation/type_spec.rb +12 -0
- data/spec/unit/axiom/aggregate/sum/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/aggregate/sum/class_methods/default_spec.rb +13 -0
- data/spec/unit/axiom/aggregate/sum/default_spec.rb +33 -0
- data/spec/unit/axiom/aggregate/sum/methods/sum_spec.rb +14 -0
- data/spec/unit/axiom/aggregate/sum/type_spec.rb +20 -0
- data/spec/unit/axiom/aggregate/type_spec.rb +13 -0
- data/spec/unit/axiom/aggregate/variance/class_methods/call_spec.rb +52 -0
- data/spec/unit/axiom/aggregate/variance/class_methods/default_spec.rb +15 -0
- data/spec/unit/axiom/aggregate/variance/class_methods/finalize_spec.rb +26 -0
- data/spec/unit/axiom/aggregate/variance/methods/variance_spec.rb +16 -0
- data/spec/unit/axiom/aggregate/variance/type_spec.rb +12 -0
- data/spec/unit/axiom/algebra/difference/delete_spec.rb +44 -0
- data/spec/unit/axiom/algebra/difference/each_spec.rb +45 -0
- data/spec/unit/axiom/algebra/difference/insert_spec.rb +44 -0
- data/spec/unit/axiom/algebra/difference/methods/difference_spec.rb +20 -0
- data/spec/unit/axiom/algebra/extension/class_methods/new_spec.rb +22 -0
- data/spec/unit/axiom/algebra/extension/delete_spec.rb +47 -0
- data/spec/unit/axiom/algebra/extension/each_spec.rb +30 -0
- data/spec/unit/axiom/algebra/extension/eql_spec.rb +65 -0
- data/spec/unit/axiom/algebra/extension/extensions_spec.rb +15 -0
- data/spec/unit/axiom/algebra/extension/hash_spec.rb +15 -0
- data/spec/unit/axiom/algebra/extension/header_spec.rb +17 -0
- data/spec/unit/axiom/algebra/extension/insert_spec.rb +47 -0
- data/spec/unit/axiom/algebra/extension/methods/extend_spec.rb +34 -0
- data/spec/unit/axiom/algebra/extension/operand_spec.rb +15 -0
- data/spec/unit/axiom/algebra/intersection/delete_spec.rb +44 -0
- data/spec/unit/axiom/algebra/intersection/each_spec.rb +45 -0
- data/spec/unit/axiom/algebra/intersection/insert_spec.rb +44 -0
- data/spec/unit/axiom/algebra/intersection/methods/intersect_spec.rb +20 -0
- data/spec/unit/axiom/algebra/join/class_methods/new_spec.rb +29 -0
- data/spec/unit/axiom/algebra/join/delete_spec.rb +43 -0
- data/spec/unit/axiom/algebra/join/each_spec.rb +77 -0
- data/spec/unit/axiom/algebra/join/insert_spec.rb +43 -0
- data/spec/unit/axiom/algebra/join/join_header_spec.rb +17 -0
- data/spec/unit/axiom/algebra/join/methods/join_spec.rb +35 -0
- data/spec/unit/axiom/algebra/product/class_methods/new_spec.rb +29 -0
- data/spec/unit/axiom/algebra/product/delete_spec.rb +14 -0
- data/spec/unit/axiom/algebra/product/each_spec.rb +31 -0
- data/spec/unit/axiom/algebra/product/insert_spec.rb +14 -0
- data/spec/unit/axiom/algebra/product/methods/product_spec.rb +15 -0
- data/spec/unit/axiom/algebra/projection/delete_spec.rb +58 -0
- data/spec/unit/axiom/algebra/projection/each_spec.rb +30 -0
- data/spec/unit/axiom/algebra/projection/eql_spec.rb +66 -0
- data/spec/unit/axiom/algebra/projection/hash_spec.rb +16 -0
- data/spec/unit/axiom/algebra/projection/header_spec.rb +16 -0
- data/spec/unit/axiom/algebra/projection/insert_spec.rb +66 -0
- data/spec/unit/axiom/algebra/projection/methods/project_spec.rb +19 -0
- data/spec/unit/axiom/algebra/projection/methods/remove_spec.rb +19 -0
- data/spec/unit/axiom/algebra/rename/aliases/class_methods/coerce_spec.rb +59 -0
- data/spec/unit/axiom/algebra/rename/aliases/class_methods/new_spec.rb +23 -0
- data/spec/unit/axiom/algebra/rename/aliases/each_spec.rb +20 -0
- data/spec/unit/axiom/algebra/rename/aliases/element_reader_spec.rb +23 -0
- data/spec/unit/axiom/algebra/rename/aliases/empty_predicate_spec.rb +22 -0
- data/spec/unit/axiom/algebra/rename/aliases/eql_spec.rb +52 -0
- data/spec/unit/axiom/algebra/rename/aliases/equality_operator_spec.rb +52 -0
- data/spec/unit/axiom/algebra/rename/aliases/hash_spec.rb +15 -0
- data/spec/unit/axiom/algebra/rename/aliases/inverse_spec.rb +30 -0
- data/spec/unit/axiom/algebra/rename/aliases/to_hash_spec.rb +32 -0
- data/spec/unit/axiom/algebra/rename/aliases/union_spec.rb +66 -0
- data/spec/unit/axiom/algebra/rename/aliases_spec.rb +13 -0
- data/spec/unit/axiom/algebra/rename/delete_spec.rb +45 -0
- data/spec/unit/axiom/algebra/rename/directions_spec.rb +30 -0
- data/spec/unit/axiom/algebra/rename/each_spec.rb +29 -0
- data/spec/unit/axiom/algebra/rename/eql_spec.rb +65 -0
- data/spec/unit/axiom/algebra/rename/hash_spec.rb +15 -0
- data/spec/unit/axiom/algebra/rename/header_spec.rb +16 -0
- data/spec/unit/axiom/algebra/rename/insert_spec.rb +45 -0
- data/spec/unit/axiom/algebra/rename/methods/rename_spec.rb +14 -0
- data/spec/unit/axiom/algebra/restriction/delete_spec.rb +50 -0
- data/spec/unit/axiom/algebra/restriction/each_spec.rb +88 -0
- data/spec/unit/axiom/algebra/restriction/eql_spec.rb +65 -0
- data/spec/unit/axiom/algebra/restriction/hash_spec.rb +15 -0
- data/spec/unit/axiom/algebra/restriction/insert_spec.rb +50 -0
- data/spec/unit/axiom/algebra/restriction/methods/restrict_spec.rb +78 -0
- data/spec/unit/axiom/algebra/restriction/predicate_spec.rb +15 -0
- data/spec/unit/axiom/algebra/summarization/class_methods/new_spec.rb +30 -0
- data/spec/unit/axiom/algebra/summarization/delete_spec.rb +15 -0
- data/spec/unit/axiom/algebra/summarization/each_spec.rb +30 -0
- data/spec/unit/axiom/algebra/summarization/eql_spec.rb +81 -0
- data/spec/unit/axiom/algebra/summarization/hash_spec.rb +16 -0
- data/spec/unit/axiom/algebra/summarization/header_spec.rb +17 -0
- data/spec/unit/axiom/algebra/summarization/insert_spec.rb +15 -0
- data/spec/unit/axiom/algebra/summarization/methods/summarize_spec.rb +81 -0
- data/spec/unit/axiom/algebra/summarization/summaries/summarize_by_spec.rb +28 -0
- data/spec/unit/axiom/algebra/summarization/summaries/to_hash_spec.rb +17 -0
- data/spec/unit/axiom/algebra/summarization/summarize_per_spec.rb +15 -0
- data/spec/unit/axiom/algebra/summarization/summarizers_spec.rb +15 -0
- data/spec/unit/axiom/algebra/summarization/summary/call_spec.rb +43 -0
- data/spec/unit/axiom/algebra/summarization/summary/summarize_by_spec.rb +20 -0
- data/spec/unit/axiom/algebra/union/delete_spec.rb +44 -0
- data/spec/unit/axiom/algebra/union/each_spec.rb +56 -0
- data/spec/unit/axiom/algebra/union/insert_spec.rb +44 -0
- data/spec/unit/axiom/algebra/union/methods/union_spec.rb +20 -0
- data/spec/unit/axiom/aliasable/fixtures/classes.rb +9 -0
- data/spec/unit/axiom/aliasable/inheritable_alias_spec.rb +50 -0
- data/spec/unit/axiom/attribute/boolean/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/boolean/valid_value_predicate_spec.rb +27 -0
- data/spec/unit/axiom/attribute/call_spec.rb +14 -0
- data/spec/unit/axiom/attribute/class/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/class_methods/coerce_spec.rb +91 -0
- data/spec/unit/axiom/attribute/class_methods/infer_type_spec.rb +121 -0
- data/spec/unit/axiom/attribute/class_methods/name_from_spec.rb +33 -0
- data/spec/unit/axiom/attribute/class_methods/new_spec.rb +41 -0
- data/spec/unit/axiom/attribute/comparable/asc_spec.rb +13 -0
- data/spec/unit/axiom/attribute/comparable/desc_spec.rb +13 -0
- data/spec/unit/axiom/attribute/comparable/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/attribute/date/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/date/range_spec.rb +11 -0
- data/spec/unit/axiom/attribute/date_time/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/date_time/range_spec.rb +11 -0
- data/spec/unit/axiom/attribute/decimal/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/eql_spec.rb +61 -0
- data/spec/unit/axiom/attribute/equality_operator_spec.rb +61 -0
- data/spec/unit/axiom/attribute/float/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/float/size_spec.rb +21 -0
- data/spec/unit/axiom/attribute/hash_spec.rb +17 -0
- data/spec/unit/axiom/attribute/integer/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/name_spec.rb +24 -0
- data/spec/unit/axiom/attribute/numeric/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/numeric/eql_spec.rb +71 -0
- data/spec/unit/axiom/attribute/numeric/equality_operator_spec.rb +71 -0
- data/spec/unit/axiom/attribute/numeric/hash_spec.rb +17 -0
- data/spec/unit/axiom/attribute/numeric/size_spec.rb +33 -0
- data/spec/unit/axiom/attribute/numeric/valid_value_predicate_spec.rb +35 -0
- data/spec/unit/axiom/attribute/object/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/rename_spec.rb +28 -0
- data/spec/unit/axiom/attribute/required_predicate_spec.rb +27 -0
- data/spec/unit/axiom/attribute/string/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/string/eql_spec.rb +81 -0
- data/spec/unit/axiom/attribute/string/equality_operator_spec.rb +81 -0
- data/spec/unit/axiom/attribute/string/hash_spec.rb +25 -0
- data/spec/unit/axiom/attribute/string/max_length_spec.rb +20 -0
- data/spec/unit/axiom/attribute/string/min_length_spec.rb +20 -0
- data/spec/unit/axiom/attribute/string/valid_value_predicate_spec.rb +35 -0
- data/spec/unit/axiom/attribute/time/class_methods/primitive_spec.rb +13 -0
- data/spec/unit/axiom/attribute/time/range_spec.rb +11 -0
- data/spec/unit/axiom/attribute/type_spec.rb +12 -0
- data/spec/unit/axiom/attribute/valid_primitive_predicate_spec.rb +30 -0
- data/spec/unit/axiom/attribute/valid_value_predicate_spec.rb +47 -0
- data/spec/unit/axiom/equalizer/class_method/new_spec.rb +137 -0
- data/spec/unit/axiom/equalizer/methods/eql_spec.rb +49 -0
- data/spec/unit/axiom/equalizer/methods/equality_operator_spec.rb +85 -0
- data/spec/unit/axiom/evaluator/context/add_spec.rb +66 -0
- data/spec/unit/axiom/evaluator/context/element_reader_spec.rb +14 -0
- data/spec/unit/axiom/evaluator/context/functions_spec.rb +16 -0
- data/spec/unit/axiom/evaluator/context/method_missing_spec.rb +29 -0
- data/spec/unit/axiom/evaluator/context/respond_to_predicate_spec.rb +39 -0
- data/spec/unit/axiom/evaluator/context/send_spec.rb +28 -0
- data/spec/unit/axiom/evaluator/context/yield_spec.rb +14 -0
- data/spec/unit/axiom/function/binary/call_spec.rb +22 -0
- data/spec/unit/axiom/function/binary/equality_operator_spec.rb +67 -0
- data/spec/unit/axiom/function/binary/fixtures/classes.rb +12 -0
- data/spec/unit/axiom/function/binary/invertible/class_methods/included_spec.rb +29 -0
- data/spec/unit/axiom/function/binary/invertible/inverse_spec.rb +47 -0
- data/spec/unit/axiom/function/binary/rename_spec.rb +55 -0
- data/spec/unit/axiom/function/class_methods/call_spec.rb +11 -0
- data/spec/unit/axiom/function/class_methods/extract_value_spec.rb +23 -0
- data/spec/unit/axiom/function/class_methods/rename_attributes_spec.rb +29 -0
- data/spec/unit/axiom/function/comparable/class_methods/call_spec.rb +14 -0
- data/spec/unit/axiom/function/comparable/class_methods/included_spec.rb +26 -0
- data/spec/unit/axiom/function/comparable/fixtures/classes.rb +23 -0
- data/spec/unit/axiom/function/connective/conjunction/class_methods/call_spec.rb +37 -0
- data/spec/unit/axiom/function/connective/conjunction/inverse_spec.rb +20 -0
- data/spec/unit/axiom/function/connective/conjunction/methods/and_spec.rb +19 -0
- data/spec/unit/axiom/function/connective/conjunction/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/connective/disjunction/class_methods/call_spec.rb +37 -0
- data/spec/unit/axiom/function/connective/disjunction/inverse_spec.rb +20 -0
- data/spec/unit/axiom/function/connective/disjunction/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/connective/disjunction/methods/or_spec.rb +19 -0
- data/spec/unit/axiom/function/connective/negation/class_methods/call_spec.rb +21 -0
- data/spec/unit/axiom/function/connective/negation/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/connective/negation/inverse_spec.rb +21 -0
- data/spec/unit/axiom/function/connective/negation/methods/fixtures/classes.rb +8 -0
- data/spec/unit/axiom/function/connective/negation/methods/not_spec.rb +39 -0
- data/spec/unit/axiom/function/connective/type_spec.rb +12 -0
- data/spec/unit/axiom/function/fixtures/classes.rb +6 -0
- data/spec/unit/axiom/function/numeric/absolute/class_methods/call_spec.rb +21 -0
- data/spec/unit/axiom/function/numeric/absolute/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/absolute/methods/absolute_spec.rb +16 -0
- data/spec/unit/axiom/function/numeric/addition/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/addition/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/addition/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/addition/methods/add_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/binary/type_spec.rb +33 -0
- data/spec/unit/axiom/function/numeric/division/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/division/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/division/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/division/methods/divide_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/division/type_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/exponentiation/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/exponentiation/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/exponentiation/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/numeric/exponentiation/methods/exponent_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/modulo/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/modulo/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/modulo/methods/modulo_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/multiplication/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/multiplication/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/multiplication/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/multiplication/methods/multiply_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/square_root/class_methods/call_spec.rb +12 -0
- data/spec/unit/axiom/function/numeric/square_root/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/numeric/square_root/methods/square_root_spec.rb +16 -0
- data/spec/unit/axiom/function/numeric/square_root/type_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/subtraction/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/subtraction/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/subtraction/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/subtraction/methods/subtract_spec.rb +19 -0
- data/spec/unit/axiom/function/numeric/unary/type_spec.rb +21 -0
- data/spec/unit/axiom/function/numeric/unary_minus/class_methods/call_spec.rb +21 -0
- data/spec/unit/axiom/function/numeric/unary_minus/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/unary_minus/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/unary_minus/methods/unary_minus_spec.rb +16 -0
- data/spec/unit/axiom/function/numeric/unary_plus/class_methods/call_spec.rb +21 -0
- data/spec/unit/axiom/function/numeric/unary_plus/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/numeric/unary_plus/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/unary_plus/methods/unary_plus_spec.rb +16 -0
- data/spec/unit/axiom/function/predicate/call_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/class_methods/call_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/enumerable/call_spec.rb +36 -0
- data/spec/unit/axiom/function/predicate/enumerable/class_methods/compare_method_spec.rb +21 -0
- data/spec/unit/axiom/function/predicate/eql_spec.rb +66 -0
- data/spec/unit/axiom/function/predicate/equality/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/equality/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/equality/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/equality/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/equality/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/equality/methods/eq_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/equality/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/exclusion/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/exclusion/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/exclusion/inverse_spec.rb +19 -0
- data/spec/unit/axiom/function/predicate/exclusion/methods/exclude_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/exclusion/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/fixtures/classes.rb +10 -0
- data/spec/unit/axiom/function/predicate/greater_than/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/function/predicate/greater_than/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/greater_than/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/greater_than/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/greater_than/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/greater_than/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/greater_than/methods/gt_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/methods/gte_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/hash_spec.rb +16 -0
- data/spec/unit/axiom/function/predicate/inclusion/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/inclusion/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/inclusion/inverse_spec.rb +19 -0
- data/spec/unit/axiom/function/predicate/inclusion/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/inclusion/methods/include_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/inequality/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/inequality/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/inequality/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/inequality/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/inequality/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/inequality/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/inequality/methods/ne_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/inverse_spec.rb +17 -0
- data/spec/unit/axiom/function/predicate/less_than/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/function/predicate/less_than/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/less_than/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/less_than/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/less_than/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/less_than/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/less_than/methods/lt_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/inverse_spec.rb +18 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/methods/lte_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/match/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/match/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/match/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/match/inverse_spec.rb +19 -0
- data/spec/unit/axiom/function/predicate/match/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/match/methods/match_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/no_match/class_methods/call_spec.rb +23 -0
- data/spec/unit/axiom/function/predicate/no_match/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/predicate/no_match/class_methods/operation_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/no_match/inverse_spec.rb +19 -0
- data/spec/unit/axiom/function/predicate/no_match/methods/fixtures/classes.rb +7 -0
- data/spec/unit/axiom/function/predicate/no_match/methods/no_match_spec.rb +14 -0
- data/spec/unit/axiom/function/predicate/type_spec.rb +14 -0
- data/spec/unit/axiom/function/proposition/call_spec.rb +16 -0
- data/spec/unit/axiom/function/proposition/class_methods/call_spec.rb +11 -0
- data/spec/unit/axiom/function/proposition/class_methods/new_spec.rb +45 -0
- data/spec/unit/axiom/function/proposition/contradiction/and_spec.rb +12 -0
- data/spec/unit/axiom/function/proposition/contradiction/class_methods/call_spec.rb +11 -0
- data/spec/unit/axiom/function/proposition/contradiction/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/proposition/contradiction/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/proposition/contradiction/or_spec.rb +12 -0
- data/spec/unit/axiom/function/proposition/eql_spec.rb +40 -0
- data/spec/unit/axiom/function/proposition/equality_operator_spec.rb +40 -0
- data/spec/unit/axiom/function/proposition/hash_spec.rb +14 -0
- data/spec/unit/axiom/function/proposition/inverse_spec.rb +28 -0
- data/spec/unit/axiom/function/proposition/rename_spec.rb +16 -0
- data/spec/unit/axiom/function/proposition/tautology/and_spec.rb +12 -0
- data/spec/unit/axiom/function/proposition/tautology/class_methods/call_spec.rb +11 -0
- data/spec/unit/axiom/function/proposition/tautology/class_methods/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/proposition/tautology/inverse_spec.rb +13 -0
- data/spec/unit/axiom/function/proposition/tautology/or_spec.rb +12 -0
- data/spec/unit/axiom/function/proposition/type_spec.rb +12 -0
- data/spec/unit/axiom/function/rename_spec.rb +14 -0
- data/spec/unit/axiom/function/string/length/class_methods/call_spec.rb +12 -0
- data/spec/unit/axiom/function/string/length/methods/length_spec.rb +14 -0
- data/spec/unit/axiom/function/string/length/type_spec.rb +11 -0
- data/spec/unit/axiom/function/type_spec.rb +13 -0
- data/spec/unit/axiom/function/unary/call_spec.rb +21 -0
- data/spec/unit/axiom/function/unary/callable/call_spec.rb +23 -0
- data/spec/unit/axiom/function/unary/callable/included_spec.rb +23 -0
- data/spec/unit/axiom/function/unary/equality_operator_spec.rb +55 -0
- data/spec/unit/axiom/function/unary/fixtures/classes.rb +12 -0
- data/spec/unit/axiom/function/unary/hash_spec.rb +18 -0
- data/spec/unit/axiom/function/unary/invertible/class_methods/included_spec.rb +29 -0
- data/spec/unit/axiom/function/unary/invertible/inverse_spec.rb +45 -0
- data/spec/unit/axiom/function/unary/rename_spec.rb +29 -0
- data/spec/unit/axiom/operation/binary/eql_spec.rb +66 -0
- data/spec/unit/axiom/operation/binary/hash_spec.rb +16 -0
- data/spec/unit/axiom/operation/binary/left_spec.rb +27 -0
- data/spec/unit/axiom/operation/binary/right_spec.rb +27 -0
- data/spec/unit/axiom/operation/unary/eql_spec.rb +52 -0
- data/spec/unit/axiom/operation/unary/hash_spec.rb +15 -0
- data/spec/unit/axiom/operation/unary/operand_spec.rb +26 -0
- data/spec/unit/axiom/relation/base/class_methods/new_spec.rb +35 -0
- data/spec/unit/axiom/relation/base/eql_spec.rb +100 -0
- data/spec/unit/axiom/relation/base/hash_spec.rb +16 -0
- data/spec/unit/axiom/relation/base/name_spec.rb +45 -0
- data/spec/unit/axiom/relation/class_methods/coerce_spec.rb +23 -0
- data/spec/unit/axiom/relation/class_methods/new_spec.rb +69 -0
- data/spec/unit/axiom/relation/directions_spec.rb +20 -0
- data/spec/unit/axiom/relation/each_spec.rb +52 -0
- data/spec/unit/axiom/relation/element_reader_spec.rb +17 -0
- data/spec/unit/axiom/relation/empty/class_methods/new_spec.rb +30 -0
- data/spec/unit/axiom/relation/empty/each_spec.rb +33 -0
- data/spec/unit/axiom/relation/empty/empty_predicate_spec.rb +11 -0
- data/spec/unit/axiom/relation/empty/header_spec.rb +14 -0
- data/spec/unit/axiom/relation/empty/size_spec.rb +11 -0
- data/spec/unit/axiom/relation/empty_predicate_spec.rb +26 -0
- data/spec/unit/axiom/relation/eql_spec.rb +84 -0
- data/spec/unit/axiom/relation/equality_operator_spec.rb +118 -0
- data/spec/unit/axiom/relation/hash_spec.rb +19 -0
- data/spec/unit/axiom/relation/header/call_spec.rb +36 -0
- data/spec/unit/axiom/relation/header/class_methods/coerce_spec.rb +101 -0
- data/spec/unit/axiom/relation/header/class_methods/new_spec.rb +66 -0
- data/spec/unit/axiom/relation/header/difference_spec.rb +100 -0
- data/spec/unit/axiom/relation/header/each_spec.rb +36 -0
- data/spec/unit/axiom/relation/header/empty_predicate_spec.rb +21 -0
- data/spec/unit/axiom/relation/header/eql_spec.rb +64 -0
- data/spec/unit/axiom/relation/header/equality_operator_spec.rb +94 -0
- data/spec/unit/axiom/relation/header/extend_spec.rb +35 -0
- data/spec/unit/axiom/relation/header/hash_spec.rb +15 -0
- data/spec/unit/axiom/relation/header/intersect_spec.rb +100 -0
- data/spec/unit/axiom/relation/header/keys_spec.rb +35 -0
- data/spec/unit/axiom/relation/header/project_spec.rb +46 -0
- data/spec/unit/axiom/relation/header/rename_spec.rb +19 -0
- data/spec/unit/axiom/relation/header/to_ary_spec.rb +16 -0
- data/spec/unit/axiom/relation/header/union_spec.rb +100 -0
- data/spec/unit/axiom/relation/header_spec.rb +18 -0
- data/spec/unit/axiom/relation/include_predicate_spec.rb +22 -0
- data/spec/unit/axiom/relation/keys/class_methods/coerce_spec.rb +29 -0
- data/spec/unit/axiom/relation/keys/class_methods/new_spec.rb +46 -0
- data/spec/unit/axiom/relation/keys/difference_spec.rb +27 -0
- data/spec/unit/axiom/relation/keys/each_spec.rb +36 -0
- data/spec/unit/axiom/relation/keys/empty_predicate_spec.rb +21 -0
- data/spec/unit/axiom/relation/keys/extend_spec.rb +33 -0
- data/spec/unit/axiom/relation/keys/intersect_spec.rb +27 -0
- data/spec/unit/axiom/relation/keys/project_spec.rb +34 -0
- data/spec/unit/axiom/relation/keys/rename_spec.rb +16 -0
- data/spec/unit/axiom/relation/keys/to_ary_spec.rb +16 -0
- data/spec/unit/axiom/relation/keys/union_spec.rb +27 -0
- data/spec/unit/axiom/relation/materialize_spec.rb +24 -0
- data/spec/unit/axiom/relation/materialized/class_methods/new_spec.rb +38 -0
- data/spec/unit/axiom/relation/materialized/directions_spec.rb +27 -0
- data/spec/unit/axiom/relation/materialized/empty_predicate_spec.rb +22 -0
- data/spec/unit/axiom/relation/materialized/materialize_spec.rb +11 -0
- data/spec/unit/axiom/relation/materialized/materialized_predicate_spec.rb +15 -0
- data/spec/unit/axiom/relation/materialized/size_spec.rb +13 -0
- data/spec/unit/axiom/relation/materialized_predicate_spec.rb +15 -0
- data/spec/unit/axiom/relation/one_spec.rb +36 -0
- data/spec/unit/axiom/relation/operation/binary/class_methods/included_spec.rb +26 -0
- data/spec/unit/axiom/relation/operation/binary/class_methods/new_spec.rb +40 -0
- data/spec/unit/axiom/relation/operation/binary/fixtures/classes.rb +14 -0
- data/spec/unit/axiom/relation/operation/binary/header_spec.rb +19 -0
- data/spec/unit/axiom/relation/operation/combination/class_methods/combine_tuples_spec.rb +21 -0
- data/spec/unit/axiom/relation/operation/combination/fixtures/classes.rb +14 -0
- data/spec/unit/axiom/relation/operation/combination/header_spec.rb +21 -0
- data/spec/unit/axiom/relation/operation/deletion/initialize_spec.rb +16 -0
- data/spec/unit/axiom/relation/operation/deletion/methods/delete_spec.rb +42 -0
- data/spec/unit/axiom/relation/operation/insertion/initialize_spec.rb +16 -0
- data/spec/unit/axiom/relation/operation/insertion/methods/insert_spec.rb +42 -0
- data/spec/unit/axiom/relation/operation/limit/class_methods/new_spec.rb +45 -0
- data/spec/unit/axiom/relation/operation/limit/delete_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/limit/directions_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/limit/each_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/limit/eql_spec.rb +65 -0
- data/spec/unit/axiom/relation/operation/limit/hash_spec.rb +16 -0
- data/spec/unit/axiom/relation/operation/limit/insert_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/limit/limit_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/limit/methods/first_spec.rb +43 -0
- data/spec/unit/axiom/relation/operation/limit/methods/last_spec.rb +39 -0
- data/spec/unit/axiom/relation/operation/limit/methods/take_spec.rb +20 -0
- data/spec/unit/axiom/relation/operation/offset/class_methods/new_spec.rb +45 -0
- data/spec/unit/axiom/relation/operation/offset/delete_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/offset/directions_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/offset/each_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/offset/eql_spec.rb +65 -0
- data/spec/unit/axiom/relation/operation/offset/hash_spec.rb +16 -0
- data/spec/unit/axiom/relation/operation/offset/insert_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/offset/methods/drop_spec.rb +20 -0
- data/spec/unit/axiom/relation/operation/offset/offset_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/order/ascending/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/order/ascending/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/relation/operation/order/ascending/reverse_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/order/class_methods/new_spec.rb +34 -0
- data/spec/unit/axiom/relation/operation/order/delete_spec.rb +45 -0
- data/spec/unit/axiom/relation/operation/order/descending/class_methods/call_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/order/descending/class_methods/reverse_spec.rb +11 -0
- data/spec/unit/axiom/relation/operation/order/descending/reverse_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/order/direction/attribute_spec.rb +13 -0
- data/spec/unit/axiom/relation/operation/order/direction/call_spec.rb +19 -0
- data/spec/unit/axiom/relation/operation/order/direction/class_methods/coerce_spec.rb +32 -0
- data/spec/unit/axiom/relation/operation/order/direction/eql_predicate_spec.rb +54 -0
- data/spec/unit/axiom/relation/operation/order/direction/hash_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/order/direction/name_spec.rb +13 -0
- data/spec/unit/axiom/relation/operation/order/direction/rename_spec.rb +28 -0
- data/spec/unit/axiom/relation/operation/order/direction/reverse_spec.rb +29 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/attributes_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/class_methods/coerce_spec.rb +76 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/class_methods/new_spec.rb +26 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/eql_spec.rb +51 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/equality_operator_spec.rb +84 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/hash_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/project_spec.rb +17 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/rename_spec.rb +18 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/reverse_spec.rb +23 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/sort_tuples_spec.rb +44 -0
- data/spec/unit/axiom/relation/operation/order/direction_set/to_ary_spec.rb +14 -0
- data/spec/unit/axiom/relation/operation/order/directions_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/order/each_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/order/eql_spec.rb +65 -0
- data/spec/unit/axiom/relation/operation/order/hash_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/order/header_spec.rb +15 -0
- data/spec/unit/axiom/relation/operation/order/insert_spec.rb +45 -0
- data/spec/unit/axiom/relation/operation/order/methods/sort_by_spec.rb +42 -0
- data/spec/unit/axiom/relation/operation/reverse/class_methods/new_spec.rb +36 -0
- data/spec/unit/axiom/relation/operation/reverse/directions_spec.rb +17 -0
- data/spec/unit/axiom/relation/operation/reverse/each_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/reverse/methods/reverse_spec.rb +17 -0
- data/spec/unit/axiom/relation/operation/set/class_methods/included_spec.rb +26 -0
- data/spec/unit/axiom/relation/operation/set/class_methods/new_spec.rb +30 -0
- data/spec/unit/axiom/relation/operation/set/fixtures/classes.rb +14 -0
- data/spec/unit/axiom/relation/operation/set/header_spec.rb +17 -0
- data/spec/unit/axiom/relation/operation/unary/fixtures/classes.rb +17 -0
- data/spec/unit/axiom/relation/operation/unary/header_spec.rb +17 -0
- data/spec/unit/axiom/relation/proxy/each_spec.rb +41 -0
- data/spec/unit/axiom/relation/proxy/hash_spec.rb +26 -0
- data/spec/unit/axiom/relation/proxy/method_missing_spec.rb +24 -0
- data/spec/unit/axiom/relation/proxy/respond_to_predicate_spec.rb +40 -0
- data/spec/unit/axiom/relation/replace_spec.rb +55 -0
- data/spec/unit/axiom/tuple/call_spec.rb +25 -0
- data/spec/unit/axiom/tuple/class_methods/coerce_spec.rb +31 -0
- data/spec/unit/axiom/tuple/data_spec.rb +16 -0
- data/spec/unit/axiom/tuple/eql_spec.rb +65 -0
- data/spec/unit/axiom/tuple/equality_operator_spec.rb +85 -0
- data/spec/unit/axiom/tuple/extend_spec.rb +41 -0
- data/spec/unit/axiom/tuple/hash_spec.rb +15 -0
- data/spec/unit/axiom/tuple/header_spec.rb +14 -0
- data/spec/unit/axiom/tuple/join_spec.rb +18 -0
- data/spec/unit/axiom/tuple/predicate_spec.rb +44 -0
- data/spec/unit/axiom/tuple/project_spec.rb +17 -0
- data/spec/unit/axiom/tuple/to_ary_spec.rb +18 -0
- data/spec/unit/axiom/visitable/accept_spec.rb +18 -0
- data/spec/unit/date/pred_spec.rb +19 -0
- data/spec/unit/range/overlaps_spec.rb +192 -0
- data/spec/unit/range/to_inclusive_spec.rb +41 -0
- data/spec/unit/time/pred_spec.rb +19 -0
- metadata +1327 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 918161948535c59c8eaec2a5d5da0e287f7453f6
|
4
|
+
data.tar.gz: 54109ae07a49a23ca7c370b85a9fe95022000f31
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 51106a149efe43e41c86f252efc8afc7c96f302bc8d99bd870b83d756a0f18d3b7df12e725f63947f6ab9700ba3a39d41f23dba049730c20c5dfc25d37f12bd6
|
7
|
+
data.tar.gz: e816775476690b89236613881eead6a07c11dcddc6cdb7f646a00ed676d1f3e284ff49c18c442e97f7541be53c0f859d8190c5de01db379f7cc66810c301b918
|
data/.gitignore
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
## MAC OS
|
2
|
+
.DS_Store
|
3
|
+
|
4
|
+
## TEXTMATE
|
5
|
+
*.tmproj
|
6
|
+
tmtags
|
7
|
+
|
8
|
+
## EMACS
|
9
|
+
*~
|
10
|
+
\#*
|
11
|
+
.\#*
|
12
|
+
|
13
|
+
## VIM
|
14
|
+
*.swp
|
15
|
+
|
16
|
+
## Rubinius
|
17
|
+
*.rbc
|
18
|
+
.rbx
|
19
|
+
|
20
|
+
## PROJECT::GENERAL
|
21
|
+
*.gem
|
22
|
+
coverage
|
23
|
+
profiling
|
24
|
+
turbulence
|
25
|
+
rdoc
|
26
|
+
pkg
|
27
|
+
tmp
|
28
|
+
doc
|
29
|
+
log
|
30
|
+
.yardoc
|
31
|
+
measurements
|
32
|
+
|
33
|
+
## BUNDLER
|
34
|
+
.bundle
|
35
|
+
Gemfile.lock
|
36
|
+
|
37
|
+
## PROJECT::SPECIFIC
|
data/.rspec
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use @$(basename `pwd`) --create
|
data/.travis.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
language: ruby
|
2
|
+
before_install: gem install bundler
|
3
|
+
bundler_args: --without yard guard benchmarks
|
4
|
+
script: "bundle exec rake ci"
|
5
|
+
rvm:
|
6
|
+
- ree
|
7
|
+
- 1.8.7
|
8
|
+
- 1.9.2
|
9
|
+
- 1.9.3
|
10
|
+
- 2.0.0
|
11
|
+
- ruby-head
|
12
|
+
- rbx-18mode
|
13
|
+
- rbx-19mode
|
14
|
+
- jruby-18mode
|
15
|
+
notifications:
|
16
|
+
irc:
|
17
|
+
channels:
|
18
|
+
- irc.freenode.org#datamapper
|
19
|
+
on_success: never
|
20
|
+
on_failure: change
|
21
|
+
email:
|
22
|
+
recipients:
|
23
|
+
- dan.kubb@gmail.com
|
24
|
+
on_success: never
|
25
|
+
on_failure: change
|
26
|
+
matrix:
|
27
|
+
include:
|
28
|
+
- rvm: jruby-19mode
|
29
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
30
|
+
- rvm: jruby-head
|
31
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
32
|
+
allow_failures:
|
33
|
+
# mutant fails
|
34
|
+
- rvm: 1.9.3
|
35
|
+
- rvm: rbx-19mode
|
data/.yardopts
ADDED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Contributing
|
2
|
+
------------
|
3
|
+
|
4
|
+
* If you want your code merged into the mainline, please discuss the proposed changes with me before doing any work on it. This library is still in early development, and the direction it is going may not always be clear. Some features may not be appropriate yet, may need to be deferred until later when the foundation for them is laid, or may be more applicable in a plugin.
|
5
|
+
* Fork the project.
|
6
|
+
* Make your feature addition or bug fix.
|
7
|
+
* Follow this [style guide](https://github.com/dkubb/styleguide).
|
8
|
+
* Add specs for it. This is important so I don't break it in a future version unintentionally. Tests must cover all branches within the code, and code must be fully covered.
|
9
|
+
* Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
10
|
+
* Run "rake ci". This must pass and not show any regressions in the metrics for the code to be merged.
|
11
|
+
* Send me a pull request. Bonus points for topic branches.
|
data/Gemfile
ADDED
data/Gemfile.devtools
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem 'rake', '~> 10.0.4'
|
5
|
+
gem 'rspec', '~> 2.13.0'
|
6
|
+
gem 'yard', '~> 0.8.5.2'
|
7
|
+
end
|
8
|
+
|
9
|
+
group :yard do
|
10
|
+
gem 'kramdown', '~> 1.0.1'
|
11
|
+
end
|
12
|
+
|
13
|
+
group :guard do
|
14
|
+
gem 'guard', '~> 1.7.0'
|
15
|
+
gem 'guard-bundler', '~> 1.0.0'
|
16
|
+
gem 'guard-rspec', '~> 2.5.2'
|
17
|
+
|
18
|
+
# file system change event handling
|
19
|
+
gem 'listen', '~> 0.7.3'
|
20
|
+
gem 'rb-fchange', '~> 0.0.6', :require => false
|
21
|
+
gem 'rb-fsevent', '~> 0.9.3', :require => false
|
22
|
+
gem 'rb-inotify', '~> 0.9.0', :require => false
|
23
|
+
|
24
|
+
# notification handling
|
25
|
+
gem 'libnotify', '~> 0.8.0', :require => false
|
26
|
+
gem 'rb-notifu', '~> 0.0.4', :require => false
|
27
|
+
gem 'terminal-notifier-guard', '~> 1.5.3', :require => false
|
28
|
+
end
|
29
|
+
|
30
|
+
group :metrics do
|
31
|
+
gem 'backports', '~> 3.3', '>= 3.3.0'
|
32
|
+
gem 'coveralls', '~> 0.6.4'
|
33
|
+
gem 'flay', '~> 2.1.0'
|
34
|
+
gem 'flog', '~> 3.2.3'
|
35
|
+
gem 'reek', '~> 1.3.1', :git => 'https://github.com/troessner/reek.git'
|
36
|
+
gem 'simplecov', '~> 0.7.1'
|
37
|
+
gem 'yardstick', '~> 0.9.5'
|
38
|
+
gem 'yard-spellcheck', '~> 0.1.5'
|
39
|
+
|
40
|
+
platforms :mri_19, :rbx do
|
41
|
+
gem 'mutant', '~> 0.2.20'
|
42
|
+
end
|
43
|
+
|
44
|
+
platforms :rbx do
|
45
|
+
gem 'pelusa', '~> 0.2.2'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
group :benchmarks do
|
50
|
+
gem 'rbench', '~> 0.2.3'
|
51
|
+
end
|
52
|
+
|
53
|
+
platform :jruby do
|
54
|
+
group :jruby do
|
55
|
+
gem 'jruby-openssl', '~> 0.8.5'
|
56
|
+
end
|
57
|
+
end
|
data/Guardfile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
guard :bundler do
|
4
|
+
watch('Gemfile')
|
5
|
+
end
|
6
|
+
|
7
|
+
guard :rspec, :cli => File.read('.rspec').split.join(' '), :keep_failed => false do
|
8
|
+
# run all specs if configuration is modified
|
9
|
+
watch('Guardfile') { 'spec' }
|
10
|
+
watch('Gemfile.lock') { 'spec' }
|
11
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
12
|
+
|
13
|
+
# run all specs if supporting files files are modified
|
14
|
+
watch(%r{\Aspec/(?:lib|support|shared)/.+\.rb\z}) { 'spec' }
|
15
|
+
|
16
|
+
# run unit specs if associated lib code is modified
|
17
|
+
watch(%r{\Alib/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}"] }
|
18
|
+
watch(%r{\Alib/(.+)/support/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}/#{m[2]}"] }
|
19
|
+
watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { 'spec' }
|
20
|
+
|
21
|
+
# run a spec if it is modified
|
22
|
+
watch(%r{\Aspec/(?:unit|integration)/.+_spec\.rb\z})
|
23
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009-2013 Dan Kubb
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,187 @@
|
|
1
|
+
axiom
|
2
|
+
=====
|
3
|
+
|
4
|
+
Simplifies querying of structured data using relational algebra.
|
5
|
+
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/axiom.png)][gem]
|
7
|
+
[![Build Status](https://secure.travis-ci.org/dkubb/axiom.png?branch=master)][travis]
|
8
|
+
[![Dependency Status](https://gemnasium.com/dkubb/axiom.png)][gemnasium]
|
9
|
+
[![Code Climate](https://codeclimate.com/github/dkubb/axiom.png)][codeclimate]
|
10
|
+
[![Coverage Status](https://coveralls.io/repos/dkubb/axiom/badge.png?branch=master)][coveralls]
|
11
|
+
|
12
|
+
[gem]: https://rubygems.org/gems/axiom
|
13
|
+
[travis]: https://travis-ci.org/dkubb/axiom
|
14
|
+
[gemnasium]: https://gemnasium.com/dkubb/axiom
|
15
|
+
[codeclimate]: https://codeclimate.com/github/dkubb/axiom
|
16
|
+
[coveralls]: https://coveralls.io/r/dkubb/axiom
|
17
|
+
|
18
|
+
Installation
|
19
|
+
------------
|
20
|
+
|
21
|
+
With Rubygems:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
$ gem install axiom
|
25
|
+
$ irb -rubygems
|
26
|
+
>> require 'axiom'
|
27
|
+
=> true
|
28
|
+
```
|
29
|
+
|
30
|
+
With git and local working copy:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
$ git clone git://github.com/dkubb/axiom.git
|
34
|
+
$ cd axiom
|
35
|
+
$ rake install
|
36
|
+
$ irb -rubygems
|
37
|
+
>> require 'axiom'
|
38
|
+
=> true
|
39
|
+
```
|
40
|
+
|
41
|
+
Usage
|
42
|
+
-----
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
relation = Axiom::Relation.new(
|
46
|
+
[ [ :id, String ], [ :name, String ], [ :color, String ], [ :weight, Float ], [ :city, String ] ],
|
47
|
+
[
|
48
|
+
[ 'P1', 'Nut', 'Red', 12.0, 'London' ],
|
49
|
+
[ 'P2', 'Bolt', 'Green', 17.0, 'Paris' ],
|
50
|
+
[ 'P3', 'Screw', 'Blue', 17.0, 'Oslo' ],
|
51
|
+
[ 'P4', 'Screw', 'Red', 14.0, 'London' ],
|
52
|
+
[ 'P5', 'Cam', 'Blue', 12.0, 'Paris' ],
|
53
|
+
[ 'P6', 'Cog', 'Red', 19.0, 'London' ],
|
54
|
+
]
|
55
|
+
)
|
56
|
+
|
57
|
+
# Relational Operators
|
58
|
+
# --------------------
|
59
|
+
|
60
|
+
# projection
|
61
|
+
new_relation = relation.project([ :id ])
|
62
|
+
|
63
|
+
# removal
|
64
|
+
new_relation = relation.remove([ :name ])
|
65
|
+
|
66
|
+
# rename
|
67
|
+
new_relation = relation.rename(id: :other_id, name: :other_name)
|
68
|
+
|
69
|
+
# restriction
|
70
|
+
new_relation = relation.restrict { |r| r.name.eq('Screw').or(r.city.eq('London')) }
|
71
|
+
new_relation = relation.restrict(relation.name.eq('Screw'))
|
72
|
+
new_relation = relation.restrict(name: 'Screw')
|
73
|
+
new_relation = relation.restrict([ [ :name, 'Screw' ] ])
|
74
|
+
|
75
|
+
# natural join
|
76
|
+
new_relation = relation.join(other) # OR relation + other
|
77
|
+
|
78
|
+
# product
|
79
|
+
new_relation = relation.product(other) # OR relation * other
|
80
|
+
|
81
|
+
# intersection
|
82
|
+
new_relation = relation.intersect(other) # OR relation & other
|
83
|
+
|
84
|
+
# union
|
85
|
+
new_relation = relation.union(other) # OR relation | other
|
86
|
+
|
87
|
+
# difference
|
88
|
+
new_relation = relation.difference(other) # OR relation - other
|
89
|
+
|
90
|
+
# theta-join
|
91
|
+
new_relation = relation.join(other) { |r| r.id.gte(r.other_id) }
|
92
|
+
|
93
|
+
# NOTE: theta-join is effectively restricting a product of the relations
|
94
|
+
|
95
|
+
# extend
|
96
|
+
new_relation = relation.extend { |r| r.add(:pounds, r.weight * 2.2) }
|
97
|
+
new_relation = relation.extend { |r| r.add(:pounds) { |t| t[:weight] * 2.2 } }
|
98
|
+
|
99
|
+
# summarize
|
100
|
+
new_relation = relation.summarize(relation.project([ :city ])) { |r| r.add(:count, r.id.count) }
|
101
|
+
new_relation = relation.summarize(relation.project([ :city ])) { |r| r.add(:count) { |acc, t| acc.to_i + 1 } }
|
102
|
+
|
103
|
+
# Non-Relational Operators
|
104
|
+
# ------------------------
|
105
|
+
|
106
|
+
# returns a set that represents the relation header
|
107
|
+
header = relation.header
|
108
|
+
|
109
|
+
# a relation is Enumerable
|
110
|
+
relation = relation.each { |tuple| ... }
|
111
|
+
|
112
|
+
# order by attribute and direction
|
113
|
+
ordered = relation.sort_by { |r| [ r.city.desc, r.name, r.color, r.id, r.weight ] }
|
114
|
+
|
115
|
+
# reverse the relation (only allowed if ordered)
|
116
|
+
new_relation = ordered.reverse
|
117
|
+
|
118
|
+
# offset (only allowed if ordered)
|
119
|
+
new_relation = ordered.drop(5)
|
120
|
+
|
121
|
+
# limiting (only allowed if ordered)
|
122
|
+
new_relation = ordered.take(10)
|
123
|
+
|
124
|
+
# get the first n tuples (only allowed if ordered)
|
125
|
+
new_relation = ordered.first # default is 1
|
126
|
+
new_relation = ordered.first(5)
|
127
|
+
|
128
|
+
# get the last n tuples (only allowed if ordered)
|
129
|
+
new_relation = ordered.last # default is 1
|
130
|
+
new_relation = ordered.last(5)
|
131
|
+
|
132
|
+
# get a tuple from a relation containing exactly one tuple
|
133
|
+
tuple = relation.one
|
134
|
+
|
135
|
+
# Updatable Views
|
136
|
+
# ---------------
|
137
|
+
|
138
|
+
# add a set to a relation variable
|
139
|
+
new_relation = relation.insert(other)
|
140
|
+
|
141
|
+
# remove a set from a relation variable
|
142
|
+
new_relation = relation.delete(other)
|
143
|
+
|
144
|
+
# replace a relation variable with another set
|
145
|
+
new_relation = relation.replace(other)
|
146
|
+
|
147
|
+
# each subset of unique keys as header objects
|
148
|
+
keys = header.keys
|
149
|
+
```
|
150
|
+
|
151
|
+
Goals
|
152
|
+
-----
|
153
|
+
|
154
|
+
The purpose of this project is to expand my knowledge of relational algebra by attempting to implement a simple query system using the primitive operations defined in relational algebra.
|
155
|
+
|
156
|
+
Most of the design is heavily inspired from [koios](https://github.com/carllerche/koios) and [arel](https://github.com/rails/arel). The reason I decided to write my own and not just build on top of those systems was not so much because I don't like the code/API in those projects, it's more because I wanted to gain a depth of understanding that can only be earned by trying to solve the problem myself.
|
157
|
+
|
158
|
+
I should note though that I don't plan to just re-implement those systems with a different API, or different internals, I plan to make something that surpasses them in several areas. For example, I want to be able to join information from multiple datastores and represent it as a single relation. I want to be able to insert, update or delete from that relation and have those changes propagated back to the right datastore. This is not an easy feat, since it is basically the updatable view problem that RDBMS' struggle with. While I do think there are some cases where relations will become read-only, I think it will be possible to propagate writes properly in this manner. I certainly think for the current use cases in DataMapper this should work quite well.
|
159
|
+
|
160
|
+
The ability to join data from multiple datastores and have it presented in a consistent manner will solve one of the longest standing problems in DataMapper, namely how do we do cross repository joins. It should be possible to construct one query for one datastore, and then another query for another datastore and then join them. Since they are using different engines Axiom will know to perform each query *natively* and then join the results in-memory seamlessly. It should also be possible to reorganize the queries so that as much work as possible is done natively as opposed to in-memory, which is considered the last resort.
|
161
|
+
|
162
|
+
Not only does this work nicely with associations, but it will allow DataMapper to perform mapping in a more powerful way. You'll be able to construct a join from multiple datastores, and set that as the base for your model. Each DM Resource would work as normal, but again writes could be propagated back to the appropriate datastore. You'd be able to split your data up between different datastores, but assemble it into one coherent view.
|
163
|
+
|
164
|
+
Related Projects
|
165
|
+
----------------
|
166
|
+
|
167
|
+
* [axiom-optimizer](https://github.com/dkubb/axiom-optimizer)
|
168
|
+
|
169
|
+
This is an optimizer that takes a Axiom relation, scalar or aggregate function and will transform it into something equivalent but simpler in structure to the original.
|
170
|
+
|
171
|
+
* [axiom-sql-generator](https://github.com/dkubb/axiom-sql-generator)
|
172
|
+
|
173
|
+
This is a visitor class that takes a Axiom relation and generates valid SQL from it.
|
174
|
+
|
175
|
+
* [axiom-do-adapter](https://github.com/dkubb/axiom-do-adapter)
|
176
|
+
|
177
|
+
This is a system that manages the database connections and executes the SQL generated from the relations.
|
178
|
+
|
179
|
+
Contributing
|
180
|
+
------------
|
181
|
+
|
182
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
183
|
+
|
184
|
+
Copyright
|
185
|
+
---------
|
186
|
+
|
187
|
+
Copyright © 2009-2013 Dan Kubb. See LICENSE for details.
|
data/Rakefile
ADDED
data/TODO
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
* TODO:
|
2
|
+
|
3
|
+
* Change Algebra::Extension#extensions to be a non-primtive
|
4
|
+
* May also change EvaluationContext#functions to return a set of functions.
|
5
|
+
|
6
|
+
* Add key minimization to Header
|
7
|
+
* When unioning two keys together it is really simple to end up
|
8
|
+
with indexes that overlap and cause an exception.
|
9
|
+
|
10
|
+
* Add Header#size
|
11
|
+
* Replace code that coerces the Header to an Array in order to get the size
|
12
|
+
with Header#size.
|
13
|
+
|
14
|
+
* Make Equalizer handle subclasses without having to specify the attribtues
|
15
|
+
again in each descendant.
|
16
|
+
|
17
|
+
* Allow Evaluator::Context to be used like:
|
18
|
+
|
19
|
+
relation.extend { new_extensions }
|
20
|
+
|
21
|
+
This will require the return value from the block to become useful.
|
22
|
+
|
23
|
+
* Add domain object for Extensions and Summarizers
|
24
|
+
* Add Evaluator::Context subclasses for Extensions and Summarizers, and return
|
25
|
+
those as instances rather than Hashes of attributes and functions.
|
26
|
+
|
27
|
+
* Convert Tuple to a Struct
|
28
|
+
* Make Header a "Struct Class", and copy all the Header instance methods to
|
29
|
+
the class level. Move all the Tuple instance methods into the Header
|
30
|
+
instance.
|
31
|
+
* Rename Header as Tuple
|
32
|
+
* Make sure the Tuple has a class level method called #header that returns
|
33
|
+
the set of attributes.
|
34
|
+
* Use a class variable to store each "Tuple class" so that anything with a
|
35
|
+
similar header will be reused.
|
36
|
+
|
37
|
+
* Remove mean/variance/stddev modules from Virtus::Attribute::Comparable
|
38
|
+
* It makes no sense for comparable objects to be "averaged", what would it
|
39
|
+
mean to get the average string?
|
40
|
+
|
41
|
+
* Remove Order, Reverse, Limit and Offset from the Relation inheritance chain
|
42
|
+
* Instead make it so they are proxy classes that wrap Relations, but
|
43
|
+
proxy method calls to the Relation methods, and then wrap the return
|
44
|
+
value (assuming it's a Relation) in a copy of itself.
|
45
|
+
* Also this will allow knowledge of #directions to be removed from
|
46
|
+
all the Relation classes. Only the Ranking classes will need to know
|
47
|
+
about directions.
|
48
|
+
* The Reverse class will probably not be needed either. All we need is
|
49
|
+
for the #reverse method to create a new Order with the directions
|
50
|
+
reversed.
|
51
|
+
* Remove the knowledge of directions from materialized relations
|
52
|
+
and instead wrap materialized relations in the Order object
|
53
|
+
if any.
|
54
|
+
|
55
|
+
* Add Relation#group and Relation#ungroup
|
56
|
+
|
57
|
+
* Update Attributes so that constraints are modelled using predicates,
|
58
|
+
so that when "join-ability" is tested, the predicates can just be
|
59
|
+
compared for equality.
|
60
|
+
* Create an object that can wrap a predicate, and if it fails it will
|
61
|
+
set the object's error state, and then propagate the status to the
|
62
|
+
caller. This will allow a "complex" predicate to set the errors
|
63
|
+
on tuples, while still allowing all the same objects to be used.
|
64
|
+
|
65
|
+
* Update memoization to take into account the arguments passed into
|
66
|
+
the method. It should memoize differently for different
|
67
|
+
methods. Perhaps it could have a special case for methods
|
68
|
+
with a 0-arity vs n-arity methods, but it needs to handle cases
|
69
|
+
like with #hash that accept no args, and #optimize that accepts
|
70
|
+
1 arg.
|
71
|
+
|
72
|
+
* Within the restriction context, make sure the attributes have aliases for:
|
73
|
+
* Alias #== to #eq (may break alot)
|
74
|
+
* Alias #!= to #ne (in 1.9 only)
|
75
|
+
* Alias #>= to #gte
|
76
|
+
* Alias #> to #gt
|
77
|
+
* Alias #<= to #lte
|
78
|
+
* Alias #< to #lt
|
79
|
+
* Alias #=~ to #match
|
80
|
+
|
81
|
+
* Within the sort_by context, make sure the attributes have aliases for:
|
82
|
+
* Alias #@+ to #asc
|
83
|
+
* Alias #@- to #desc
|
84
|
+
|
85
|
+
* Handle case where one attribute is required, and the other is not, when joined
|
86
|
+
(or other ops), the resulting attribute should always be required.
|
87
|
+
* In other operations, the resulting attribute may be something else, but will
|
88
|
+
need to research to know how to handle this.
|
89
|
+
* Current behaviour is to require both attributes are equivalent all the way
|
90
|
+
around to allow them to be joined. This constraint will need to be relaxed
|
91
|
+
to implement this new behaviour.
|
92
|
+
|
93
|
+
* Add operations for efficiently determining the following Enumerable properties
|
94
|
+
of a relation, when no block is provided:
|
95
|
+
* all?
|
96
|
+
* any?
|
97
|
+
* empty?
|
98
|
+
* one?
|
99
|
+
* none?
|
100
|
+
* many?
|
101
|
+
* include? / member?
|
102
|
+
* min / max / minmax (when the tuples are sorted)
|
103
|
+
|
104
|
+
* Rename Order to Sorted
|
105
|
+
* In other languages, "ordered" implies that the order tuples are added to the
|
106
|
+
relation is tracked, while "sorted" means that they are sorted according to
|
107
|
+
some criteria. The latter is closer to what is meant.
|