axiom 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.travis.yml +11 -20
- data/Gemfile +5 -2
- data/Gemfile.devtools +26 -28
- data/Guardfile +18 -9
- data/README.md +20 -39
- data/axiom.gemspec +17 -18
- data/benchmarks/memory.rb +14 -14
- data/benchmarks/speed.rb +14 -14
- data/config/devtools.yml +2 -0
- data/config/flay.yml +1 -1
- data/config/flog.yml +1 -1
- data/config/reek.yml +3 -3
- data/config/rubocop.yml +62 -0
- data/lib/axiom.rb +17 -20
- data/lib/axiom/aggregate.rb +2 -5
- data/lib/axiom/aggregate/count.rb +4 -4
- data/lib/axiom/aggregate/maximum.rb +3 -3
- data/lib/axiom/aggregate/mean.rb +9 -9
- data/lib/axiom/aggregate/minimum.rb +3 -3
- data/lib/axiom/aggregate/standard_deviation.rb +5 -4
- data/lib/axiom/aggregate/sum.rb +4 -4
- data/lib/axiom/aggregate/variance.rb +15 -12
- data/lib/axiom/algebra/extension.rb +2 -2
- data/lib/axiom/algebra/projection.rb +3 -3
- data/lib/axiom/algebra/rename/aliases.rb +6 -6
- data/lib/axiom/algebra/restriction.rb +1 -1
- data/lib/axiom/algebra/summarization.rb +5 -7
- data/lib/axiom/algebra/summarization/summaries.rb +2 -2
- data/lib/axiom/algebra/union.rb +1 -1
- data/lib/axiom/attribute.rb +24 -33
- data/lib/axiom/attribute/boolean.rb +10 -20
- data/lib/axiom/attribute/class.rb +5 -5
- data/lib/axiom/attribute/date.rb +5 -19
- data/lib/axiom/attribute/date_time.rb +5 -19
- data/lib/axiom/attribute/decimal.rb +5 -5
- data/lib/axiom/attribute/float.rb +5 -7
- data/lib/axiom/attribute/integer.rb +5 -5
- data/lib/axiom/attribute/numeric.rb +15 -39
- data/lib/axiom/attribute/object.rb +5 -5
- data/lib/axiom/attribute/string.rb +16 -63
- data/lib/axiom/attribute/time.rb +5 -19
- data/lib/axiom/function.rb +14 -2
- data/lib/axiom/function/binary.rb +17 -0
- data/lib/axiom/function/connective.rb +6 -3
- data/lib/axiom/function/connective/conjunction.rb +2 -2
- data/lib/axiom/function/connective/disjunction.rb +2 -2
- data/lib/axiom/function/numeric.rb +13 -0
- data/lib/axiom/function/numeric/absolute.rb +1 -1
- data/lib/axiom/function/numeric/division.rb +18 -2
- data/lib/axiom/function/numeric/exponentiation.rb +1 -1
- data/lib/axiom/function/numeric/modulo.rb +1 -1
- data/lib/axiom/function/numeric/square_root.rb +19 -3
- data/lib/axiom/function/predicate.rb +6 -3
- data/lib/axiom/function/predicate/exclusion.rb +2 -2
- data/lib/axiom/function/predicate/inclusion.rb +2 -2
- data/lib/axiom/function/proposition.rb +12 -9
- data/lib/axiom/function/string/length.rb +6 -3
- data/lib/axiom/function/unary.rb +12 -0
- data/lib/axiom/relation.rb +31 -50
- data/lib/axiom/relation/base.rb +3 -3
- data/lib/axiom/relation/empty.rb +3 -32
- data/lib/axiom/relation/header.rb +31 -15
- data/lib/axiom/relation/keys.rb +4 -4
- data/lib/axiom/relation/materialized.rb +2 -1
- data/lib/axiom/relation/operation/limit.rb +51 -0
- data/lib/axiom/relation/operation/order.rb +21 -28
- data/lib/axiom/relation/operation/order/direction_set.rb +1 -1
- data/lib/axiom/relation/proxy.rb +2 -2
- data/lib/axiom/relation/variable.rb +117 -0
- data/lib/axiom/support/equalizer.rb +9 -2
- data/lib/axiom/support/evaluator.rb +4 -1
- data/lib/axiom/tuple.rb +2 -2
- data/lib/axiom/version.rb +1 -1
- data/spec/integration/axiom/algebra/join_spec.rb +2 -2
- data/spec/integration/axiom/algebra/product_spec.rb +2 -2
- data/spec/integration/axiom/algebra/projection_spec.rb +6 -6
- data/spec/integration/axiom/algebra/summarization_spec.rb +9 -9
- data/spec/integration/axiom/relation/efficient_enumerable_spec.rb +18 -18
- data/spec/integration/axiom/relation/mutable_enumerator_spec.rb +51 -0
- data/spec/integration/axiom/relation/variable/thread_safe_spec.rb +45 -0
- data/spec/integration/axiom/relation/writable_relations_spec.rb +14 -14
- data/spec/shared/invertible_method_behaviour.rb +1 -1
- data/spec/spec_helper.rb +23 -15
- data/spec/support/config_alias.rb +2 -0
- data/spec/unit/axiom/aggregate/call_spec.rb +5 -5
- data/spec/unit/axiom/aggregate/class_methods/finalize_spec.rb +3 -3
- data/spec/unit/axiom/aggregate/count/class_methods/call_spec.rb +3 -3
- data/spec/unit/axiom/aggregate/count/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/aggregate/count/methods/count_spec.rb +1 -1
- data/spec/unit/axiom/aggregate/default_spec.rb +2 -2
- data/spec/unit/axiom/aggregate/finalize_spec.rb +3 -3
- data/spec/unit/axiom/aggregate/maximum/class_methods/call_spec.rb +3 -3
- data/spec/unit/axiom/aggregate/maximum/methods/maximum_spec.rb +2 -2
- data/spec/unit/axiom/aggregate/maximum/type_spec.rb +4 -4
- data/spec/unit/axiom/aggregate/mean/class_methods/call_spec.rb +6 -6
- data/spec/unit/axiom/aggregate/mean/class_methods/default_spec.rb +1 -1
- data/spec/unit/axiom/aggregate/mean/class_methods/finalize_spec.rb +4 -4
- data/spec/unit/axiom/aggregate/mean/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/aggregate/mean/methods/mean_spec.rb +2 -2
- data/spec/unit/axiom/aggregate/minimum/class_methods/call_spec.rb +3 -3
- data/spec/unit/axiom/aggregate/minimum/methods/minimum_spec.rb +2 -2
- data/spec/unit/axiom/aggregate/minimum/type_spec.rb +4 -4
- data/spec/unit/axiom/aggregate/standard_deviation/class_methods/finalize_spec.rb +4 -4
- data/spec/unit/axiom/aggregate/standard_deviation/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/aggregate/standard_deviation/methods/standard_deviation_spec.rb +2 -2
- data/spec/unit/axiom/aggregate/sum/class_methods/call_spec.rb +3 -3
- data/spec/unit/axiom/aggregate/sum/default_spec.rb +3 -3
- data/spec/unit/axiom/aggregate/sum/methods/sum_spec.rb +1 -1
- data/spec/unit/axiom/aggregate/sum/type_spec.rb +4 -4
- data/spec/unit/axiom/aggregate/variance/class_methods/call_spec.rb +9 -9
- data/spec/unit/axiom/aggregate/variance/class_methods/default_spec.rb +1 -1
- data/spec/unit/axiom/aggregate/variance/class_methods/finalize_spec.rb +11 -3
- data/spec/unit/axiom/aggregate/variance/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/aggregate/variance/methods/variance_spec.rb +2 -2
- data/spec/unit/axiom/algebra/difference/delete_spec.rb +6 -6
- data/spec/unit/axiom/algebra/difference/each_spec.rb +6 -6
- data/spec/unit/axiom/algebra/difference/insert_spec.rb +5 -5
- data/spec/unit/axiom/algebra/difference/methods/difference_spec.rb +5 -5
- data/spec/unit/axiom/algebra/extension/class_methods/new_spec.rb +4 -4
- data/spec/unit/axiom/algebra/extension/delete_spec.rb +11 -11
- data/spec/unit/axiom/algebra/extension/each_spec.rb +7 -7
- data/spec/unit/axiom/algebra/extension/eql_spec.rb +5 -5
- data/spec/unit/axiom/algebra/extension/extensions_spec.rb +3 -3
- data/spec/unit/axiom/algebra/extension/hash_spec.rb +3 -3
- data/spec/unit/axiom/algebra/extension/header_spec.rb +4 -4
- data/spec/unit/axiom/algebra/extension/insert_spec.rb +11 -11
- data/spec/unit/axiom/algebra/extension/methods/extend_spec.rb +6 -6
- data/spec/unit/axiom/algebra/extension/operand_spec.rb +4 -4
- data/spec/unit/axiom/algebra/intersection/delete_spec.rb +6 -6
- data/spec/unit/axiom/algebra/intersection/each_spec.rb +6 -6
- data/spec/unit/axiom/algebra/intersection/insert_spec.rb +5 -5
- data/spec/unit/axiom/algebra/intersection/methods/intersect_spec.rb +5 -5
- data/spec/unit/axiom/algebra/join/class_methods/new_spec.rb +5 -5
- data/spec/unit/axiom/algebra/join/delete_spec.rb +8 -8
- data/spec/unit/axiom/algebra/join/each_spec.rb +15 -15
- data/spec/unit/axiom/algebra/join/insert_spec.rb +8 -8
- data/spec/unit/axiom/algebra/join/join_header_spec.rb +4 -4
- data/spec/unit/axiom/algebra/join/methods/join_spec.rb +6 -6
- data/spec/unit/axiom/algebra/product/class_methods/new_spec.rb +6 -6
- data/spec/unit/axiom/algebra/product/delete_spec.rb +4 -4
- data/spec/unit/axiom/algebra/product/each_spec.rb +8 -8
- data/spec/unit/axiom/algebra/product/insert_spec.rb +4 -4
- data/spec/unit/axiom/algebra/product/methods/product_spec.rb +4 -4
- data/spec/unit/axiom/algebra/projection/delete_spec.rb +11 -11
- data/spec/unit/axiom/algebra/projection/each_spec.rb +7 -7
- data/spec/unit/axiom/algebra/projection/eql_spec.rb +5 -5
- data/spec/unit/axiom/algebra/projection/hash_spec.rb +4 -4
- data/spec/unit/axiom/algebra/projection/header_spec.rb +3 -3
- data/spec/unit/axiom/algebra/projection/insert_spec.rb +14 -14
- data/spec/unit/axiom/algebra/projection/methods/project_spec.rb +5 -5
- data/spec/unit/axiom/algebra/projection/methods/remove_spec.rb +5 -5
- data/spec/unit/axiom/algebra/rename/aliases/class_methods/coerce_spec.rb +2 -2
- data/spec/unit/axiom/algebra/rename/aliases/each_spec.rb +4 -4
- data/spec/unit/axiom/algebra/rename/aliases/element_reader_spec.rb +2 -2
- data/spec/unit/axiom/algebra/rename/aliases/to_hash_spec.rb +2 -2
- data/spec/unit/axiom/algebra/rename/aliases/union_spec.rb +1 -1
- data/spec/unit/axiom/algebra/rename/aliases_spec.rb +2 -2
- data/spec/unit/axiom/algebra/rename/delete_spec.rb +6 -6
- data/spec/unit/axiom/algebra/rename/directions_spec.rb +4 -4
- data/spec/unit/axiom/algebra/rename/each_spec.rb +6 -6
- data/spec/unit/axiom/algebra/rename/eql_spec.rb +5 -5
- data/spec/unit/axiom/algebra/rename/hash_spec.rb +3 -3
- data/spec/unit/axiom/algebra/rename/header_spec.rb +3 -3
- data/spec/unit/axiom/algebra/rename/insert_spec.rb +6 -6
- data/spec/unit/axiom/algebra/rename/methods/rename_spec.rb +4 -4
- data/spec/unit/axiom/algebra/restriction/delete_spec.rb +9 -9
- data/spec/unit/axiom/algebra/restriction/each_spec.rb +12 -12
- data/spec/unit/axiom/algebra/restriction/eql_spec.rb +4 -4
- data/spec/unit/axiom/algebra/restriction/hash_spec.rb +3 -3
- data/spec/unit/axiom/algebra/restriction/insert_spec.rb +9 -9
- data/spec/unit/axiom/algebra/restriction/methods/restrict_spec.rb +12 -15
- data/spec/unit/axiom/algebra/restriction/predicate_spec.rb +4 -4
- data/spec/unit/axiom/algebra/summarization/class_methods/new_spec.rb +6 -6
- data/spec/unit/axiom/algebra/summarization/delete_spec.rb +3 -3
- data/spec/unit/axiom/algebra/summarization/each_spec.rb +5 -5
- data/spec/unit/axiom/algebra/summarization/eql_spec.rb +3 -3
- data/spec/unit/axiom/algebra/summarization/hash_spec.rb +2 -2
- data/spec/unit/axiom/algebra/summarization/header_spec.rb +3 -3
- data/spec/unit/axiom/algebra/summarization/insert_spec.rb +3 -3
- data/spec/unit/axiom/algebra/summarization/methods/summarize_spec.rb +15 -15
- data/spec/unit/axiom/algebra/summarization/summaries/summarize_by_spec.rb +6 -6
- data/spec/unit/axiom/algebra/summarization/summaries/to_hash_spec.rb +2 -2
- data/spec/unit/axiom/algebra/summarization/summarize_per_spec.rb +3 -3
- data/spec/unit/axiom/algebra/summarization/summarizers_spec.rb +3 -3
- data/spec/unit/axiom/algebra/summarization/summary/call_spec.rb +4 -4
- data/spec/unit/axiom/algebra/summarization/summary/summarize_by_spec.rb +9 -6
- data/spec/unit/axiom/algebra/union/delete_spec.rb +6 -6
- data/spec/unit/axiom/algebra/union/each_spec.rb +9 -9
- data/spec/unit/axiom/algebra/union/insert_spec.rb +5 -5
- data/spec/unit/axiom/algebra/union/methods/union_spec.rb +5 -5
- data/spec/unit/axiom/aliasable/inheritable_alias_spec.rb +6 -6
- data/spec/unit/axiom/attribute/{date/class_methods/primitive_spec.rb → boolean/class_methods/type_spec.rb} +3 -3
- data/spec/unit/axiom/attribute/boolean/{valid_value_predicate_spec.rb → include_predicate_spec.rb} +2 -2
- data/spec/unit/axiom/attribute/call_spec.rb +8 -4
- data/spec/unit/axiom/attribute/{time/class_methods/primitive_spec.rb → class/class_methods/type_spec.rb} +3 -3
- data/spec/unit/axiom/attribute/class_methods/coerce_spec.rb +6 -6
- data/spec/unit/axiom/attribute/class_methods/infer_type_spec.rb +15 -15
- data/spec/unit/axiom/attribute/class_methods/name_from_spec.rb +4 -4
- data/spec/unit/axiom/attribute/class_methods/new_spec.rb +1 -1
- data/spec/unit/axiom/attribute/{float/class_methods/primitive_spec.rb → date/class_methods/type_spec.rb} +3 -3
- data/spec/unit/axiom/attribute/{class/class_methods/primitive_spec.rb → date_time/class_methods/type_spec.rb} +3 -3
- data/spec/unit/axiom/attribute/decimal/class_methods/type_spec.rb +13 -0
- data/spec/unit/axiom/attribute/eql_spec.rb +5 -1
- data/spec/unit/axiom/attribute/equality_operator_spec.rb +5 -1
- data/spec/unit/axiom/attribute/float/class_methods/type_spec.rb +13 -0
- data/spec/unit/axiom/attribute/hash_spec.rb +6 -2
- data/spec/unit/axiom/attribute/{valid_value_predicate_spec.rb → include_predicate_spec.rb} +4 -8
- data/spec/unit/axiom/attribute/integer/class_methods/type_spec.rb +13 -0
- data/spec/unit/axiom/attribute/name_spec.rb +5 -1
- data/spec/unit/axiom/attribute/numeric/class_methods/type_spec.rb +13 -0
- data/spec/unit/axiom/attribute/numeric/eql_spec.rb +2 -2
- data/spec/unit/axiom/attribute/numeric/equality_operator_spec.rb +2 -2
- data/spec/unit/axiom/attribute/numeric/hash_spec.rb +6 -6
- data/spec/unit/axiom/attribute/numeric/{valid_value_predicate_spec.rb → include_predicate_spec.rb} +3 -3
- data/spec/unit/axiom/attribute/object/class_methods/type_spec.rb +13 -0
- data/spec/unit/axiom/attribute/optional_predicate_spec.rb +31 -0
- data/spec/unit/axiom/attribute/rename_spec.rb +9 -5
- data/spec/unit/axiom/attribute/required_predicate_spec.rb +8 -4
- data/spec/unit/axiom/attribute/string/class_methods/type_spec.rb +13 -0
- data/spec/unit/axiom/attribute/string/eql_spec.rb +5 -5
- data/spec/unit/axiom/attribute/string/equality_operator_spec.rb +5 -5
- data/spec/unit/axiom/attribute/string/hash_spec.rb +9 -9
- data/spec/unit/axiom/attribute/string/{valid_value_predicate_spec.rb → include_predicate_spec.rb} +3 -3
- data/spec/unit/axiom/attribute/time/class_methods/type_spec.rb +13 -0
- data/spec/unit/axiom/attribute/type_spec.rb +4 -4
- data/spec/unit/axiom/equalizer/class_method/new_spec.rb +11 -11
- data/spec/unit/axiom/equalizer/methods/eql_spec.rb +1 -1
- data/spec/unit/axiom/evaluator/context/add_spec.rb +5 -5
- data/spec/unit/axiom/evaluator/context/element_reader_spec.rb +5 -5
- data/spec/unit/axiom/evaluator/context/functions_spec.rb +1 -1
- data/spec/unit/axiom/evaluator/context/method_missing_spec.rb +5 -5
- data/spec/unit/axiom/evaluator/context/respond_to_predicate_spec.rb +3 -3
- data/spec/unit/axiom/evaluator/context/send_spec.rb +9 -9
- data/spec/unit/axiom/evaluator/context/yield_spec.rb +3 -3
- data/spec/unit/axiom/function/binary/call_spec.rb +4 -4
- data/spec/unit/axiom/function/binary/equality_operator_spec.rb +6 -6
- data/spec/unit/axiom/function/binary/invertible/class_methods/included_spec.rb +5 -5
- data/spec/unit/axiom/function/binary/invertible/inverse_spec.rb +5 -5
- data/spec/unit/axiom/function/binary/rename_spec.rb +9 -9
- data/spec/unit/axiom/function/binary/type_spec.rb +53 -0
- data/spec/unit/axiom/function/class_methods/extract_value_spec.rb +5 -5
- data/spec/unit/axiom/function/class_methods/rename_attributes_spec.rb +3 -3
- data/spec/unit/axiom/function/class_methods/type_spec.rb +12 -0
- data/spec/unit/axiom/function/comparable/class_methods/included_spec.rb +5 -5
- data/spec/unit/axiom/function/connective/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/function/connective/conjunction/methods/and_spec.rb +5 -5
- data/spec/unit/axiom/function/connective/disjunction/methods/or_spec.rb +5 -5
- data/spec/unit/axiom/function/connective/negation/class_methods/operation_spec.rb +1 -1
- data/spec/unit/axiom/function/connective/negation/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/connective/negation/methods/not_spec.rb +6 -6
- data/spec/unit/axiom/function/numeric/absolute/class_methods/operation_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/absolute/methods/absolute_spec.rb +2 -2
- data/spec/unit/axiom/function/numeric/addition/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/addition/methods/add_spec.rb +4 -4
- data/spec/unit/axiom/function/numeric/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/division/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/division/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/division/methods/divide_spec.rb +4 -4
- data/spec/unit/axiom/function/numeric/division/type_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/exponentiation/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/exponentiation/methods/exponent_spec.rb +4 -4
- data/spec/unit/axiom/function/numeric/modulo/methods/modulo_spec.rb +4 -4
- data/spec/unit/axiom/function/numeric/multiplication/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/multiplication/methods/multiply_spec.rb +4 -4
- data/spec/unit/axiom/function/numeric/square_root/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/function/numeric/square_root/methods/square_root_spec.rb +2 -2
- data/spec/unit/axiom/function/numeric/square_root/type_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/subtraction/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/subtraction/methods/subtract_spec.rb +4 -4
- data/spec/unit/axiom/function/numeric/unary_minus/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/unary_minus/class_methods/operation_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/unary_minus/methods/unary_minus_spec.rb +2 -2
- data/spec/unit/axiom/function/numeric/unary_plus/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/unary_plus/class_methods/operation_spec.rb +1 -1
- data/spec/unit/axiom/function/numeric/unary_plus/methods/unary_plus_spec.rb +2 -2
- data/spec/unit/axiom/function/predicate/call_spec.rb +5 -5
- data/spec/unit/axiom/function/predicate/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/function/predicate/enumerable/call_spec.rb +11 -11
- data/spec/unit/axiom/function/predicate/enumerable/class_methods/compare_method_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/equality/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/equality/class_methods/reverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/equality/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/exclusion/class_methods/call_spec.rb +4 -4
- data/spec/unit/axiom/function/predicate/exclusion/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/exclusion/inverse_spec.rb +3 -3
- data/spec/unit/axiom/function/predicate/exclusion/methods/exclude_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/greater_than/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/greater_than/class_methods/reverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/greater_than/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/class_methods/reverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/greater_than_or_equal_to/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/inclusion/class_methods/call_spec.rb +4 -4
- data/spec/unit/axiom/function/predicate/inclusion/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/inclusion/inverse_spec.rb +3 -3
- data/spec/unit/axiom/function/predicate/inclusion/methods/include_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/inequality/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/inequality/class_methods/reverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/inequality/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/less_than/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/less_than/class_methods/reverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/less_than/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/class_methods/reverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/less_than_or_equal_to/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/match/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/match/inverse_spec.rb +2 -2
- data/spec/unit/axiom/function/predicate/no_match/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/predicate/no_match/inverse_spec.rb +2 -2
- data/spec/unit/axiom/function/proposition/call_spec.rb +2 -2
- data/spec/unit/axiom/function/proposition/class_methods/new_spec.rb +4 -4
- data/spec/unit/axiom/function/proposition/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/function/proposition/contradiction/and_spec.rb +2 -2
- data/spec/unit/axiom/function/proposition/contradiction/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/proposition/contradiction/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/proposition/contradiction/or_spec.rb +2 -2
- data/spec/unit/axiom/function/proposition/inverse_spec.rb +6 -6
- data/spec/unit/axiom/function/proposition/rename_spec.rb +1 -1
- data/spec/unit/axiom/function/proposition/tautology/and_spec.rb +2 -2
- data/spec/unit/axiom/function/proposition/tautology/class_methods/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/proposition/tautology/inverse_spec.rb +1 -1
- data/spec/unit/axiom/function/proposition/tautology/or_spec.rb +2 -2
- data/spec/unit/axiom/function/rename_spec.rb +1 -1
- data/spec/unit/axiom/function/string/length/class_methods/type_spec.rb +11 -0
- data/spec/unit/axiom/function/string/length/methods/length_spec.rb +1 -1
- data/spec/unit/axiom/function/type_spec.rb +8 -1
- data/spec/unit/axiom/function/unary/call_spec.rb +7 -7
- data/spec/unit/axiom/function/unary/callable/call_spec.rb +4 -4
- data/spec/unit/axiom/function/unary/callable/included_spec.rb +1 -1
- data/spec/unit/axiom/function/unary/equality_operator_spec.rb +5 -5
- data/spec/unit/axiom/function/unary/hash_spec.rb +5 -5
- data/spec/unit/axiom/function/unary/invertible/class_methods/included_spec.rb +5 -5
- data/spec/unit/axiom/function/unary/invertible/inverse_spec.rb +2 -2
- data/spec/unit/axiom/function/unary/rename_spec.rb +7 -7
- data/spec/unit/axiom/function/unary/type_spec.rb +26 -0
- data/spec/unit/axiom/operation/binary/eql_spec.rb +4 -4
- data/spec/unit/axiom/operation/binary/hash_spec.rb +2 -2
- data/spec/unit/axiom/operation/binary/left_spec.rb +2 -2
- data/spec/unit/axiom/operation/binary/right_spec.rb +2 -2
- data/spec/unit/axiom/operation/unary/eql_spec.rb +2 -2
- data/spec/unit/axiom/operation/unary/hash_spec.rb +1 -1
- data/spec/unit/axiom/operation/unary/operand_spec.rb +2 -2
- data/spec/unit/axiom/relation/base/class_methods/new_spec.rb +20 -8
- data/spec/unit/axiom/relation/base/eql_spec.rb +12 -12
- data/spec/unit/axiom/relation/base/hash_spec.rb +4 -4
- data/spec/unit/axiom/relation/base/name_spec.rb +5 -34
- data/spec/unit/axiom/relation/class_methods/coerce_spec.rb +11 -5
- data/spec/unit/axiom/relation/class_methods/new_spec.rb +15 -7
- data/spec/unit/axiom/relation/directions_spec.rb +2 -2
- data/spec/unit/axiom/relation/each_spec.rb +10 -10
- data/spec/unit/axiom/relation/element_reader_spec.rb +4 -4
- data/spec/unit/axiom/relation/empty/class_methods/new_spec.rb +6 -20
- data/spec/unit/axiom/relation/empty/each_spec.rb +7 -22
- data/spec/unit/axiom/relation/empty/empty_predicate_spec.rb +1 -1
- data/spec/unit/axiom/relation/empty/header_spec.rb +3 -3
- data/spec/unit/axiom/relation/empty/size_spec.rb +1 -1
- data/spec/unit/axiom/relation/empty_predicate_spec.rb +2 -2
- data/spec/unit/axiom/relation/eql_spec.rb +10 -10
- data/spec/unit/axiom/relation/equality_operator_spec.rb +24 -14
- data/spec/unit/axiom/relation/hash_spec.rb +3 -3
- data/spec/unit/axiom/relation/header/call_spec.rb +5 -5
- data/spec/unit/axiom/relation/header/class_methods/coerce_spec.rb +13 -13
- data/spec/unit/axiom/relation/header/class_methods/new_spec.rb +4 -4
- data/spec/unit/axiom/relation/header/context_spec.rb +27 -0
- data/spec/unit/axiom/relation/header/difference_spec.rb +19 -19
- data/spec/unit/axiom/relation/header/each_spec.rb +6 -6
- data/spec/unit/axiom/relation/header/empty_predicate_spec.rb +1 -1
- data/spec/unit/axiom/relation/header/eql_spec.rb +6 -6
- data/spec/unit/axiom/relation/header/equality_operator_spec.rb +8 -8
- data/spec/unit/axiom/relation/header/extend_spec.rb +9 -9
- data/spec/unit/axiom/relation/header/hash_spec.rb +3 -3
- data/spec/unit/axiom/relation/header/intersect_spec.rb +19 -19
- data/spec/unit/axiom/relation/header/keys_spec.rb +5 -5
- data/spec/unit/axiom/relation/header/project_spec.rb +11 -11
- data/spec/unit/axiom/relation/header/rename_spec.rb +6 -6
- data/spec/unit/axiom/relation/header/to_ary_spec.rb +3 -3
- data/spec/unit/axiom/relation/header/union_spec.rb +20 -20
- data/spec/unit/axiom/relation/header_spec.rb +2 -2
- data/spec/unit/axiom/relation/include_predicate_spec.rb +4 -4
- data/spec/unit/axiom/relation/keys/class_methods/coerce_spec.rb +4 -4
- data/spec/unit/axiom/relation/keys/class_methods/new_spec.rb +5 -5
- data/spec/unit/axiom/relation/keys/difference_spec.rb +7 -7
- data/spec/unit/axiom/relation/keys/each_spec.rb +6 -6
- data/spec/unit/axiom/relation/keys/empty_predicate_spec.rb +1 -1
- data/spec/unit/axiom/relation/keys/extend_spec.rb +7 -7
- data/spec/unit/axiom/relation/keys/intersect_spec.rb +6 -6
- data/spec/unit/axiom/relation/keys/project_spec.rb +8 -8
- data/spec/unit/axiom/relation/keys/rename_spec.rb +5 -5
- data/spec/unit/axiom/relation/keys/to_ary_spec.rb +3 -3
- data/spec/unit/axiom/relation/keys/union_spec.rb +8 -8
- data/spec/unit/axiom/relation/materialize_spec.rb +3 -3
- data/spec/unit/axiom/relation/materialized/class_methods/new_spec.rb +19 -7
- data/spec/unit/axiom/relation/materialized/directions_spec.rb +4 -4
- data/spec/unit/axiom/relation/materialized/empty_predicate_spec.rb +2 -2
- data/spec/unit/axiom/relation/materialized/materialize_spec.rb +2 -2
- data/spec/unit/axiom/relation/materialized/materialized_predicate_spec.rb +1 -1
- data/spec/unit/axiom/relation/materialized/size_spec.rb +1 -1
- data/spec/unit/axiom/relation/materialized_predicate_spec.rb +1 -1
- data/spec/unit/axiom/relation/operation/binary/class_methods/included_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/binary/class_methods/new_spec.rb +3 -3
- data/spec/unit/axiom/relation/operation/binary/header_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/combination/class_methods/combine_tuples_spec.rb +18 -11
- data/spec/unit/axiom/relation/operation/combination/header_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/deletion/initialize_spec.rb +2 -2
- data/spec/unit/axiom/relation/operation/deletion/methods/delete_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/insertion/initialize_spec.rb +2 -2
- data/spec/unit/axiom/relation/operation/insertion/methods/insert_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/limit/class_methods/new_spec.rb +2 -2
- data/spec/unit/axiom/relation/operation/limit/delete_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/limit/directions_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/limit/each_spec.rb +7 -7
- data/spec/unit/axiom/relation/operation/limit/eql_spec.rb +6 -6
- data/spec/unit/axiom/relation/operation/limit/hash_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/limit/insert_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/limit/limit_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/limit/methods/first_spec.rb +6 -6
- data/spec/unit/axiom/relation/operation/limit/methods/last_spec.rb +6 -6
- data/spec/unit/axiom/relation/operation/limit/methods/one_spec.rb +63 -0
- data/spec/unit/axiom/relation/operation/limit/methods/take_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/offset/class_methods/new_spec.rb +2 -2
- data/spec/unit/axiom/relation/operation/offset/delete_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/offset/directions_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/offset/each_spec.rb +7 -7
- data/spec/unit/axiom/relation/operation/offset/eql_spec.rb +6 -6
- data/spec/unit/axiom/relation/operation/offset/hash_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/offset/insert_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/offset/methods/drop_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/offset/offset_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/order/ascending/class_methods/reverse_spec.rb +1 -1
- data/spec/unit/axiom/relation/operation/order/ascending/reverse_spec.rb +1 -1
- data/spec/unit/axiom/relation/operation/order/class_methods/new_spec.rb +117 -15
- data/spec/unit/axiom/relation/operation/order/delete_spec.rb +11 -11
- data/spec/unit/axiom/relation/operation/order/descending/class_methods/reverse_spec.rb +1 -1
- data/spec/unit/axiom/relation/operation/order/descending/reverse_spec.rb +1 -1
- data/spec/unit/axiom/relation/operation/order/direction/attribute_spec.rb +1 -1
- data/spec/unit/axiom/relation/operation/order/direction/call_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/order/direction/class_methods/coerce_spec.rb +3 -3
- data/spec/unit/axiom/relation/operation/order/direction/eql_predicate_spec.rb +1 -1
- data/spec/unit/axiom/relation/operation/order/direction/name_spec.rb +1 -1
- data/spec/unit/axiom/relation/operation/order/direction/rename_spec.rb +6 -6
- data/spec/unit/axiom/relation/operation/order/direction/reverse_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/order/direction_set/attributes_spec.rb +3 -3
- data/spec/unit/axiom/relation/operation/order/direction_set/class_methods/coerce_spec.rb +11 -11
- data/spec/unit/axiom/relation/operation/order/direction_set/class_methods/new_spec.rb +2 -2
- data/spec/unit/axiom/relation/operation/order/direction_set/eql_spec.rb +2 -2
- data/spec/unit/axiom/relation/operation/order/direction_set/equality_operator_spec.rb +7 -7
- data/spec/unit/axiom/relation/operation/order/direction_set/hash_spec.rb +1 -1
- data/spec/unit/axiom/relation/operation/order/direction_set/project_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/order/direction_set/rename_spec.rb +6 -6
- data/spec/unit/axiom/relation/operation/order/direction_set/reverse_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/order/direction_set/sort_tuples_spec.rb +12 -12
- data/spec/unit/axiom/relation/operation/order/direction_set/to_ary_spec.rb +3 -3
- data/spec/unit/axiom/relation/operation/order/directions_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/order/each_spec.rb +7 -7
- data/spec/unit/axiom/relation/operation/order/eql_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/order/hash_spec.rb +1 -1
- data/spec/unit/axiom/relation/operation/order/header_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/order/insert_spec.rb +11 -11
- data/spec/unit/axiom/relation/operation/order/methods/sort_by_spec.rb +127 -20
- data/spec/unit/axiom/relation/operation/order/methods/sort_spec.rb +19 -0
- data/spec/unit/axiom/relation/operation/reverse/class_methods/new_spec.rb +2 -2
- data/spec/unit/axiom/relation/operation/reverse/directions_spec.rb +4 -4
- data/spec/unit/axiom/relation/operation/reverse/each_spec.rb +7 -7
- data/spec/unit/axiom/relation/operation/reverse/methods/reverse_spec.rb +3 -3
- data/spec/unit/axiom/relation/operation/set/class_methods/included_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/set/class_methods/new_spec.rb +6 -6
- data/spec/unit/axiom/relation/operation/set/header_spec.rb +5 -5
- data/spec/unit/axiom/relation/operation/unary/header_spec.rb +5 -5
- data/spec/unit/axiom/relation/proxy/each_spec.rb +8 -8
- data/spec/unit/axiom/relation/proxy/hash_spec.rb +4 -4
- data/spec/unit/axiom/relation/proxy/method_missing_spec.rb +4 -4
- data/spec/unit/axiom/relation/proxy/respond_to_predicate_spec.rb +4 -4
- data/spec/unit/axiom/relation/replace_spec.rb +6 -6
- data/spec/unit/axiom/relation/variable/class_methods/new_spec.rb +35 -0
- data/spec/unit/axiom/relation/variable/delete_spec.rb +18 -0
- data/spec/unit/axiom/relation/variable/insert_spec.rb +18 -0
- data/spec/unit/axiom/relation/variable/materialized/delete_spec.rb +18 -0
- data/spec/unit/axiom/relation/variable/materialized/insert_spec.rb +18 -0
- data/spec/unit/axiom/relation/variable/materialized/replace_spec.rb +18 -0
- data/spec/unit/axiom/relation/variable/replace_spec.rb +18 -0
- data/spec/unit/axiom/tuple/call_spec.rb +3 -4
- data/spec/unit/axiom/tuple/class_methods/coerce_spec.rb +6 -6
- data/spec/unit/axiom/tuple/data_spec.rb +2 -2
- data/spec/unit/axiom/tuple/eql_spec.rb +5 -5
- data/spec/unit/axiom/tuple/equality_operator_spec.rb +6 -6
- data/spec/unit/axiom/tuple/extend_spec.rb +12 -12
- data/spec/unit/axiom/tuple/hash_spec.rb +3 -3
- data/spec/unit/axiom/tuple/header_spec.rb +3 -3
- data/spec/unit/axiom/tuple/join_spec.rb +6 -6
- data/spec/unit/axiom/tuple/predicate_spec.rb +5 -5
- data/spec/unit/axiom/tuple/project_spec.rb +5 -5
- data/spec/unit/axiom/tuple/to_ary_spec.rb +3 -3
- data/spec/unit/axiom/visitable/accept_spec.rb +1 -1
- data/spec/unit/range/to_inclusive_spec.rb +1 -1
- data/spec/unit/time/pred_spec.rb +1 -1
- metadata +92 -614
- checksums.yaml +0 -7
- data/.rvmrc +0 -1
- data/lib/axiom/function/numeric/binary.rb +0 -26
- data/lib/axiom/function/numeric/unary.rb +0 -26
- data/spec/support/ice_nine_config.rb +0 -6
- data/spec/unit/axiom/aggregate/count/type_spec.rb +0 -12
- data/spec/unit/axiom/aggregate/mean/type_spec.rb +0 -12
- data/spec/unit/axiom/aggregate/standard_deviation/type_spec.rb +0 -12
- data/spec/unit/axiom/aggregate/type_spec.rb +0 -13
- data/spec/unit/axiom/aggregate/variance/type_spec.rb +0 -12
- data/spec/unit/axiom/attribute/boolean/class_methods/primitive_spec.rb +0 -13
- data/spec/unit/axiom/attribute/date/range_spec.rb +0 -11
- data/spec/unit/axiom/attribute/date_time/class_methods/primitive_spec.rb +0 -13
- data/spec/unit/axiom/attribute/date_time/range_spec.rb +0 -11
- data/spec/unit/axiom/attribute/decimal/class_methods/primitive_spec.rb +0 -13
- data/spec/unit/axiom/attribute/float/size_spec.rb +0 -21
- data/spec/unit/axiom/attribute/integer/class_methods/primitive_spec.rb +0 -13
- data/spec/unit/axiom/attribute/numeric/class_methods/primitive_spec.rb +0 -13
- data/spec/unit/axiom/attribute/numeric/size_spec.rb +0 -33
- data/spec/unit/axiom/attribute/object/class_methods/primitive_spec.rb +0 -13
- data/spec/unit/axiom/attribute/string/class_methods/primitive_spec.rb +0 -13
- data/spec/unit/axiom/attribute/string/max_length_spec.rb +0 -20
- data/spec/unit/axiom/attribute/string/min_length_spec.rb +0 -20
- data/spec/unit/axiom/attribute/time/range_spec.rb +0 -11
- data/spec/unit/axiom/attribute/valid_primitive_predicate_spec.rb +0 -30
- data/spec/unit/axiom/function/connective/type_spec.rb +0 -12
- data/spec/unit/axiom/function/numeric/binary/type_spec.rb +0 -33
- data/spec/unit/axiom/function/numeric/unary/type_spec.rb +0 -21
- data/spec/unit/axiom/function/predicate/type_spec.rb +0 -14
- data/spec/unit/axiom/function/proposition/type_spec.rb +0 -12
- data/spec/unit/axiom/function/string/length/type_spec.rb +0 -11
- data/spec/unit/axiom/relation/one_spec.rb +0 -36
data/.gitignore
CHANGED
data/.rspec
CHANGED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
axiom
|
data/.travis.yml
CHANGED
@@ -1,28 +1,12 @@
|
|
1
1
|
language: ruby
|
2
2
|
before_install: gem install bundler
|
3
3
|
bundler_args: --without yard guard benchmarks
|
4
|
-
script: "bundle exec rake ci"
|
4
|
+
script: "bundle exec rake ci:metrics"
|
5
5
|
rvm:
|
6
|
-
- ree
|
7
|
-
- 1.8.7
|
8
|
-
- 1.9.2
|
9
6
|
- 1.9.3
|
10
7
|
- 2.0.0
|
11
8
|
- ruby-head
|
12
|
-
- rbx-18mode
|
13
9
|
- 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
10
|
matrix:
|
27
11
|
include:
|
28
12
|
- rvm: jruby-19mode
|
@@ -30,6 +14,13 @@ matrix:
|
|
30
14
|
- rvm: jruby-head
|
31
15
|
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
32
16
|
allow_failures:
|
33
|
-
# mutant fails
|
34
|
-
- rvm:
|
35
|
-
- rvm:
|
17
|
+
- rvm: 1.9.3 # mutant fails
|
18
|
+
- rvm: 2.0.0 # mutant fails
|
19
|
+
- rvm: ruby-head # travis broken
|
20
|
+
- rvm: rbx-19mode # mutant fails
|
21
|
+
notifications:
|
22
|
+
irc:
|
23
|
+
channels:
|
24
|
+
- irc.freenode.org#rom-rb
|
25
|
+
on_success: never
|
26
|
+
on_failure: change
|
data/Gemfile
CHANGED
@@ -4,5 +4,8 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
group :development, :test do
|
8
|
+
gem 'devtools', git: 'https://github.com/rom-rb/devtools.git'
|
9
|
+
end
|
10
|
+
|
11
|
+
eval_gemfile 'Gemfile.devtools'
|
data/Gemfile.devtools
CHANGED
@@ -1,48 +1,46 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
group :development do
|
4
|
-
gem 'rake', '~> 10.0
|
5
|
-
gem 'rspec', '~> 2.
|
6
|
-
gem 'yard', '~> 0.8.
|
4
|
+
gem 'rake', '~> 10.1.0'
|
5
|
+
gem 'rspec', '~> 2.14.1'
|
6
|
+
gem 'yard', '~> 0.8.7'
|
7
7
|
end
|
8
8
|
|
9
9
|
group :yard do
|
10
|
-
gem 'kramdown', '~> 1.0
|
10
|
+
gem 'kramdown', '~> 1.1.0'
|
11
11
|
end
|
12
12
|
|
13
13
|
group :guard do
|
14
|
-
gem 'guard', '~> 1.
|
14
|
+
gem 'guard', '~> 1.8.1'
|
15
15
|
gem 'guard-bundler', '~> 1.0.0'
|
16
|
-
gem 'guard-rspec', '~>
|
16
|
+
gem 'guard-rspec', '~> 3.0.2'
|
17
|
+
gem 'guard-rubocop', '~> 0.2.0'
|
18
|
+
gem 'guard-mutant', '~> 0.0.1'
|
17
19
|
|
18
20
|
# file system change event handling
|
19
|
-
gem 'listen', '~>
|
20
|
-
gem 'rb-fchange', '~> 0.0.6', :
|
21
|
-
gem 'rb-fsevent', '~> 0.9.3', :
|
22
|
-
gem 'rb-inotify', '~> 0.9.0', :
|
21
|
+
gem 'listen', '~> 1.3.0'
|
22
|
+
gem 'rb-fchange', '~> 0.0.6', require: false
|
23
|
+
gem 'rb-fsevent', '~> 0.9.3', require: false
|
24
|
+
gem 'rb-inotify', '~> 0.9.0', require: false
|
23
25
|
|
24
26
|
# notification handling
|
25
|
-
gem 'libnotify', '~> 0.8.0', :
|
26
|
-
gem 'rb-notifu', '~> 0.0.4', :
|
27
|
-
gem 'terminal-notifier-guard', '~> 1.5.3', :
|
27
|
+
gem 'libnotify', '~> 0.8.0', require: false
|
28
|
+
gem 'rb-notifu', '~> 0.0.4', require: false
|
29
|
+
gem 'terminal-notifier-guard', '~> 1.5.3', require: false
|
28
30
|
end
|
29
31
|
|
30
32
|
group :metrics do
|
31
|
-
gem '
|
32
|
-
gem '
|
33
|
-
gem '
|
34
|
-
gem '
|
35
|
-
gem '
|
36
|
-
gem 'simplecov',
|
37
|
-
gem 'yardstick',
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
gem '
|
42
|
-
end
|
43
|
-
|
44
|
-
platforms :rbx do
|
45
|
-
gem 'pelusa', '~> 0.2.2'
|
33
|
+
gem 'coveralls', '~> 0.6.7'
|
34
|
+
gem 'flay', '~> 2.4.0'
|
35
|
+
gem 'flog', '~> 4.1.1'
|
36
|
+
gem 'reek', '~> 1.3.2'
|
37
|
+
gem 'rubocop', '~> 0.11.0'
|
38
|
+
gem 'simplecov', '~> 0.7.1'
|
39
|
+
gem 'yardstick', '~> 0.9.7', git: 'https://github.com/dkubb/yardstick.git'
|
40
|
+
|
41
|
+
platforms :ruby_19, :ruby_20 do
|
42
|
+
gem 'mutant', git: 'https://github.com/mbj/mutant.git'
|
43
|
+
gem 'yard-spellcheck', '~> 0.1.5'
|
46
44
|
end
|
47
45
|
end
|
48
46
|
|
data/Guardfile
CHANGED
@@ -2,22 +2,31 @@
|
|
2
2
|
|
3
3
|
guard :bundler do
|
4
4
|
watch('Gemfile')
|
5
|
+
watch('Gemfile.lock')
|
6
|
+
watch(%w{.+.gemspec\z})
|
5
7
|
end
|
6
8
|
|
7
|
-
guard :rspec, :
|
8
|
-
#
|
9
|
+
guard :rspec, cli: File.read('.rspec').split.join(' '), keep_failed: false do
|
10
|
+
# Run all specs if configuration is modified
|
11
|
+
watch('.rspec') { 'spec' }
|
9
12
|
watch('Guardfile') { 'spec' }
|
10
13
|
watch('Gemfile.lock') { 'spec' }
|
11
14
|
watch('spec/spec_helper.rb') { 'spec' }
|
12
15
|
|
13
|
-
#
|
14
|
-
watch(%r{\Aspec/(?:lib|support|shared)/.+\.rb\z}) { 'spec' }
|
16
|
+
# Run all specs if supporting files are modified
|
17
|
+
watch(%r{\Aspec/(?:fixtures|lib|support|shared)/.+\.rb\z}) { 'spec' }
|
15
18
|
|
16
|
-
#
|
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'
|
19
|
+
# Run unit specs if associated lib code is modified
|
20
|
+
watch(%r{\Alib/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}*"] }
|
21
|
+
watch(%r{\Alib/(.+)/support/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}/#{m[2]}*"] }
|
22
|
+
watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { 'spec' }
|
20
23
|
|
21
|
-
#
|
24
|
+
# Run a spec if it is modified
|
22
25
|
watch(%r{\Aspec/(?:unit|integration)/.+_spec\.rb\z})
|
23
26
|
end
|
27
|
+
|
28
|
+
guard :rubocop, cli: %w[--config config/rubocop.yml] do
|
29
|
+
watch(%r{.+\.(?:rb|rake)\z})
|
30
|
+
watch(%r{\Aconfig/rubocop\.yml\z}) { |m| File.dirname(m[0]) }
|
31
|
+
watch(%r{(?:.+/)?\.rubocop\.yml\z}) { |m| File.dirname(m[0]) }
|
32
|
+
end
|
data/README.md
CHANGED
@@ -15,53 +15,30 @@ Simplifies querying of structured data using relational algebra.
|
|
15
15
|
[codeclimate]: https://codeclimate.com/github/dkubb/axiom
|
16
16
|
[coveralls]: https://coveralls.io/r/dkubb/axiom
|
17
17
|
|
18
|
-
|
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
|
-
-----
|
18
|
+
Examples
|
19
|
+
--------
|
43
20
|
|
44
21
|
```ruby
|
45
22
|
relation = Axiom::Relation.new(
|
46
|
-
[
|
23
|
+
[[:id, String], [:name, String], [:color, String], [:weight, Float], [:city, String]],
|
47
24
|
[
|
48
|
-
[
|
49
|
-
[
|
50
|
-
[
|
51
|
-
[
|
52
|
-
[
|
53
|
-
[
|
54
|
-
|
25
|
+
['P1', 'Nut', 'Red', 12.0, 'London'],
|
26
|
+
['P2', 'Bolt', 'Green', 17.0, 'Paris' ],
|
27
|
+
['P3', 'Screw', 'Blue', 17.0, 'Oslo' ],
|
28
|
+
['P4', 'Screw', 'Red', 14.0, 'London'],
|
29
|
+
['P5', 'Cam', 'Blue', 12.0, 'Paris' ],
|
30
|
+
['P6', 'Cog', 'Red', 19.0, 'London'],
|
31
|
+
]
|
55
32
|
)
|
56
33
|
|
57
34
|
# Relational Operators
|
58
35
|
# --------------------
|
59
36
|
|
60
37
|
# projection
|
61
|
-
new_relation = relation.project([
|
38
|
+
new_relation = relation.project([:id])
|
62
39
|
|
63
40
|
# removal
|
64
|
-
new_relation = relation.remove([
|
41
|
+
new_relation = relation.remove([:name])
|
65
42
|
|
66
43
|
# rename
|
67
44
|
new_relation = relation.rename(id: :other_id, name: :other_name)
|
@@ -70,7 +47,7 @@ new_relation = relation.rename(id: :other_id, name: :other_name)
|
|
70
47
|
new_relation = relation.restrict { |r| r.name.eq('Screw').or(r.city.eq('London')) }
|
71
48
|
new_relation = relation.restrict(relation.name.eq('Screw'))
|
72
49
|
new_relation = relation.restrict(name: 'Screw')
|
73
|
-
new_relation = relation.restrict([
|
50
|
+
new_relation = relation.restrict([[:name, 'Screw']])
|
74
51
|
|
75
52
|
# natural join
|
76
53
|
new_relation = relation.join(other) # OR relation + other
|
@@ -97,8 +74,8 @@ new_relation = relation.extend { |r| r.add(:pounds, r.weight * 2.2) }
|
|
97
74
|
new_relation = relation.extend { |r| r.add(:pounds) { |t| t[:weight] * 2.2 } }
|
98
75
|
|
99
76
|
# summarize
|
100
|
-
new_relation = relation.summarize(relation.project([
|
101
|
-
new_relation = relation.summarize(relation.project([
|
77
|
+
new_relation = relation.summarize(relation.project([:city])) { |r| r.add(:count, r.id.count) }
|
78
|
+
new_relation = relation.summarize(relation.project([:city])) { |r| r.add(:count) { |acc, t| acc.to_i + 1 } }
|
102
79
|
|
103
80
|
# Non-Relational Operators
|
104
81
|
# ------------------------
|
@@ -109,8 +86,11 @@ header = relation.header
|
|
109
86
|
# a relation is Enumerable
|
110
87
|
relation = relation.each { |tuple| ... }
|
111
88
|
|
89
|
+
# order by attributes in the header
|
90
|
+
ordered = relation.sort
|
91
|
+
|
112
92
|
# order by attribute and direction
|
113
|
-
ordered = relation.sort_by { |r| [
|
93
|
+
ordered = relation.sort_by { |r| [r.city.desc, r.name, r.color, r.id, r.weight] }
|
114
94
|
|
115
95
|
# reverse the relation (only allowed if ordered)
|
116
96
|
new_relation = ordered.reverse
|
@@ -131,6 +111,7 @@ new_relation = ordered.last(5)
|
|
131
111
|
|
132
112
|
# get a tuple from a relation containing exactly one tuple
|
133
113
|
tuple = relation.one
|
114
|
+
tuple = relation.one { ... }
|
134
115
|
|
135
116
|
# Updatable Views
|
136
117
|
# ---------------
|
data/axiom.gemspec
CHANGED
@@ -3,26 +3,25 @@
|
|
3
3
|
require File.expand_path('../lib/axiom/version', __FILE__)
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
|
-
gem.name
|
7
|
-
gem.version
|
8
|
-
gem.authors
|
9
|
-
gem.email
|
10
|
-
gem.description
|
11
|
-
gem.summary
|
12
|
-
gem.homepage
|
6
|
+
gem.name = 'axiom'
|
7
|
+
gem.version = Axiom::VERSION.dup
|
8
|
+
gem.authors = ['Dan Kubb']
|
9
|
+
gem.email = 'dan.kubb@gmail.com'
|
10
|
+
gem.description = 'Simplifies querying of structured data using relational algebra'
|
11
|
+
gem.summary = 'Ruby Relational Algebra'
|
12
|
+
gem.homepage = 'https://github.com/dkubb/axiom'
|
13
|
+
gem.licenses = 'MIT'
|
13
14
|
|
14
15
|
gem.require_paths = %w[lib]
|
15
|
-
gem.files = `git ls-files`.split(
|
16
|
-
gem.test_files = `git ls-files -- spec/{unit,integration}`.split(
|
17
|
-
gem.extra_rdoc_files = %w[LICENSE README.md TODO]
|
16
|
+
gem.files = `git ls-files`.split("\n")
|
17
|
+
gem.test_files = `git ls-files -- spec/{unit,integration}`.split("\n")
|
18
|
+
gem.extra_rdoc_files = %w[LICENSE README.md CONTRIBUTING.md TODO]
|
18
19
|
|
19
|
-
gem.
|
20
|
-
gem.
|
21
|
-
gem.
|
22
|
-
gem.
|
23
|
-
gem.
|
20
|
+
gem.add_dependency('abstract_type', '~> 0.0.5')
|
21
|
+
gem.add_dependency('adamantium', '~> 0.1')
|
22
|
+
gem.add_dependency('axiom-types', '~> 0.0.3')
|
23
|
+
gem.add_dependency('descendants_tracker', '~> 0.0.1')
|
24
|
+
gem.add_dependency('equalizer', '~> 0.0.7')
|
24
25
|
|
25
|
-
gem.add_development_dependency('
|
26
|
-
gem.add_development_dependency('rspec', '~> 2.13.0')
|
27
|
-
gem.add_development_dependency('yard', '~> 0.8.5.2')
|
26
|
+
gem.add_development_dependency('bundler', '~> 1.3', '>= 1.3.5')
|
28
27
|
end
|
data/benchmarks/memory.rb
CHANGED
@@ -11,7 +11,7 @@ unless GC.respond_to?(:enable_stats)
|
|
11
11
|
exit 1
|
12
12
|
end
|
13
13
|
|
14
|
-
COUNTS = [
|
14
|
+
COUNTS = [1, 10, 100, 1_000, 10_000, 100_000].freeze
|
15
15
|
NAME = 'Dan Kubb'.freeze
|
16
16
|
RELATIONS = {}
|
17
17
|
|
@@ -43,12 +43,12 @@ include Axiom
|
|
43
43
|
|
44
44
|
puts '-' * 80
|
45
45
|
gc_statistics 'header' do
|
46
|
-
HEADER = Relation::Header.new([
|
46
|
+
HEADER = Relation::Header.new([[:id, Integer], [:name, String]])
|
47
47
|
end
|
48
48
|
|
49
49
|
puts '-' * 80
|
50
50
|
gc_statistics 'tuple' do
|
51
|
-
TUPLE = Tuple.new(HEADER, [
|
51
|
+
TUPLE = Tuple.new(HEADER, [1, NAME])
|
52
52
|
end
|
53
53
|
|
54
54
|
puts '-' * 80
|
@@ -60,7 +60,7 @@ end
|
|
60
60
|
COUNTS.each do |count|
|
61
61
|
RELATIONS[count] = Relation.new(
|
62
62
|
HEADER,
|
63
|
-
(1..count).map { |n| Tuple.new(HEADER, [
|
63
|
+
(1..count).map { |n| Tuple.new(HEADER, [n, NAME]) }
|
64
64
|
)
|
65
65
|
end
|
66
66
|
|
@@ -80,13 +80,13 @@ end
|
|
80
80
|
|
81
81
|
each_count do |array, relation, count|
|
82
82
|
gc_statistics "projection (#{count} tuples)" do
|
83
|
-
relation.project([
|
83
|
+
relation.project([:id]).each {}
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
87
87
|
each_count do |array, relation, count|
|
88
88
|
gc_statistics "removal (#{count} tuples)" do
|
89
|
-
relation.remove([
|
89
|
+
relation.remove([:name]).each {}
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
@@ -98,13 +98,13 @@ end
|
|
98
98
|
|
99
99
|
each_count do |array, relation, count|
|
100
100
|
gc_statistics "join (#{count} tuples)" do
|
101
|
-
relation.join(Relation.new([
|
101
|
+
relation.join(Relation.new([[:id, Integer], [:age, Integer]], [[1, 35]])).each {}
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
105
|
each_count do |array, relation, count|
|
106
106
|
gc_statistics "product (#{count} tuples)" do
|
107
|
-
relation.product(Relation.new([
|
107
|
+
relation.product(Relation.new([[:age, Integer]], [[35]])).each {}
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
@@ -128,12 +128,12 @@ end
|
|
128
128
|
|
129
129
|
each_count do |array, relation, count|
|
130
130
|
gc_statistics "order (#{count} tuples)" do
|
131
|
-
relation.sort_by { |r| [
|
131
|
+
relation.sort_by { |r| [r.id.desc, r.name] }.each {}
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
135
135
|
each_count do |array, relation, count|
|
136
|
-
relation = relation.sort_by { |r| [
|
136
|
+
relation = relation.sort_by { |r| [r.id, r.name] }
|
137
137
|
|
138
138
|
gc_statistics "take (#{count} tuples)" do
|
139
139
|
relation.take(count).each {}
|
@@ -141,7 +141,7 @@ each_count do |array, relation, count|
|
|
141
141
|
end
|
142
142
|
|
143
143
|
each_count do |array, relation, count|
|
144
|
-
relation = relation.sort_by { |r| [
|
144
|
+
relation = relation.sort_by { |r| [r.id, r.name] }
|
145
145
|
|
146
146
|
gc_statistics "drop (#{count} tuples)" do
|
147
147
|
relation.drop(1).each {}
|
@@ -149,7 +149,7 @@ each_count do |array, relation, count|
|
|
149
149
|
end
|
150
150
|
|
151
151
|
each_count do |array, relation, count|
|
152
|
-
relation = relation.sort_by { |r| [
|
152
|
+
relation = relation.sort_by { |r| [r.id, r.name] }
|
153
153
|
|
154
154
|
gc_statistics "first (#{count} tuples)" do
|
155
155
|
relation.first(count).each {}
|
@@ -157,7 +157,7 @@ each_count do |array, relation, count|
|
|
157
157
|
end
|
158
158
|
|
159
159
|
each_count do |array, relation, count|
|
160
|
-
relation = relation.sort_by { |r| [
|
160
|
+
relation = relation.sort_by { |r| [r.id, r.name] }
|
161
161
|
|
162
162
|
gc_statistics "last (#{count} tuples)" do
|
163
163
|
relation.last(count).each {}
|
@@ -165,7 +165,7 @@ each_count do |array, relation, count|
|
|
165
165
|
end
|
166
166
|
|
167
167
|
each_count do |array, relation, count|
|
168
|
-
relation = relation.sort_by { |r| [
|
168
|
+
relation = relation.sort_by { |r| [r.id, r.name] }
|
169
169
|
|
170
170
|
gc_statistics "reverse (#{count} tuples)" do
|
171
171
|
relation.reverse.each {}
|