facets 2.4.5 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +6 -2
- data/CHANGES +46 -52
- data/MANIFEST +680 -642
- data/README +3 -10
- data/RELEASE +82 -36
- data/VERSION +1 -1
- data/doc/archive/{changelog-0.rdoc → CHANGELOG-0.10.30} +0 -0
- data/doc/archive/{changelog-1.rdoc → CHANGELOG-1.8.54} +0 -0
- data/doc/archive/CHANGELOG-2.4.5 +1654 -0
- data/doc/{news → archive}/RELEASE-2.0.5 +0 -0
- data/doc/{news → archive}/RELEASE-2.1.0 +0 -0
- data/doc/{news → archive}/RELEASE-2.1.1 +0 -0
- data/doc/{news → archive}/RELEASE-2.1.2 +0 -0
- data/doc/{news → archive}/RELEASE-2.1.3 +0 -0
- data/doc/{news → archive}/RELEASE-2.2.0 +0 -0
- data/doc/{news → archive}/RELEASE-2.2.1 +0 -0
- data/doc/{news → archive}/RELEASE-2.3.0 +0 -0
- data/doc/{news → archive}/RELEASE-2.4.0 +0 -0
- data/doc/{news → archive}/RELEASE-2.4.1 +0 -0
- data/doc/{news → archive}/RELEASE-2.4.2 +0 -0
- data/doc/{news → archive}/RELEASE-2.4.3 +0 -0
- data/doc/{news → archive}/RELEASE-2.4.4 +0 -0
- data/doc/archive/RELEASE-2.4.5 +37 -0
- data/doc/{book/history.rdoc → guide/notes.rd} +62 -4
- data/doc/log/basic_stats/index.html +39 -0
- data/doc/log/bstats/stats.html +39 -0
- data/doc/log/changelog.html +141 -0
- data/doc/log/changelog.txt +1609 -0
- data/doc/log/stats.html +25 -0
- data/doc/log/testlog.txt +278 -0
- data/doc/rdoc/core/classes/Array.html +158 -147
- data/doc/rdoc/core/classes/Binding.html +54 -54
- data/doc/rdoc/core/classes/Class.html +59 -57
- data/doc/rdoc/core/classes/Comparable.html +67 -76
- data/doc/rdoc/core/classes/Dir.html +47 -47
- data/doc/rdoc/core/classes/Enumerable.html +232 -192
- data/doc/rdoc/core/classes/Exception.html +15 -16
- data/doc/rdoc/core/classes/File.html +128 -85
- data/doc/rdoc/core/classes/FileTest.html +7 -7
- data/doc/rdoc/core/classes/Float.html +16 -14
- data/doc/rdoc/core/classes/Functor.html +12 -12
- data/doc/rdoc/core/classes/Hash.html +490 -319
- data/doc/rdoc/core/classes/Indexable.html +110 -110
- data/doc/rdoc/core/classes/InstanceVariables.html +44 -44
- data/doc/rdoc/core/classes/Integer.html +122 -116
- data/doc/rdoc/core/classes/Kernel.html +415 -401
- data/doc/rdoc/core/classes/Lazy/Promise.html +1 -1
- data/doc/rdoc/core/classes/MatchData.html +24 -21
- data/doc/rdoc/core/classes/Module.html +230 -229
- data/doc/rdoc/core/classes/NilClass.html +28 -26
- data/doc/rdoc/core/classes/Numeric.html +30 -30
- data/doc/rdoc/core/classes/Object.html +8 -8
- data/doc/rdoc/core/classes/{Friend.html → ObjectSpace.html} +25 -48
- data/doc/rdoc/core/classes/Proc.html +29 -27
- data/doc/rdoc/core/classes/Range.html +17 -15
- data/doc/rdoc/core/classes/Regexp.html +17 -17
- data/doc/rdoc/core/classes/Stackable.html +31 -31
- data/doc/rdoc/core/classes/String.html +445 -401
- data/doc/rdoc/{more/classes/CLI/NoOptionError.html → core/classes/Struct.html} +24 -21
- data/doc/rdoc/core/classes/Symbol.html +73 -65
- data/doc/rdoc/core/classes/Time.html +87 -86
- data/doc/rdoc/core/classes/TrueClass.html +8 -8
- data/doc/rdoc/core/classes/UnboundMethod.html +17 -16
- data/doc/rdoc/core/created.rid +1 -1
- data/doc/rdoc/core/files/README.html +10 -16
- data/doc/rdoc/core/files/lib/core/facets/array/combination_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/conjoin_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/delete_rb.html +10 -1
- data/doc/rdoc/core/files/lib/core/facets/array/delete_unless_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/array/delete_values_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/array/index_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/indexable_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/merge_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/only_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/pad_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/permutation_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/product_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/rotate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/select_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/splice_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/array/stackable_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/binding/caller_rb.html +2 -2
- data/doc/rdoc/core/files/lib/core/facets/binding/callstack_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/binding/defined_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/bitmask_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/class/cattr_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/class/descendents_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/class/prepend_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/class/to_proc_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/comparable/at_least_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/comparable/at_most_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/comparable/bound_rb.html +5 -1
- data/doc/rdoc/core/files/lib/core/facets/comparable/cap_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/comparable/clip_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/comparable/cmp_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/comparable/comparable_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/dir/ascend_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/dir/multiglob_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/dir/recurse_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/accumulate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/cluster_by_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/collect_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/commonality_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/count_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/divide_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/duplicates_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/each_by_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/entropy_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/frequency_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/graph_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/enumerable/group_by_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/inject_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/map_send_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/mash_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/mode_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/modulate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/none_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/occur_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/one_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/probability_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/sum_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/enumerable/take_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/enumerable/uniq_by_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/exception/detail_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/exception/suppress_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/append_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/create_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/null_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/read_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/rewrite_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/rootname_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/split_all_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/file/split_root_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/write_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/file/writelines_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/filetest/root_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/alias_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/autonew_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/collate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/delete_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/insert_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/inverse_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/join_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/keys_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_add_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_and_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_mul_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_or_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_push_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/op_sub_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/rekey_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/replace_each_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/select_rb.html +1 -1
- data/doc/rdoc/{more/files/lib/more → core/files/lib/core}/facets/hash/stringify_keys_rb.html +1 -1
- data/doc/rdoc/{more/files/lib/more → core/files/lib/core}/facets/hash/symbolize_keys_rb.html +2 -2
- data/doc/rdoc/core/files/lib/core/facets/hash/to_options_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/to_struct_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/traverse_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/update_each_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/update_keys_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/update_rb.html +8 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/update_values_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/hash/weave_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/hash/zipnew_rb.html +1 -5
- data/doc/rdoc/core/files/lib/core/facets/integer/factorial_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/integer/multiple_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/integer/odd_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/__here___rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/kernel/as_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/ask_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/attr_singleton_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/callstack_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/kernel/complete_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/constant_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/d_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/demo_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/ergo_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/instance_class_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/instance_variables_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/not_nil_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/object_send_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/p_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/populate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/qua_class_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/resc_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/respond_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/returning_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/silence_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/kernel/try_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/matchdata/match_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/matchdata/matchset_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/metaid_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/abstract_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/alias_accessor_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/alias_method_chain_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/alias_module_function_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/ancestor_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/basename_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/conflict_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/include_function_module_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/instance_methods_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/is_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/methodize_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/modspace_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/module_load_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/nesting_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/op_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/prepend_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/redefine_method_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/rename_method_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/revise_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/spacename_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/module/wrap_method_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/nilclass/to_f_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/numeric/approx_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/numeric/distance_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/numeric/round_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/objectspace/classes_rb.html +92 -0
- data/doc/rdoc/{more/files/lib/more/facets/dictionarymatcher_rb.html → core/files/lib/core/facets/objectspace_rb.html} +4 -4
- data/doc/rdoc/core/files/lib/core/facets/proc/bind_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/proc/compose_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/proc/to_method_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/proc/update_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/range/combine_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/range/overlap_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/range/within_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/regexp/arity_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/align_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/bracket_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/camelcase_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/capitalized_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/chars_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/chomp_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/cleave_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/compress_lines_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/contains_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/divide_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/expand_tab_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/fold_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/indent_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/interpolate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/line_wrap_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/lines_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/margin_rb.html +92 -0
- data/doc/rdoc/core/files/lib/core/facets/string/methodize_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/mscan_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/natcmp_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/nchar_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/op_sub_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/outdent_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/string/range_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/rewrite_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/shatter_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/snakecase_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/splice_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/start_with_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/tab_rb.html +8 -1
- data/doc/rdoc/core/files/lib/core/facets/string/tabto_rb.html +96 -0
- data/doc/rdoc/core/files/lib/core/facets/string/titlecase_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/to_re_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/string/word_wrap_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/struct/attributes_rb.html +92 -0
- data/doc/rdoc/{more/files/lib/more/facets/bytes_rb.html → core/files/lib/core/facets/struct_rb.html} +4 -4
- data/doc/rdoc/core/files/lib/core/facets/symbol/chomp_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/symbol/generate_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/symbol/not_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/symbol/succ_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/symbol/to_proc_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/time/advance_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/time/change_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/time/elapse_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/time/hence_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/time/stamp_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/to_hash_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/unboundmethod/arguments_rb.html +1 -1
- data/doc/rdoc/core/files/lib/core/facets/unboundmethod/name_rb.html +1 -1
- data/doc/rdoc/core/fr_class_index.html +2 -1
- data/doc/rdoc/core/fr_file_index.html +30 -1
- data/doc/rdoc/core/fr_method_index.html +430 -423
- data/doc/rdoc/lore/classes/Date.html +6 -5
- data/doc/rdoc/{more/classes/CLI/Command/UniversalOptions.html → lore/classes/Enumerable.html} +7 -9
- data/doc/rdoc/lore/classes/Enumerable/Enumerator.html +147 -0
- data/doc/rdoc/lore/classes/OpenStruct.html +13 -15
- data/doc/rdoc/lore/created.rid +1 -1
- data/doc/rdoc/lore/files/README.html +10 -16
- data/doc/rdoc/lore/files/lib/lore/facets/date_rb.html +1 -1
- data/doc/rdoc/lore/files/lib/lore/facets/enumerator_rb.html +111 -0
- data/doc/rdoc/lore/files/lib/lore/facets/ostruct_rb.html +1 -1
- data/doc/rdoc/lore/fr_class_index.html +2 -0
- data/doc/rdoc/lore/fr_file_index.html +1 -0
- data/doc/rdoc/lore/fr_method_index.html +13 -12
- data/doc/rdoc/more/classes/ANSICode.html +66 -66
- data/doc/rdoc/more/classes/Advisable.html +37 -37
- data/doc/rdoc/more/classes/Advisable/Method.html +20 -20
- data/doc/rdoc/more/classes/Archive/Tar/Minitar.html +27 -27
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Input.html +28 -28
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Output.html +19 -19
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Reader.html +31 -31
- data/doc/rdoc/more/classes/Archive/Tar/Minitar/Writer.html +33 -33
- data/doc/rdoc/more/classes/Argvector.html +76 -76
- data/doc/rdoc/more/classes/Association.html +28 -28
- data/doc/rdoc/more/classes/Association/Kernel.html +8 -8
- data/doc/rdoc/more/classes/Autoarray.html +12 -12
- data/doc/rdoc/more/classes/BBCode.html +34 -34
- data/doc/rdoc/more/classes/BaseX.html +16 -16
- data/doc/rdoc/more/classes/BiCrypt.html +67 -67
- data/doc/rdoc/more/classes/BinReadable.html +85 -85
- data/doc/rdoc/more/classes/BinReadable/ByteOrder.html +25 -25
- data/doc/rdoc/more/classes/Binding.html +8 -8
- data/doc/rdoc/more/classes/BlankSlate.html +5 -5
- data/doc/rdoc/more/classes/Buildable.html +4 -4
- data/doc/rdoc/more/classes/BuildingBlock.html +32 -32
- data/doc/rdoc/more/classes/Capsule.html +41 -41
- data/doc/rdoc/more/classes/Cloneable.html +4 -4
- data/doc/rdoc/more/classes/ConsoleUtils.html +22 -22
- data/doc/rdoc/more/classes/Coroutine.html +28 -28
- data/doc/rdoc/more/classes/Crypt.html +16 -16
- data/doc/rdoc/more/classes/CssFilter.html +45 -45
- data/doc/rdoc/more/classes/CssTree.html +8 -8
- data/doc/rdoc/more/classes/Dictionary.html +228 -228
- data/doc/rdoc/more/classes/Downloader.html +56 -56
- data/doc/rdoc/more/classes/Duration.html +369 -445
- data/doc/rdoc/more/classes/Duration/Numeric.html +389 -0
- data/doc/rdoc/more/classes/{CLI/NoCommandError.html → Duration/Time.html} +30 -17
- data/doc/rdoc/more/classes/Enumerable.html +114 -51
- data/doc/rdoc/more/classes/Enumerable/Elementor.html +16 -16
- data/doc/rdoc/more/classes/Enumerable/Enumerator.html +4 -4
- data/doc/rdoc/more/classes/Enumerable/Filterable.html +246 -0
- data/doc/rdoc/more/classes/EnumerablePass.html +17 -17
- data/doc/rdoc/more/classes/{RecursiveDependency.html → Enumerator.html} +7 -4
- data/doc/rdoc/more/classes/{CLI.html → Enumerator/Filter.html} +22 -26
- data/doc/rdoc/more/classes/Equatable.html +16 -16
- data/doc/rdoc/more/classes/Expirable.html +17 -17
- data/doc/rdoc/more/classes/FileList.html +125 -125
- data/doc/rdoc/more/classes/Fileable.html +14 -14
- data/doc/rdoc/more/classes/Fileable/DSL.html +41 -41
- data/doc/rdoc/more/classes/Hash.html +16 -162
- data/doc/rdoc/more/classes/Hash2Xml.html +4 -4
- data/doc/rdoc/more/classes/HtmlFilter.html +9 -9
- data/doc/rdoc/more/classes/IORedirect.html +19 -19
- data/doc/rdoc/more/classes/InfinityClass.html +36 -36
- data/doc/rdoc/more/classes/InfinityClass/Numeric.html +23 -23
- data/doc/rdoc/more/classes/Ini.html +37 -37
- data/doc/rdoc/more/classes/Instantiable.html +9 -9
- data/doc/rdoc/more/classes/Instantize.html +8 -8
- data/doc/rdoc/more/classes/Interval.html +187 -187
- data/doc/rdoc/more/classes/It.html +12 -12
- data/doc/rdoc/more/classes/LRUCache.html +38 -38
- data/doc/rdoc/more/classes/LinkedList.html +68 -68
- data/doc/rdoc/more/classes/LinkedList/Node.html +4 -4
- data/doc/rdoc/more/classes/{DictionaryMatcher.html → Matcher.html} +66 -68
- data/doc/rdoc/more/classes/{DictionaryMatcher → Matcher}/MatchData.html +8 -8
- data/doc/rdoc/more/classes/{CacheDecorator.html → Memoizer.html} +64 -46
- data/doc/rdoc/more/classes/Module.html +182 -361
- data/doc/rdoc/more/classes/Multiton.html +12 -12
- data/doc/rdoc/more/classes/Multiton/MetaMethods.html +28 -28
- data/doc/rdoc/more/classes/Net/SMTP.html +8 -8
- data/doc/rdoc/more/classes/NullClass.html +24 -24
- data/doc/rdoc/more/classes/Numeric/Multipliers.html +456 -0
- data/doc/rdoc/more/classes/ObjectReflection.html +12 -12
- data/doc/rdoc/more/classes/OpEsc.html +8 -7
- data/doc/rdoc/more/classes/OpenCascade.html +4 -4
- data/doc/rdoc/more/classes/OpenCollection.html +8 -8
- data/doc/rdoc/more/classes/OpenHash.html +9 -9
- data/doc/rdoc/more/classes/{EventHook.html → OpenModule.html} +24 -63
- data/doc/rdoc/more/classes/OpenObject.html +95 -95
- data/doc/rdoc/more/classes/OpenStructable.html +326 -0
- data/doc/rdoc/more/classes/PQueue.html +84 -84
- data/doc/rdoc/more/classes/Paramix.html +11 -11
- data/doc/rdoc/more/classes/Paramix/Delegator.html +16 -16
- data/doc/rdoc/more/classes/PathList.html +8 -8
- data/doc/rdoc/more/classes/PathList/Finder.html +8 -8
- data/doc/rdoc/more/classes/Platform.html +46 -46
- data/doc/rdoc/more/classes/Pool.html +18 -18
- data/doc/rdoc/more/classes/Proc.html +9 -9
- data/doc/rdoc/more/classes/ProgressBar.html +52 -52
- data/doc/rdoc/more/classes/Prototype.html +28 -28
- data/doc/rdoc/more/classes/RWDelegator.html +16 -16
- data/doc/rdoc/more/classes/Random.html +5 -5
- data/doc/rdoc/more/classes/Random/Array.html +37 -37
- data/doc/rdoc/more/classes/Random/Hash.html +52 -52
- data/doc/rdoc/more/classes/Random/Object.html +4 -4
- data/doc/rdoc/more/classes/Random/String.html +34 -34
- data/doc/rdoc/more/classes/Random/String/Self.html +9 -9
- data/doc/rdoc/more/classes/Recorder.html +16 -16
- data/doc/rdoc/more/classes/Reference.html +19 -19
- data/doc/rdoc/more/classes/Registerable.html +13 -13
- data/doc/rdoc/more/classes/Semaphore.html +36 -36
- data/doc/rdoc/more/classes/Settings.html +28 -28
- data/doc/rdoc/more/classes/Settings/Setting.html +13 -13
- data/doc/rdoc/more/classes/Settings/SettingCollection.html +4 -4
- data/doc/rdoc/more/classes/SimpleStringIO.html +8 -8
- data/doc/rdoc/more/classes/Snapshot.html +16 -16
- data/doc/rdoc/more/classes/Snapshot/ValueHolder.html +12 -12
- data/doc/rdoc/more/classes/SparseArray.html +1397 -0
- data/doc/rdoc/more/classes/Stash.html +232 -0
- data/doc/rdoc/more/classes/String/Mask.html +72 -72
- data/doc/rdoc/more/classes/String/Words.html +49 -49
- data/doc/rdoc/more/classes/Struct.html +8 -8
- data/doc/rdoc/more/classes/SyncArray.html +4 -4
- data/doc/rdoc/more/classes/SyncHash.html +4 -4
- data/doc/rdoc/more/classes/SyncHash/Delegator.html +28 -28
- data/doc/rdoc/more/classes/SyncHash/Inheritor.html +28 -28
- data/doc/rdoc/more/classes/System.html +253 -253
- data/doc/rdoc/more/classes/Timer.html +48 -48
- data/doc/rdoc/more/classes/Timer/Dummy.html +9 -9
- data/doc/rdoc/more/classes/TracePoint.html +58 -58
- data/doc/rdoc/more/classes/Tuple.html +170 -170
- data/doc/rdoc/more/classes/TypeCast/Class.html +4 -4
- data/doc/rdoc/more/classes/TypeCast/Object.html +4 -4
- data/doc/rdoc/more/classes/Uninheritable.html +6 -6
- data/doc/rdoc/more/classes/VersionNumber.html +57 -57
- data/doc/rdoc/more/classes/XOXO.html +9 -9
- data/doc/rdoc/more/classes/ZipUtils.html +251 -118
- data/doc/rdoc/more/classes/ZipUtils/DryRun.html +203 -35
- data/doc/rdoc/more/classes/ZipUtils/NoWrite.html +203 -35
- data/doc/rdoc/more/classes/ZipUtils/Verbose.html +173 -35
- data/doc/rdoc/more/created.rid +1 -1
- data/doc/rdoc/more/files/README.html +10 -16
- data/doc/rdoc/more/files/lib/more/facets/attr_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/buildable_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/consoleutils_rb.html +1 -18
- data/doc/rdoc/more/files/lib/more/facets/dependency_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/duration_rb.html +1 -41
- data/doc/rdoc/more/files/lib/more/facets/elementor_rb.html +2 -1
- data/doc/rdoc/more/files/lib/more/facets/enumerablepass_rb.html +2 -1
- data/doc/rdoc/more/files/lib/more/facets/{fileshell_rb.html → filter_rb.html} +6 -5
- data/doc/rdoc/more/files/lib/more/facets/inheritor_rb.html +3 -28
- data/doc/rdoc/more/files/lib/more/facets/iteration_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/kernel/meta_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/matcher_rb.html +97 -0
- data/doc/rdoc/more/files/lib/more/facets/memoize_rb.html +7 -4
- data/doc/rdoc/more/files/lib/more/facets/{cachedecorator_rb.html → memoizer_rb.html} +23 -49
- data/doc/rdoc/more/files/lib/more/facets/multipliers_rb.html +2 -18
- data/doc/rdoc/more/files/lib/more/facets/nilstatus_rb.html +1 -1
- data/doc/rdoc/{core/files/lib/core/facets/callstack_rb.html → more/files/lib/more/facets/openmodule_rb.html} +4 -4
- data/doc/rdoc/more/files/lib/more/facets/opesc_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/ostructable_rb.html +92 -0
- data/doc/rdoc/more/files/lib/more/facets/pathlist_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/snapshot_rb.html +2 -2
- data/doc/rdoc/more/files/lib/more/facets/sparse_array_rb.html +92 -0
- data/doc/rdoc/more/files/lib/more/facets/stash_rb.html +166 -0
- data/doc/rdoc/more/files/lib/more/facets/string/words_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/succ_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/thread_rb.html +1 -1
- data/doc/rdoc/more/files/lib/more/facets/ziputils_rb.html +6 -34
- data/doc/rdoc/more/fr_class_index.html +13 -17
- data/doc/rdoc/more/fr_file_index.html +7 -15
- data/doc/rdoc/more/fr_method_index.html +1079 -1003
- data/doc/rdoc/more/index.html +1 -1
- data/lib/core/facets/array/conjoin.rb +1 -1
- data/lib/core/facets/array/delete.rb +3 -60
- data/lib/core/facets/array/delete_unless.rb +15 -0
- data/lib/core/facets/array/delete_values.rb +50 -0
- data/lib/core/facets/array/index.rb +0 -26
- data/lib/core/facets/array/indexable.rb +2 -2
- data/lib/core/facets/array/merge.rb +1 -1
- data/lib/core/facets/array/only.rb +1 -2
- data/lib/core/facets/array/pad.rb +2 -2
- data/lib/core/facets/array/permutation.rb +1 -1
- data/lib/core/facets/array/product.rb +2 -2
- data/lib/core/facets/array/rotate.rb +2 -4
- data/lib/core/facets/array/select.rb +1 -1
- data/lib/core/facets/array/splice.rb +1 -1
- data/lib/core/facets/array/stackable.rb +2 -2
- data/lib/core/facets/binding/caller.rb +2 -7
- data/lib/core/facets/binding/callstack.rb +1 -0
- data/lib/core/facets/binding/defined.rb +0 -1
- data/lib/core/facets/bitmask.rb +6 -9
- data/lib/core/facets/class/cattr.rb +6 -9
- data/lib/core/facets/class/descendents.rb +0 -2
- data/lib/core/facets/class/prepend.rb +3 -4
- data/lib/core/facets/class/to_proc.rb +0 -20
- data/lib/core/facets/comparable/at_least.rb +1 -0
- data/lib/core/facets/comparable/at_most.rb +1 -0
- data/lib/core/facets/comparable/bound.rb +1 -65
- data/lib/core/facets/comparable/cap.rb +34 -0
- data/lib/core/facets/comparable/clip.rb +38 -0
- data/lib/core/facets/comparable/cmp.rb +3 -3
- data/lib/core/facets/comparable/comparable.rb +1 -1
- data/lib/core/facets/dir/ascend.rb +2 -5
- data/lib/core/facets/dir/multiglob.rb +0 -2
- data/lib/core/facets/dir/recurse.rb +1 -2
- data/lib/core/facets/enumerable/accumulate.rb +2 -0
- data/lib/core/facets/enumerable/cluster_by.rb +1 -1
- data/lib/core/facets/enumerable/collect.rb +2 -2
- data/lib/core/facets/enumerable/commonality.rb +1 -1
- data/lib/core/facets/enumerable/count.rb +1 -1
- data/lib/core/facets/enumerable/divide.rb +1 -1
- data/lib/core/facets/enumerable/duplicates.rb +2 -2
- data/lib/core/facets/enumerable/each_by.rb +1 -1
- data/lib/core/facets/enumerable/entropy.rb +2 -2
- data/lib/core/facets/enumerable/frequency.rb +1 -1
- data/lib/core/facets/enumerable/graph.rb +1 -0
- data/lib/core/facets/enumerable/group_by.rb +1 -1
- data/lib/core/facets/enumerable/inject.rb +2 -3
- data/lib/core/facets/enumerable/map_send.rb +15 -3
- data/lib/core/facets/enumerable/mash.rb +4 -5
- data/lib/core/facets/enumerable/mode.rb +1 -1
- data/lib/core/facets/enumerable/modulate.rb +2 -2
- data/lib/core/facets/enumerable/none.rb +1 -1
- data/lib/core/facets/enumerable/occur.rb +0 -2
- data/lib/core/facets/enumerable/one.rb +1 -1
- data/lib/core/facets/enumerable/probability.rb +1 -1
- data/lib/core/facets/enumerable/sum.rb +1 -1
- data/lib/core/facets/enumerable/take.rb +20 -0
- data/lib/core/facets/enumerable/uniq_by.rb +0 -2
- data/lib/core/facets/exception/detail.rb +1 -1
- data/lib/core/facets/exception/suppress.rb +1 -2
- data/lib/core/facets/file/append.rb +1 -1
- data/lib/core/facets/file/create.rb +1 -1
- data/lib/core/facets/file/null.rb +1 -1
- data/lib/core/facets/file/read.rb +3 -3
- data/lib/core/facets/file/rewrite.rb +1 -1
- data/lib/core/facets/file/rootname.rb +1 -1
- data/lib/core/facets/file/split_all.rb +19 -0
- data/lib/core/facets/file/split_root.rb +3 -0
- data/lib/core/facets/file/write.rb +1 -1
- data/lib/core/facets/file/writelines.rb +1 -2
- data/lib/core/facets/filetest/root.rb +1 -1
- data/lib/core/facets/hash/alias.rb +1 -1
- data/lib/core/facets/hash/autonew.rb +1 -17
- data/lib/core/facets/hash/collate.rb +1 -1
- data/lib/core/facets/hash/delete.rb +3 -3
- data/lib/core/facets/hash/insert.rb +1 -1
- data/lib/core/facets/hash/inverse.rb +1 -1
- data/lib/core/facets/hash/join.rb +1 -1
- data/lib/core/facets/hash/keys.rb +3 -3
- data/lib/core/facets/hash/op_add.rb +1 -1
- data/lib/core/facets/hash/op_and.rb +1 -1
- data/lib/core/facets/hash/op_mul.rb +1 -1
- data/lib/core/facets/hash/op_or.rb +1 -1
- data/lib/core/facets/hash/op_push.rb +1 -1
- data/lib/core/facets/hash/op_sub.rb +1 -1
- data/lib/core/facets/hash/rekey.rb +11 -7
- data/lib/core/facets/hash/replace_each.rb +16 -0
- data/lib/core/facets/hash/select.rb +1 -2
- data/lib/{more → core}/facets/hash/stringify_keys.rb +0 -0
- data/lib/core/facets/hash/symbolize_keys.rb +94 -0
- data/lib/core/facets/hash/to_options.rb +1 -0
- data/lib/core/facets/hash/to_struct.rb +1 -1
- data/lib/core/facets/hash/traverse.rb +2 -2
- data/lib/core/facets/hash/update.rb +5 -80
- data/lib/core/facets/hash/update_each.rb +18 -0
- data/lib/core/facets/hash/update_keys.rb +20 -0
- data/lib/core/facets/hash/update_values.rb +20 -0
- data/lib/core/facets/hash/weave.rb +1 -1
- data/lib/core/facets/hash/zipnew.rb +17 -1
- data/lib/core/facets/integer/factorial.rb +1 -1
- data/lib/core/facets/integer/multiple.rb +1 -1
- data/lib/core/facets/integer/odd.rb +2 -2
- data/lib/core/facets/kernel/__here__.rb +8 -0
- data/lib/core/facets/kernel/as.rb +2 -2
- data/lib/core/facets/kernel/attr_singleton.rb +5 -5
- data/lib/core/facets/{callstack.rb → kernel/callstack.rb} +1 -1
- data/lib/core/facets/kernel/complete.rb +1 -1
- data/lib/core/facets/kernel/constant.rb +1 -1
- data/lib/core/facets/kernel/d.rb +1 -5
- data/lib/core/facets/kernel/demo.rb +2 -2
- data/lib/core/facets/kernel/ergo.rb +2 -2
- data/lib/core/facets/kernel/instance_class.rb +1 -1
- data/lib/core/facets/kernel/instance_variables.rb +2 -4
- data/lib/core/facets/kernel/not_nil.rb +1 -1
- data/lib/core/facets/kernel/object_send.rb +1 -1
- data/lib/core/facets/kernel/p.rb +1 -1
- data/lib/core/facets/kernel/populate.rb +2 -2
- data/lib/core/facets/kernel/qua_class.rb +2 -2
- data/lib/core/facets/kernel/resc.rb +1 -1
- data/lib/core/facets/kernel/respond.rb +1 -1
- data/lib/core/facets/kernel/returning.rb +1 -1
- data/lib/core/facets/kernel/silence.rb +4 -4
- data/lib/core/facets/kernel/try.rb +5 -3
- data/lib/core/facets/matchdata/match.rb +1 -1
- data/lib/core/facets/matchdata/matchset.rb +2 -2
- data/lib/core/facets/metaid.rb +5 -5
- data/lib/core/facets/module/abstract.rb +1 -1
- data/lib/core/facets/module/alias_accessor.rb +3 -3
- data/lib/core/facets/module/alias_method_chain.rb +1 -2
- data/lib/core/facets/module/alias_module_function.rb +1 -1
- data/lib/core/facets/module/ancestor.rb +1 -1
- data/lib/core/facets/module/basename.rb +1 -1
- data/lib/core/facets/module/conflict.rb +1 -2
- data/lib/core/facets/module/include_function_module.rb +1 -1
- data/lib/core/facets/module/instance_methods.rb +4 -6
- data/lib/core/facets/module/is.rb +2 -2
- data/lib/core/facets/module/modspace.rb +1 -1
- data/lib/core/facets/module/module_load.rb +2 -2
- data/lib/core/facets/module/nesting.rb +1 -1
- data/lib/core/facets/module/op.rb +3 -6
- data/lib/core/facets/module/prepend.rb +1 -1
- data/lib/core/facets/module/redefine_method.rb +1 -1
- data/lib/core/facets/module/rename_method.rb +1 -1
- data/lib/core/facets/module/revise.rb +2 -2
- data/lib/core/facets/module/spacename.rb +1 -1
- data/lib/core/facets/module/wrap_method.rb +1 -1
- data/lib/core/facets/nilclass/to_f.rb +1 -1
- data/lib/core/facets/numeric/approx.rb +1 -1
- data/lib/core/facets/numeric/distance.rb +1 -1
- data/lib/core/facets/numeric/round.rb +3 -6
- data/lib/core/facets/objectspace.rb +6 -0
- data/lib/core/facets/objectspace/classes.rb +11 -0
- data/lib/core/facets/proc/bind.rb +1 -1
- data/lib/core/facets/proc/compose.rb +2 -2
- data/lib/core/facets/proc/to_method.rb +1 -1
- data/lib/core/facets/proc/update.rb +1 -1
- data/lib/core/facets/range/combine.rb +2 -2
- data/lib/core/facets/range/overlap.rb +1 -2
- data/lib/core/facets/range/within.rb +2 -4
- data/lib/core/facets/regexp/arity.rb +1 -1
- data/lib/core/facets/string/align.rb +3 -3
- data/lib/core/facets/string/bracket.rb +6 -6
- data/lib/core/facets/string/camelcase.rb +1 -1
- data/lib/core/facets/string/capitalized.rb +3 -3
- data/lib/core/facets/string/chars.rb +1 -1
- data/lib/core/facets/string/chomp.rb +2 -2
- data/lib/core/facets/string/cleave.rb +1 -1
- data/lib/core/facets/string/compress_lines.rb +17 -0
- data/lib/core/facets/string/contains.rb +7 -0
- data/lib/core/facets/string/divide.rb +1 -1
- data/lib/core/facets/string/expand_tab.rb +35 -0
- data/lib/core/facets/string/fold.rb +1 -1
- data/lib/core/facets/string/indent.rb +25 -0
- data/lib/core/facets/string/interpolate.rb +1 -1
- data/lib/core/facets/string/line_wrap.rb +1 -1
- data/lib/core/facets/string/lines.rb +1 -2
- data/lib/core/facets/string/margin.rb +30 -0
- data/lib/core/facets/string/methodize.rb +1 -1
- data/lib/core/facets/string/mscan.rb +1 -1
- data/lib/core/facets/string/natcmp.rb +1 -2
- data/lib/core/facets/string/nchar.rb +0 -2
- data/lib/core/facets/string/op_sub.rb +1 -1
- data/lib/core/facets/string/outdent.rb +1 -0
- data/lib/core/facets/string/range.rb +4 -5
- data/lib/core/facets/string/rewrite.rb +1 -1
- data/lib/core/facets/string/shatter.rb +1 -1
- data/lib/core/facets/string/snakecase.rb +1 -1
- data/lib/core/facets/string/splice.rb +2 -2
- data/lib/core/facets/string/start_with.rb +2 -4
- data/lib/core/facets/string/tab.rb +9 -92
- data/lib/core/facets/string/tabto.rb +19 -0
- data/lib/core/facets/string/titlecase.rb +1 -1
- data/lib/core/facets/string/to_re.rb +2 -2
- data/lib/core/facets/string/word_wrap.rb +2 -4
- data/lib/core/facets/struct.rb +6 -0
- data/lib/core/facets/struct/attributes.rb +11 -0
- data/lib/core/facets/symbol/chomp.rb +2 -2
- data/lib/core/facets/symbol/generate.rb +1 -1
- data/lib/core/facets/symbol/not.rb +2 -2
- data/lib/core/facets/symbol/succ.rb +1 -1
- data/lib/core/facets/symbol/to_proc.rb +2 -3
- data/lib/core/facets/time/advance.rb +2 -1
- data/lib/core/facets/time/elapse.rb +1 -1
- data/lib/core/facets/time/hence.rb +16 -13
- data/lib/core/facets/time/stamp.rb +2 -2
- data/lib/core/facets/to_hash.rb +1 -1
- data/lib/core/facets/unboundmethod/arguments.rb +1 -1
- data/lib/core/facets/unboundmethod/name.rb +1 -1
- data/lib/lore/facets/date.rb +2 -2
- data/lib/lore/facets/enumerator.rb +67 -0
- data/lib/lore/facets/ostruct.rb +3 -7
- data/lib/more/facets/attr.rb +10 -9
- data/lib/more/facets/consoleutils.rb +1 -15
- data/lib/more/facets/dependency.rb +1 -1
- data/lib/more/facets/duration.rb +271 -525
- data/lib/more/facets/filter.rb +121 -0
- data/lib/more/facets/inheritor.rb +37 -58
- data/lib/more/facets/iteration.rb +1 -1
- data/lib/more/facets/kernel/meta.rb +1 -1
- data/lib/more/facets/{dictionarymatcher.rb → matcher.rb} +15 -11
- data/lib/more/facets/memoize.rb +9 -12
- data/lib/more/facets/memoizer.rb +74 -0
- data/lib/more/facets/multipliers.rb +54 -66
- data/lib/more/facets/nilstatus.rb +3 -2
- data/lib/more/facets/openmodule.rb +15 -0
- data/lib/more/facets/opesc.rb +1 -1
- data/lib/more/facets/ostructable.rb +212 -0
- data/lib/more/facets/pathlist.rb +1 -0
- data/lib/more/facets/sparse_array.rb +809 -0
- data/lib/more/facets/stash.rb +66 -0
- data/lib/more/facets/string/words.rb +8 -11
- data/lib/more/facets/succ.rb +3 -3
- data/lib/more/facets/thread.rb +2 -2
- data/lib/more/facets/ziputils.rb +238 -97
- data/test/core/array/test_index.rb +17 -0
- data/test/core/class/test_cattr.rb +1 -1
- data/test/core/class/test_to_proc.rb +13 -0
- data/test/core/comparable/test_cap.rb +25 -0
- data/test/core/comparable/{test_bound.rb → test_clip.rb} +1 -20
- data/test/core/file/test_split_all.rb +32 -0
- data/test/core/hash/test_op_mul.rb +1 -1
- data/test/core/hash/test_op_push.rb +7 -0
- data/test/core/hash/test_replace_each.rb +14 -0
- data/test/core/hash/test_update_each.rb +13 -0
- data/test/core/hash/test_update_keys.rb +18 -0
- data/test/core/hash/test_update_values.rb +12 -0
- data/test/core/kernel/test_callstack.rb +1 -1
- data/test/core/string/test_indent.rb +13 -0
- data/test/core/string/test_margin.rb +100 -0
- data/test/core/string/test_outdent.rb +65 -0
- data/test/core/string/test_tab.rb +1 -162
- data/test/core/string/test_tabto.rb +13 -0
- data/test/{more → core}/test_metaid.rb +8 -8
- data/test/core/time/test_hence.rb +118 -4
- data/test/core/unboundmethod/test_name.rb +1 -1
- data/test/more/{test_arguments.rb → test_argvector.rb} +8 -12
- data/test/more/test_filter.rb +87 -0
- data/test/more/test_memoize.rb +11 -9
- data/test/more/test_sparsearray.rb +279 -0
- metadata +741 -725
- data/demo/bench/bench_load.rb +0 -56
- data/demo/bench/enumerable/bench_collect.rb +0 -84
- data/demo/bench/enumerable/bench_count.rb +0 -58
- data/demo/bench/general/bench_calls.rb +0 -74
- data/demo/bench/general/bench_includes.rb +0 -25
- data/demo/bench/general/bench_methods.rb +0 -17
- data/demo/bench/general/bench_pathname.rb +0 -24
- data/demo/bench/general/bench_range.rb +0 -64
- data/demo/bench/general/bench_return.rb +0 -56
- data/demo/bench/general/bench_yeild.rb +0 -75
- data/demo/bench/general/comment_loading/bench.rb +0 -46
- data/demo/bench/general/comment_loading/comments_begin.rb +0 -109
- data/demo/bench/general/comment_loading/comments_end.rb +0 -127
- data/demo/bench/general/comment_loading/comments_none.rb +0 -1
- data/demo/bench/general/comment_loading/comments_sharp.rb +0 -125
- data/demo/bench/integer/bench_factorial.rb +0 -31
- data/demo/sample/annotations/annotations1.rb +0 -22
- data/demo/sample/ansicolor/cdiff.rb +0 -20
- data/demo/sample/ansicolor/example.rb +0 -82
- data/doc/book/notes.rdoc +0 -9
- data/doc/rdoc/more/classes/BigDuration.html +0 -323
- data/doc/rdoc/more/classes/CLI/Arguments.html +0 -488
- data/doc/rdoc/more/classes/CLI/Command.html +0 -316
- data/doc/rdoc/more/classes/Chain.html +0 -206
- data/doc/rdoc/more/classes/FileShell.html +0 -743
- data/doc/rdoc/more/classes/TagIterator.html +0 -581
- data/doc/rdoc/more/classes/UploadUtils.html +0 -497
- data/doc/rdoc/more/classes/Weekdays.html +0 -218
- data/doc/rdoc/more/files/lib/more/facets/annotations_rb.html +0 -180
- data/doc/rdoc/more/files/lib/more/facets/arguments_rb.html +0 -142
- data/doc/rdoc/more/files/lib/more/facets/cattr_rb.html +0 -125
- data/doc/rdoc/more/files/lib/more/facets/chain_rb.html +0 -114
- data/doc/rdoc/more/files/lib/more/facets/command_rb.html +0 -170
- data/doc/rdoc/more/files/lib/more/facets/eventhook_rb.html +0 -141
- data/doc/rdoc/more/files/lib/more/facets/tagiterator_rb.html +0 -111
- data/doc/rdoc/more/files/lib/more/facets/times_rb.html +0 -163
- data/doc/rdoc/more/files/lib/more/facets/uploadutils_rb.html +0 -176
- data/lib/more/facets/annotations.rb +0 -302
- data/lib/more/facets/arguments.rb +0 -365
- data/lib/more/facets/bytes.rb +0 -175
- data/lib/more/facets/cachedecorator.rb +0 -117
- data/lib/more/facets/chain.rb +0 -58
- data/lib/more/facets/command.rb +0 -439
- data/lib/more/facets/eventhook.rb +0 -132
- data/lib/more/facets/fileshell.rb +0 -202
- data/lib/more/facets/hash/symbolize_keys.rb +0 -94
- data/lib/more/facets/tagiter.rb +0 -366
- data/lib/more/facets/times.rb +0 -431
- data/lib/more/facets/uploadutils.rb +0 -464
- data/test/core/hash/test_update.rb +0 -46
- data/test/more/test_annotations.rb +0 -120
- data/test/more/test_bytes.rb +0 -71
- data/test/more/test_command.rb +0 -69
- data/test/more/test_times.rb +0 -89
@@ -19,7 +19,7 @@ class Time
|
|
19
19
|
|
20
20
|
# Produce time stamp for Time.now. See #stamp.
|
21
21
|
#
|
22
|
-
#
|
22
|
+
# CREDIT: Trans
|
23
23
|
|
24
24
|
def self.stamp(*args)
|
25
25
|
now.stamp(*args)
|
@@ -31,7 +31,7 @@ class Time
|
|
31
31
|
#
|
32
32
|
# Supported formats come from the Time::FORMAT constant.
|
33
33
|
#
|
34
|
-
#
|
34
|
+
# CREDIT: Trans
|
35
35
|
|
36
36
|
def stamp(fmt = nil)
|
37
37
|
unless String === fmt
|
data/lib/core/facets/to_hash.rb
CHANGED
data/lib/lore/facets/date.rb
CHANGED
@@ -84,7 +84,7 @@ class Date
|
|
84
84
|
#
|
85
85
|
# Date.new(2004,2).days_in_month #=> 28
|
86
86
|
#
|
87
|
-
#
|
87
|
+
# CREDIT: Ken Kunz.
|
88
88
|
|
89
89
|
def days_in_month
|
90
90
|
Date.civil(year, month, -1).day
|
@@ -96,7 +96,7 @@ class Date
|
|
96
96
|
|
97
97
|
# Get the month name for this date object
|
98
98
|
#
|
99
|
-
#
|
99
|
+
# CREDIT: Benjamin Oakes
|
100
100
|
|
101
101
|
def month_name
|
102
102
|
MONTHNAMES[self.month]
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'enumerator'
|
2
|
+
|
3
|
+
if RUBY_VERSION < "1.9"
|
4
|
+
|
5
|
+
module Enumerable
|
6
|
+
|
7
|
+
class Enumerator
|
8
|
+
|
9
|
+
alias :old_initialize :initialize
|
10
|
+
|
11
|
+
# Provides the ruby-1.9 block form of Enumerator, where you can write:
|
12
|
+
#
|
13
|
+
# obj = Enumerator.new do |yielder|
|
14
|
+
# .. do stuff
|
15
|
+
# yielder.yield data # or: yielder << data
|
16
|
+
# .. etc
|
17
|
+
# end
|
18
|
+
#
|
19
|
+
# When obj.each is called, the block is run once. It should call
|
20
|
+
# yielder.yield with each item it wishes to generate.
|
21
|
+
#
|
22
|
+
# Example:
|
23
|
+
#
|
24
|
+
# fib = Enumerator.new { |y|
|
25
|
+
# a = b = 1
|
26
|
+
# loop {
|
27
|
+
# y << a
|
28
|
+
# a, b = b, a + b
|
29
|
+
# }
|
30
|
+
# }
|
31
|
+
#
|
32
|
+
# assert_equal [1, 1, 2, 3, 5, 8, 13, 21, 34, 55], fib.take(10)
|
33
|
+
|
34
|
+
def initialize(*args, &block)
|
35
|
+
if block_given?
|
36
|
+
@body = block
|
37
|
+
old_initialize(self, :_start)
|
38
|
+
else
|
39
|
+
old_initialize(*args)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def _start(*args,&receiver) #:nodoc:
|
44
|
+
@body.call(Yielder.new(receiver), *args)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Wrapper to allow yielder.yield(output) or yielder << output
|
48
|
+
# in the same way as ruby-1.9
|
49
|
+
|
50
|
+
class Yielder #:nodoc:
|
51
|
+
def initialize(proc)
|
52
|
+
@proc = proc
|
53
|
+
end
|
54
|
+
def yield(*args)
|
55
|
+
@proc[*args]
|
56
|
+
end
|
57
|
+
alias :<< :yield
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
# For ruby-1.9 compatibility, define Enumerator class at top level
|
64
|
+
Enumerator = Enumerable::Enumerator unless defined? ::Enumerator
|
65
|
+
|
66
|
+
end # if RUBY_VERSION
|
67
|
+
|
data/lib/lore/facets/ostruct.rb
CHANGED
@@ -53,9 +53,7 @@ class OpenStruct
|
|
53
53
|
# A setter block versus a defualt block is determined by the arity of
|
54
54
|
# the block. You can not provide both at the same time.
|
55
55
|
#
|
56
|
-
#
|
57
|
-
# CREDIT Gavin Sinclair
|
58
|
-
# CREDIT 7rans
|
56
|
+
# CREDIT: Noah Gibbs, Gavin Sinclair
|
59
57
|
#
|
60
58
|
def initialize(hash=nil, &block)
|
61
59
|
if block && block.arity==2
|
@@ -108,7 +106,7 @@ class OpenStruct
|
|
108
106
|
@table[key]=val
|
109
107
|
end
|
110
108
|
|
111
|
-
# CREDIT Robert J. Berger <rberger AT ibd.com>
|
109
|
+
# CREDIT: Robert J. Berger <rberger AT ibd.com>
|
112
110
|
# Thanks for reporting issues that this method resolved.
|
113
111
|
|
114
112
|
# Provides access to an OpenStruct's inner table.
|
@@ -200,9 +198,7 @@ class Hash
|
|
200
198
|
OpenStruct.new(self)
|
201
199
|
end
|
202
200
|
|
203
|
-
# CREDIT Alison Rowland
|
204
|
-
# CREDIT Jamie Macey
|
205
|
-
# CREDIT Mat Schaffer
|
201
|
+
# CREDIT Alison Rowland, Jamie Macey, Mat Schaffer
|
206
202
|
|
207
203
|
#--
|
208
204
|
# Special thanks to Alison Rowland, Jamie Macey and Mat Schaffer
|
data/lib/more/facets/attr.rb
CHANGED
@@ -3,7 +3,7 @@ class Module
|
|
3
3
|
# Like attr_writer, but the writer method validates the
|
4
4
|
# setting against the given block.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# CREDIT: ?
|
7
7
|
|
8
8
|
def attr_validator(*symbols, &validator)
|
9
9
|
made = []
|
@@ -48,7 +48,7 @@ class Module
|
|
48
48
|
# end
|
49
49
|
# end
|
50
50
|
#
|
51
|
-
#
|
51
|
+
# CREDIT: Trans
|
52
52
|
|
53
53
|
def attr_setter(*args)
|
54
54
|
code, made = '', []
|
@@ -76,7 +76,7 @@ class Module
|
|
76
76
|
# x.b = 1
|
77
77
|
# x.a #=> 1
|
78
78
|
#
|
79
|
-
#
|
79
|
+
# CREDIT: Trans
|
80
80
|
|
81
81
|
def alias_setter(*args)
|
82
82
|
args = args - [orig]
|
@@ -102,7 +102,7 @@ class Module
|
|
102
102
|
# self
|
103
103
|
# end
|
104
104
|
#
|
105
|
-
#
|
105
|
+
# CREDIT: Trans
|
106
106
|
|
107
107
|
def attr_accessor!(*args)
|
108
108
|
attr_reader!(*args) + attr_writer!(*args)
|
@@ -112,7 +112,7 @@ class Module
|
|
112
112
|
|
113
113
|
# Create aliases for flag accessors.
|
114
114
|
#
|
115
|
-
#
|
115
|
+
# CREDIT: Trans
|
116
116
|
|
117
117
|
def alias_accessor!(*args)
|
118
118
|
orig = args.last
|
@@ -135,7 +135,7 @@ class Module
|
|
135
135
|
# def a?
|
136
136
|
# @a ? true : @a
|
137
137
|
# end
|
138
|
-
|
138
|
+
#
|
139
139
|
def attr_reader!(*args)
|
140
140
|
code, made = '', []
|
141
141
|
args.each do |a|
|
@@ -154,7 +154,7 @@ class Module
|
|
154
154
|
|
155
155
|
# Create aliases for flag reader.
|
156
156
|
#
|
157
|
-
#
|
157
|
+
# CREDIT: Trans
|
158
158
|
|
159
159
|
def alias_reader!(*args)
|
160
160
|
orig = args.last
|
@@ -177,7 +177,7 @@ class Module
|
|
177
177
|
# @a = value
|
178
178
|
# self
|
179
179
|
# end
|
180
|
-
|
180
|
+
#
|
181
181
|
def attr_writer!(*args)
|
182
182
|
code, made = '', []
|
183
183
|
args.each do |a|
|
@@ -195,7 +195,7 @@ class Module
|
|
195
195
|
|
196
196
|
# Create aliases for flag writer.
|
197
197
|
#
|
198
|
-
#
|
198
|
+
# CREDIT: Trans
|
199
199
|
|
200
200
|
def alias_writer!(*args)
|
201
201
|
orig = args.last
|
@@ -206,3 +206,4 @@ class Module
|
|
206
206
|
end
|
207
207
|
|
208
208
|
end
|
209
|
+
|
@@ -1,18 +1,4 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
# ConsoleUtils provides methods that are
|
4
|
-
# generally useful in the context of
|
5
|
-
# creating console output.
|
6
|
-
#
|
7
|
-
# = Authors
|
8
|
-
#
|
9
|
-
# * Thomas Sawyer
|
10
|
-
#
|
11
|
-
# == Copying
|
12
|
-
#
|
13
|
-
# Copyright (c) 2006,2007 Thomas Sawyer
|
14
|
-
# Ruby/GPL
|
15
|
-
|
1
|
+
warn "WARNING: facets/consoleutils.rb will be deprecated. Use alternate solution, such as Clio, for future versions."
|
16
2
|
|
17
3
|
# = ConsoleUtils
|
18
4
|
#
|
data/lib/more/facets/duration.rb
CHANGED
@@ -1,540 +1,286 @@
|
|
1
|
-
# = Duration
|
2
|
-
#
|
3
|
-
# Duration is a simple class that provides ways of easily manipulating durations
|
4
|
-
# (timespans) and formatting them as well.
|
5
|
-
#
|
6
|
-
# require 'duration'
|
7
|
-
# => true
|
8
|
-
# d = Duration.new(60 * 60 * 24 * 10 + 120 + 30)
|
9
|
-
# => #<Duration: 1 week, 3 days, 2 minutes and 30 seconds>
|
10
|
-
# d.to_s
|
11
|
-
# => "1 week, 3 days, 2 minutes and 30 seconds"
|
12
|
-
# [d.weeks, d.days]
|
13
|
-
# => [1, 3]
|
14
|
-
# d.days = 7; d
|
15
|
-
# => #<Duration: 2 weeks, 2 minutes and 30 seconds>
|
16
|
-
# d.strftime('%w w, %d d, %h h, %m m, %s s')
|
17
|
-
# => "2 w, 0 d, 0 h, 2 m, 30 s"
|
18
|
-
#
|
19
|
-
# == Author
|
20
|
-
#
|
21
|
-
# * Matthew Harris (mailto:shugotenshi@gmail.com)
|
22
|
-
#
|
23
|
-
# == Notes
|
24
|
-
#
|
25
|
-
# * This library comes from the orginal Duration project.
|
26
|
-
# See: http://www.rubyforge.org/projects/duration
|
27
|
-
#
|
28
|
-
# == Copying
|
29
|
-
#
|
30
|
-
# Copyright (c) 2006 Matthew Harris <shugotenshi at gmail.com>
|
31
|
-
|
32
|
-
# = Duration
|
33
|
-
#
|
34
|
-
# Duration is a simple class that provides ways of easily manipulating durations
|
35
|
-
# (timespans) and formatting them as well.
|
36
|
-
#
|
37
|
-
# require 'duration'
|
38
|
-
# => true
|
39
|
-
# d = Duration.new(60 * 60 * 24 * 10 + 120 + 30)
|
40
|
-
# => #<Duration: 1 week, 3 days, 2 minutes and 30 seconds>
|
41
|
-
# d.to_s
|
42
|
-
# => "1 week, 3 days, 2 minutes and 30 seconds"
|
43
|
-
# [d.weeks, d.days]
|
44
|
-
# => [1, 3]
|
45
|
-
# d.days = 7; d
|
46
|
-
# => #<Duration: 2 weeks, 2 minutes and 30 seconds>
|
47
|
-
# d.strftime('%w w, %d d, %h h, %m m, %s s')
|
48
|
-
# => "2 w, 0 d, 0 h, 2 m, 30 s"
|
49
|
-
|
50
1
|
class Duration
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
# Format duration.
|
98
|
-
#
|
99
|
-
# *Identifiers*
|
100
|
-
#
|
101
|
-
# %w -- Number of weeks
|
102
|
-
# %d -- Number of days
|
103
|
-
# %h -- Number of hours
|
104
|
-
# %m -- Number of minutes
|
105
|
-
# %s -- Number of seconds
|
106
|
-
# %t -- Total number of seconds
|
107
|
-
# %x -- Duration#to_s
|
108
|
-
# %% -- Literal `%' character
|
109
|
-
#
|
110
|
-
# *Example*
|
111
|
-
#
|
112
|
-
# d = Duration.new(:weeks => 10, :days => 7)
|
113
|
-
# => #<Duration: 11 weeks>
|
114
|
-
# d.strftime("It's been %w weeks!")
|
115
|
-
# => "It's been 11 weeks!"
|
116
|
-
#
|
117
|
-
def strftime(fmt)
|
118
|
-
h =\
|
119
|
-
{'w' => @weeks ,
|
120
|
-
'd' => @days ,
|
121
|
-
'h' => @hours ,
|
122
|
-
'm' => @minutes,
|
123
|
-
's' => @seconds,
|
124
|
-
't' => @total ,
|
125
|
-
'x' => to_s}
|
126
|
-
|
127
|
-
fmt.gsub(/%?%(w|d|h|m|s|t|x)/) do |match|
|
128
|
-
match.size == 3 ? match : h[match[1..1]]
|
129
|
-
end.gsub('%%', '%')
|
2
|
+
include Comparable
|
3
|
+
|
4
|
+
SECOND = 1
|
5
|
+
MINUTE = 60 * SECOND
|
6
|
+
HOUR = 60 * MINUTE
|
7
|
+
DAY = 24 * HOUR
|
8
|
+
WEEK = 7 * DAY
|
9
|
+
YEAR = 365 * DAY
|
10
|
+
|
11
|
+
SEGMENTS = %w{years weeks days hours minutes seconds}.collect{ |s| s.to_sym }
|
12
|
+
|
13
|
+
#
|
14
|
+
def self.[](seconds, *segments)
|
15
|
+
new(seconds, *segments)
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
def initialize(seconds=0, *segments)
|
20
|
+
@seconds = seconds.to_i
|
21
|
+
reset_segments(*segments)
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
def segments; @segments; end
|
26
|
+
|
27
|
+
#
|
28
|
+
def reset_segments(*segments)
|
29
|
+
case segments.size
|
30
|
+
when 0
|
31
|
+
@segments = [:days, :hours, :minutes, :seconds]
|
32
|
+
when 1
|
33
|
+
case segments = segments[0]
|
34
|
+
when Array
|
35
|
+
@segments = segments.collect{ |p| (p.to_s.downcase.chomp('s') + 's').to_sym }
|
36
|
+
raise ArgumentError unless @segments.all?{ |s| SEGMENTS.include?(s) }
|
37
|
+
else
|
38
|
+
f = SEGMENTS.index(segments)
|
39
|
+
@segments = SEGMENTS[f..0]
|
40
|
+
end
|
41
|
+
when 2
|
42
|
+
f = SEGMENTS.index(segments[0])
|
43
|
+
t = SEGMENTS.index(segments[1])
|
44
|
+
@segments = SEGMENTS[f..t]
|
45
|
+
else
|
46
|
+
raise ArgumentError
|
130
47
|
end
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
# Yield to block
|
183
|
-
yield part, time
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
# Calls `<=>' on Duration#total.
|
188
|
-
#
|
189
|
-
# *Example*
|
190
|
-
#
|
191
|
-
# 5.days == 24.hours * 5
|
192
|
-
# => true
|
193
|
-
#
|
194
|
-
def <=>(other)
|
195
|
-
@total <=> other.to_i
|
48
|
+
end
|
49
|
+
|
50
|
+
def inspect
|
51
|
+
h = to_h
|
52
|
+
segments.reverse.collect do |l|
|
53
|
+
"#{h[l.to_sym]} #{l}"
|
54
|
+
end.join(' ')
|
55
|
+
end
|
56
|
+
|
57
|
+
def to_i ; @seconds.to_i ; end
|
58
|
+
def to_f ; @seconds.to_f ; end
|
59
|
+
|
60
|
+
public
|
61
|
+
|
62
|
+
def to_a
|
63
|
+
a, s = [], @seconds
|
64
|
+
a[5], s = *s.divmod(YEAR) if @segments.include?(:years)
|
65
|
+
a[4], s = *s.divmod(WEEK) if @segments.include?(:weeks)
|
66
|
+
a[3], s = *s.divmod(DAY) if @segments.include?(:days)
|
67
|
+
a[2], s = *s.divmod(HOUR) if @segments.include?(:hours)
|
68
|
+
a[1], s = *s.divmod(MINUTE) if @segments.include?(:minutes)
|
69
|
+
a[0], s = *s.divmod(SECOND) if @segments.include?(:seconds)
|
70
|
+
a.compact.reverse
|
71
|
+
end
|
72
|
+
|
73
|
+
#
|
74
|
+
def to_h
|
75
|
+
h, s = {}, @seconds
|
76
|
+
h[:years], s = *s.divmod(YEAR) if @segments.include?(:years)
|
77
|
+
h[:weeks], s = *s.divmod(WEEK) if @segments.include?(:weeks)
|
78
|
+
h[:days], s = *s.divmod(DAY) if @segments.include?(:days)
|
79
|
+
h[:hours], s = *s.divmod(HOUR) if @segments.include?(:hours)
|
80
|
+
h[:minutes], s = *s.divmod(MINUTE) if @segments.include?(:minutes)
|
81
|
+
h[:seconds], s = *s.divmod(SECOND) if @segments.include?(:seconds)
|
82
|
+
h
|
83
|
+
end
|
84
|
+
|
85
|
+
def to_s
|
86
|
+
h = to_h
|
87
|
+
segments.reverse.collect do |l|
|
88
|
+
"#{h[l.to_sym]} #{l}"
|
89
|
+
end.join(' ')
|
90
|
+
end
|
91
|
+
|
92
|
+
# Returns true if <tt>other</tt> is also a Duration instance with the
|
93
|
+
# same <tt>value</tt>, or if <tt>other == value</tt>.
|
94
|
+
def ==(other)
|
95
|
+
if Duration === other
|
96
|
+
other.seconds == seconds
|
97
|
+
else
|
98
|
+
other == seconds
|
196
99
|
end
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
#
|
240
|
-
#
|
241
|
-
#
|
242
|
-
#
|
243
|
-
#
|
244
|
-
#
|
245
|
-
#
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
#
|
318
|
-
#
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
#
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
#
|
328
|
-
|
329
|
-
|
330
|
-
#
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
#
|
100
|
+
end
|
101
|
+
|
102
|
+
def <=>(other)
|
103
|
+
@seconds <=> other.to_i
|
104
|
+
end
|
105
|
+
|
106
|
+
#def is_a?(klass) #:nodoc:
|
107
|
+
# klass == self.class
|
108
|
+
#end
|
109
|
+
|
110
|
+
#def self.===(other) #:nodoc:
|
111
|
+
# other.is_a?(Duration) rescue super
|
112
|
+
#end
|
113
|
+
|
114
|
+
def years ; to_h[:years] ; end
|
115
|
+
def weeks ; to_h[:weeks] ; end
|
116
|
+
def days ; to_h[:days] ; end
|
117
|
+
def hours ; to_h[:hours] ; end
|
118
|
+
def minutes ; to_h[:minutes] ; end
|
119
|
+
def seconds ; to_h[:seconds] ; end
|
120
|
+
|
121
|
+
def total ; seconds ; end
|
122
|
+
|
123
|
+
def +(other)
|
124
|
+
self.class.new(@seconds + other.to_i, segments)
|
125
|
+
end
|
126
|
+
|
127
|
+
def -(other)
|
128
|
+
self.class.new(@seconds - other.to_i, segments)
|
129
|
+
end
|
130
|
+
|
131
|
+
def +(other)
|
132
|
+
self.class.new(@seconds * other.to_i, segments)
|
133
|
+
end
|
134
|
+
|
135
|
+
def /(other)
|
136
|
+
self.class.new(@seconds / other.to_i, segments)
|
137
|
+
end
|
138
|
+
|
139
|
+
#
|
140
|
+
def segmented(*segments)
|
141
|
+
self.class.new(@seconds, segments)
|
142
|
+
#segments = segments.collect{ |p| p.to_s.downcase.chomp('s') }
|
143
|
+
#y,w,d,h,m,s = nil,nil,nil,nil,nil,nil
|
144
|
+
#x = @seconds
|
145
|
+
#y, x = *x.divmod(YEAR) if segments.include?('year')
|
146
|
+
#w, x = *x.divmod(WEEK) if segments.include?('week')
|
147
|
+
#d, x = *x.divmod(DAY) if segments.include?('day')
|
148
|
+
#h, x = *x.divmod(HOUR) if segments.include?('hour')
|
149
|
+
#m, x = *x.divmod(MINUTE) if segments.include?('minute')
|
150
|
+
#s = x if segments.include?('second')
|
151
|
+
#[y, w, d, h, m, s].compact
|
152
|
+
end
|
153
|
+
|
154
|
+
# Format duration.
|
155
|
+
#
|
156
|
+
# *Identifiers*
|
157
|
+
#
|
158
|
+
# %w -- Number of weeks
|
159
|
+
# %d -- Number of days
|
160
|
+
# %h -- Number of hours
|
161
|
+
# %m -- Number of minutes
|
162
|
+
# %s -- Number of seconds
|
163
|
+
# %t -- Total number of seconds
|
164
|
+
# %x -- Duration#to_s
|
165
|
+
# %% -- Literal `%' character
|
166
|
+
#
|
167
|
+
# *Example*
|
168
|
+
#
|
169
|
+
# d = Duration.new(:weeks => 10, :days => 7)
|
170
|
+
# => #<Duration: 11 weeks>
|
171
|
+
# d.strftime("It's been %w weeks!")
|
172
|
+
# => "It's been 11 weeks!"
|
173
|
+
#
|
174
|
+
def strftime(fmt)
|
175
|
+
h = to_h
|
176
|
+
hx = {
|
177
|
+
'y' => h[:years] ,
|
178
|
+
'w' => h[:weeks] ,
|
179
|
+
'd' => h[:days] ,
|
180
|
+
'h' => h[:hours] ,
|
181
|
+
'm' => h[:minutes],
|
182
|
+
's' => h[:seconds],
|
183
|
+
't' => total,
|
184
|
+
'x' => to_s
|
185
|
+
}
|
186
|
+
fmt.gsub(/%?%(w|d|h|m|s|t|x)/) do |match|
|
187
|
+
hx[match[1..1]]
|
188
|
+
end.gsub('%%', '%')
|
189
|
+
end
|
190
|
+
|
191
|
+
#
|
192
|
+
def -@ #:nodoc:
|
193
|
+
self.class.new(-@seconds)
|
194
|
+
end
|
195
|
+
|
196
|
+
#
|
197
|
+
def +@ #:nodoc:
|
198
|
+
self.class.new(+@seconds)
|
199
|
+
end
|
200
|
+
|
201
|
+
#
|
202
|
+
# Need to wrap back to numeric methods, maybe use method_missing?
|
203
|
+
#
|
204
|
+
|
205
|
+
#
|
206
|
+
def before(time)
|
207
|
+
@seconds.before(time)
|
208
|
+
end
|
209
|
+
|
210
|
+
#
|
211
|
+
def after(time)
|
212
|
+
@seconds.after(time)
|
213
|
+
end
|
214
|
+
|
215
|
+
|
216
|
+
# = Numeric Extensions for Durations
|
217
|
+
#
|
218
|
+
module Numeric
|
219
|
+
|
220
|
+
# Enables the use of time calculations and declarations,
|
221
|
+
# like 45.minutes + 2.hours + 4.years. The base unit for
|
222
|
+
# all of these Numeric time methods is seconds.
|
223
|
+
def seconds ; Duration[self] ; end
|
224
|
+
alias_method :second, :seconds
|
225
|
+
|
226
|
+
# Converts minutes into seconds.
|
227
|
+
def minutes ; Duration[self * 60] ; end
|
228
|
+
alias_method :minute, :minutes
|
229
|
+
|
230
|
+
# Converts hours into seconds.
|
231
|
+
def hours ; Duration[self * 3600] ; end
|
232
|
+
alias_method :hour, :hours
|
233
|
+
#def as_hours ; self / 60.minutes ; end
|
234
|
+
|
235
|
+
# Converts days into seconds.
|
236
|
+
def days ; Duration[self * 86400] ; end
|
237
|
+
alias_method :day, :days
|
238
|
+
|
239
|
+
# Converts weeks into seconds.
|
240
|
+
def weeks ; Duration[self * 604800] ; end
|
241
|
+
alias_method :week, :weeks
|
242
|
+
|
243
|
+
# Converts fortnights into seconds.
|
244
|
+
# (A fortnight is 2 weeks)
|
245
|
+
def fortnights ; Duration[self * 1209600] ; end
|
246
|
+
alias_method :fortnight, :fortnights
|
247
|
+
|
248
|
+
# Converts months into seconds.
|
249
|
+
# WARNING: This is not exact as it assumes 30 days to a month.
|
250
|
+
def months ; Duration[self * 30 * 86400] ; end
|
251
|
+
alias_method :month, :months
|
252
|
+
|
253
|
+
# Converts years into seconds.
|
254
|
+
# WARNING: This is not exact as it assumes 365 days to a year.
|
255
|
+
# ie. It doesn not account for leap years.
|
256
|
+
def years ; Duration[self * 365 * 86400, :years] ; end
|
257
|
+
alias_method :year, :years
|
258
|
+
|
259
|
+
end
|
260
|
+
|
261
|
+
# Time#duration has been added to convert the UNIX timestamp into a Duration.
|
262
|
+
# See Time#duration for an example.
|
263
|
+
#
|
264
|
+
module Time
|
265
|
+
# Create a Duration object from the UNIX timestamp.
|
337
266
|
#
|
338
267
|
# *Example*
|
339
268
|
#
|
340
|
-
#
|
341
|
-
#
|
342
|
-
# d / 2
|
343
|
-
# => #<Duration: 15 seconds>
|
269
|
+
# Time.now.duration
|
270
|
+
# => #<Duration: 1898 weeks, 6 days, 1 hour, 12 minutes and 1 second>
|
344
271
|
#
|
345
|
-
def
|
346
|
-
|
272
|
+
def duration
|
273
|
+
Duration[to_i]
|
347
274
|
end
|
275
|
+
end
|
348
276
|
|
349
|
-
alias to_i total
|
350
277
|
end
|
351
278
|
|
352
|
-
|
353
|
-
|
354
|
-
# own risk.
|
355
|
-
#
|
356
|
-
class BigDuration < Duration
|
357
|
-
attr_reader :years, :months
|
358
|
-
|
359
|
-
YEAR = 60 * 60 * 24 * 30 * 12
|
360
|
-
MONTH = 60 * 60 * 24 * 30
|
361
|
-
|
362
|
-
# Similar to Duration.new except that BigDuration.new supports `:years' and
|
363
|
-
# `:months' and will also handle years and months correctly when breaking down
|
364
|
-
# the seconds.
|
365
|
-
#
|
366
|
-
def initialize(seconds_or_attr = 0)
|
367
|
-
if seconds_or_attr.kind_of? Hash
|
368
|
-
# Part->time map table.
|
369
|
-
h =\
|
370
|
-
{:years => YEAR ,
|
371
|
-
:months => MONTH ,
|
372
|
-
:weeks => WEEK ,
|
373
|
-
:days => DAY ,
|
374
|
-
:hours => HOUR ,
|
375
|
-
:minutes => MINUTE,
|
376
|
-
:seconds => SECOND}
|
377
|
-
|
378
|
-
# Loop through each valid part, ignore all others.
|
379
|
-
seconds = seconds_or_attr.inject(0) do |sec, args|
|
380
|
-
# Grab the part of the duration (week, day, whatever) and the number of seconds for it.
|
381
|
-
part, time = args
|
382
|
-
|
383
|
-
# Map each part to their number of seconds and the given value.
|
384
|
-
# {:weeks => 2} maps to h[:weeks] -- so... weeks = WEEK * 2
|
385
|
-
if h.key?(prt = part.to_s.to_sym) then sec + time * h[prt] else 0 end
|
386
|
-
end
|
387
|
-
else
|
388
|
-
seconds = seconds_or_attr
|
389
|
-
end
|
390
|
-
|
391
|
-
@total, array = seconds.to_f.round, []
|
392
|
-
@seconds = [YEAR, MONTH, WEEK, DAY, HOUR, MINUTE].inject(@total) do |left, part|
|
393
|
-
array << left / part; left % part
|
394
|
-
end
|
395
|
-
|
396
|
-
@years, @months, @weeks, @days, @hours, @minutes = array
|
397
|
-
end
|
398
|
-
|
399
|
-
# BigDuration variant of Duration#strftime.
|
400
|
-
#
|
401
|
-
# *Identifiers: BigDuration*
|
402
|
-
#
|
403
|
-
# %y -- Number of years
|
404
|
-
# %m -- Number of months
|
405
|
-
#
|
406
|
-
def strftime(fmt)
|
407
|
-
h = {'y' => @years, 'M' => @months}
|
408
|
-
super(fmt.gsub(/%?%(y|M)/) { |match| match.size == 3 ? match : h[match[1..1]] })
|
409
|
-
end
|
410
|
-
|
411
|
-
# Similar to Duration#each except includes years and months in the interation.
|
412
|
-
#
|
413
|
-
def each
|
414
|
-
[['years' , @years ],
|
415
|
-
['months' , @months ],
|
416
|
-
['weeks' , @weeks ],
|
417
|
-
['days' , @days ],
|
418
|
-
['hours' , @hours ],
|
419
|
-
['minutes' , @minutes],
|
420
|
-
['seconds' , @seconds]].each do |part, time|
|
421
|
-
# Yield to block
|
422
|
-
yield part, time
|
423
|
-
end
|
424
|
-
end
|
425
|
-
|
426
|
-
# Derived from Duration#seconds, but supports `:years' and `:months' as well.
|
427
|
-
#
|
428
|
-
def seconds(part = nil)
|
429
|
-
h = {:years => YEAR, :months => MONTH}
|
430
|
-
if [:years, :months].include? part
|
431
|
-
__send__(part) * h[part]
|
432
|
-
else
|
433
|
-
super(part)
|
434
|
-
end
|
435
|
-
end
|
436
|
-
|
437
|
-
# Set the number of years in the BigDuration.
|
438
|
-
#
|
439
|
-
def years=(n)
|
440
|
-
initialize(:years => n, :seconds => @total - seconds(:years))
|
441
|
-
end
|
442
|
-
|
443
|
-
# Set the number of months in the BigDuration.
|
444
|
-
#
|
445
|
-
def months=(n)
|
446
|
-
initialize(:months => n, :seconds => @total - seconds(:months))
|
447
|
-
end
|
279
|
+
class Numeric #:nodoc:
|
280
|
+
include Duration::Numeric
|
448
281
|
end
|
449
282
|
|
450
|
-
|
451
|
-
|
452
|
-
# Numeric#weeks -- Create a Duration object with given weeks
|
453
|
-
# Numeric#days -- Create a Duration object with given days
|
454
|
-
# Numeric#hours -- Create a Duration object with given hours
|
455
|
-
# Numeric#minutes -- Create a Duration object with given minutes
|
456
|
-
# Numeric#seconds -- Create a Duration object with given seconds
|
457
|
-
#
|
458
|
-
# BigDuration support:
|
459
|
-
#
|
460
|
-
# Numeric#years -- Create a BigDuration object with given years
|
461
|
-
# Numeric#months -- Create a BigDuration object with given months
|
462
|
-
#
|
463
|
-
# BigDuration objects can be created from regular weeks, days, hours, etc by
|
464
|
-
# providing `:big' as an argument to the above Numeric methods.
|
465
|
-
|
466
|
-
#
|
467
|
-
class Numeric
|
468
|
-
# Create a Duration object using self where self could represent weeks, days,
|
469
|
-
# hours, minutes, and seconds.
|
470
|
-
#
|
471
|
-
# *Example*
|
472
|
-
#
|
473
|
-
# 10.duration(:weeks)
|
474
|
-
# => #<Duration: 10 weeks>
|
475
|
-
# 10.duration
|
476
|
-
# => #<Duration: 10 seconds>
|
477
|
-
#
|
478
|
-
def duration(part = nil, klass = Duration)
|
479
|
-
if [:years, :months, :weeks, :days, :hours, :minutes, :seconds].include? part
|
480
|
-
klass.new(part => self)
|
481
|
-
else
|
482
|
-
klass.new(self)
|
483
|
-
end
|
484
|
-
end
|
485
|
-
|
486
|
-
# TODO: IF WE WANT TO DO THIS IT NEEDS TO BE ADDED TO times.rb ???
|
487
|
-
#
|
488
|
-
# alias __numeric_old_method_missing method_missing
|
489
|
-
#
|
490
|
-
# # Intercept calls to .weeks, .days, .hours, .minutes and .seconds because
|
491
|
-
# # Rails defines its own methods, so I'd like to prevent any redefining of
|
492
|
-
# # Rails' methods. If these methods don't get captured, then alternatively
|
493
|
-
# # Numeric#duration can be used.
|
494
|
-
# #
|
495
|
-
# # BigDuration methods include .years and .months, also BigDuration objects
|
496
|
-
# # can be created from any time such as weeks or minutes and even seconds.
|
497
|
-
# #
|
498
|
-
# # *Example: BigDuration*
|
499
|
-
# #
|
500
|
-
# # 5.years
|
501
|
-
# # => #<BigDuration: 5 years>
|
502
|
-
# # 10.minutes(:big)
|
503
|
-
# # => #<BigDuration: 10 minutes>
|
504
|
-
# #
|
505
|
-
# # *Example*
|
506
|
-
# #
|
507
|
-
# # 140.seconds
|
508
|
-
# # => #<Duration: 2 minutes and 20 seconds>
|
509
|
-
# #
|
510
|
-
# def method_missing(method, *args)
|
511
|
-
# if [:weeks, :days, :hours, :minutes, :seconds].include? method
|
512
|
-
# if args.size > 0 && args[0] == :big
|
513
|
-
# duration(method, BigDuration)
|
514
|
-
# else
|
515
|
-
# duration(method)
|
516
|
-
# end
|
517
|
-
# elsif [:years, :months].include? method
|
518
|
-
# duration(method, BigDuration)
|
519
|
-
# else
|
520
|
-
# __numeric_old_method_missing(method, *args)
|
521
|
-
# end
|
522
|
-
# end
|
523
|
-
|
283
|
+
class Time #:nodoc:
|
284
|
+
include Duration::Time
|
524
285
|
end
|
525
286
|
|
526
|
-
# Time#duration has been added to convert the UNIX timestamp into a Duration.
|
527
|
-
# See Time#duration for an example.
|
528
|
-
#
|
529
|
-
class Time
|
530
|
-
# Create a Duration object from the UNIX timestamp.
|
531
|
-
#
|
532
|
-
# *Example*
|
533
|
-
#
|
534
|
-
# Time.now.duration
|
535
|
-
# => #<Duration: 1898 weeks, 6 days, 1 hour, 12 minutes and 1 second>
|
536
|
-
#
|
537
|
-
def duration(type = nil)
|
538
|
-
if type == :big then BigDuration.new(to_i) else Duration.new(to_i) end
|
539
|
-
end
|
540
|
-
end
|