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
data/lib/more/facets/times.rb
DELETED
@@ -1,431 +0,0 @@
|
|
1
|
-
# = Times
|
2
|
-
#
|
3
|
-
# WARNING: Use Rich Units package for future compatibilty!
|
4
|
-
#
|
5
|
-
# == Synopsis
|
6
|
-
#
|
7
|
-
# Plain-English convenience methods for dealing with dates and times.
|
8
|
-
#
|
9
|
-
# == HISTORY
|
10
|
-
#
|
11
|
-
# Thanks to Richard Kilmer for the orignal work and Alexander Kellett
|
12
|
-
# for suggesting it for Facets.
|
13
|
-
#
|
14
|
-
# Thanks to Dave Hoover and Ryan Platte for the Weekdays implementation.
|
15
|
-
#
|
16
|
-
# == AUTHORS
|
17
|
-
#
|
18
|
-
# * Rich Kilmer
|
19
|
-
# * Thomas Sawyer
|
20
|
-
# * Dave Hoover
|
21
|
-
# * Ryan Platte
|
22
|
-
# * George Moschovitis
|
23
|
-
#
|
24
|
-
# == NOTES
|
25
|
-
#
|
26
|
-
# * This library is not compatible with STICK's units.rb (an spin-off
|
27
|
-
# of Facets old units.rb library). Do not attempt to use both at the same time.
|
28
|
-
#
|
29
|
-
# == TODOs
|
30
|
-
#
|
31
|
-
# * Extra Add in_* methods, like in_days, in_hours, etc.
|
32
|
-
#
|
33
|
-
# == COPYRIGHT
|
34
|
-
#
|
35
|
-
# Copyright (c) 2005 Rich Kilmer, Thomas Sawyer
|
36
|
-
#
|
37
|
-
# == LICENSE
|
38
|
-
#
|
39
|
-
# Ruby License
|
40
|
-
#
|
41
|
-
# This module is free software. You may use, modify, and/or redistribute this
|
42
|
-
# software under the same terms as Ruby.
|
43
|
-
#
|
44
|
-
# This program is distributed in the hope that it will be useful, but WITHOUT
|
45
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
46
|
-
# FITNESS FOR A PARTICULAR PURPOSE.
|
47
|
-
|
48
|
-
require 'facets/time/change'
|
49
|
-
require 'facets/time/set'
|
50
|
-
require 'facets/time/ago'
|
51
|
-
require 'facets/time/hence'
|
52
|
-
|
53
|
-
class Time
|
54
|
-
|
55
|
-
NEVER = Time.mktime(2038)
|
56
|
-
ZERO = Time.mktime(1972)
|
57
|
-
|
58
|
-
# This method calculates the days extrema given two time objects.
|
59
|
-
# start time is the given time1 at 00:00:00
|
60
|
-
# end time is the given time2 at 23:59:59:999
|
61
|
-
#
|
62
|
-
# Input:
|
63
|
-
# - the two times (if only time1 is provided then you get an extrema
|
64
|
-
# of exactly one day extrema.
|
65
|
-
#
|
66
|
-
# Output:
|
67
|
-
# - the time range. you can get the start/end times using
|
68
|
-
# range methods.
|
69
|
-
#
|
70
|
-
# CREDIT George Moschovitis
|
71
|
-
|
72
|
-
def self.days_extrema(time1, time2=nil)
|
73
|
-
time2 = time1 if (not time2.valid? Time)
|
74
|
-
time2 = NEVER if (time2 <= time1)
|
75
|
-
start_time = Time.self.start_of_day(time1)
|
76
|
-
end_time = self.end_of_day(time2)
|
77
|
-
return (start_time..end_time)
|
78
|
-
end
|
79
|
-
|
80
|
-
# Seconds since midnight: Time.now.seconds_since_midnight
|
81
|
-
|
82
|
-
def seconds_since_midnight
|
83
|
-
self.hour.hours + self.min.minutes + self.sec + (self.usec/1.0e+6)
|
84
|
-
end
|
85
|
-
|
86
|
-
# Returns a new Time representing the time a number of seconds ago.
|
87
|
-
# Do not use this method in combination with x.months, use months_ago instead!
|
88
|
-
#def ago(seconds)
|
89
|
-
# # This is basically a wrapper around the Numeric extension.
|
90
|
-
# #seconds.until(self)
|
91
|
-
# self - seconds
|
92
|
-
#end
|
93
|
-
|
94
|
-
# Returns a new Time representing the time
|
95
|
-
# a number of minutes ago.
|
96
|
-
|
97
|
-
def minutes_ago(minutes)
|
98
|
-
self - (minutes * 60)
|
99
|
-
end
|
100
|
-
|
101
|
-
# Returns a new Time representing the time
|
102
|
-
# a number of hours ago.
|
103
|
-
|
104
|
-
def hours_ago(hours)
|
105
|
-
self - (hours * 3600)
|
106
|
-
end
|
107
|
-
|
108
|
-
# Returns a new Time representing the time
|
109
|
-
# a number of days ago.
|
110
|
-
|
111
|
-
def days_ago(days)
|
112
|
-
self - (days * 86400)
|
113
|
-
end
|
114
|
-
|
115
|
-
# Returns a new Time representing the time
|
116
|
-
# a number of weeks ago.
|
117
|
-
|
118
|
-
def weeks_ago(weeks)
|
119
|
-
self - (weeks * 604800)
|
120
|
-
end
|
121
|
-
|
122
|
-
# Returns a new Time representing the time
|
123
|
-
# a number of months ago.
|
124
|
-
|
125
|
-
def months_ago(months)
|
126
|
-
years = (month - months / 12).to_i
|
127
|
-
set(:year=>(year - years), :month=>(month - months) % 12)
|
128
|
-
end
|
129
|
-
|
130
|
-
# Returns a new Time representing the time a number of specified
|
131
|
-
# months ago.
|
132
|
-
#def months_ago(months)
|
133
|
-
# if months >= self.month
|
134
|
-
# change(:year => self.year - 1, :month => 12).months_ago(months - self.month)
|
135
|
-
# else
|
136
|
-
# change(:year => self.year, :month => self.month - months)
|
137
|
-
# end
|
138
|
-
#end
|
139
|
-
|
140
|
-
# Returns a new Time representing the time
|
141
|
-
# a number of years ago.
|
142
|
-
|
143
|
-
def years_ago(years)
|
144
|
-
set(:year=>(year - years))
|
145
|
-
end
|
146
|
-
|
147
|
-
# Returns a new Time representing the time a number of specified
|
148
|
-
# years ago.
|
149
|
-
#def years_ago(years)
|
150
|
-
# change(:year => self.year - years)
|
151
|
-
#end
|
152
|
-
|
153
|
-
# Returns a new Time representing the time
|
154
|
-
# a number of minutes hence.
|
155
|
-
|
156
|
-
def minutes_hence(minutes)
|
157
|
-
self + (minutes * 60)
|
158
|
-
end
|
159
|
-
|
160
|
-
# Returns a new Time representing the time
|
161
|
-
# a number of hours hence.
|
162
|
-
|
163
|
-
def hours_hence(hours)
|
164
|
-
self + (hours * 3600)
|
165
|
-
end
|
166
|
-
|
167
|
-
# Returns a new Time representing the time
|
168
|
-
# a number of days hence.
|
169
|
-
|
170
|
-
def days_hence(days)
|
171
|
-
self + (days * 86400)
|
172
|
-
end
|
173
|
-
|
174
|
-
# Returns a new Time representing the time
|
175
|
-
# a number of weeks hence.
|
176
|
-
|
177
|
-
def weeks_hence(weeks)
|
178
|
-
self + (weeks * 604800)
|
179
|
-
end
|
180
|
-
|
181
|
-
# Returns a new Time representing the time
|
182
|
-
# a number of months hence.
|
183
|
-
|
184
|
-
def months_hence(months)
|
185
|
-
years = (month + months / 12).to_i
|
186
|
-
set(:year=>(year + years), :month=>(month + months) % 12)
|
187
|
-
end
|
188
|
-
|
189
|
-
#def months_hence(months)
|
190
|
-
# if months + self.month > 12
|
191
|
-
# change(:year => self.year + 1, :month => 1).months_since(months - (self.month == 1 ? 12 : (self.month + 1)))
|
192
|
-
# else
|
193
|
-
# change(:year => self.year, :month => self.month + months)
|
194
|
-
# end
|
195
|
-
#end
|
196
|
-
|
197
|
-
# Returns a new Time representing the time
|
198
|
-
# a number of years hence.
|
199
|
-
|
200
|
-
def years_hence(years)
|
201
|
-
set(:year=>(year + years))
|
202
|
-
end
|
203
|
-
|
204
|
-
# Returns a new Time representing the time a number of seconds
|
205
|
-
# since the instance time. Do not use this method in combination
|
206
|
-
# with x.months, use months_since instead!
|
207
|
-
alias_method :since, :hence
|
208
|
-
|
209
|
-
alias_method :minutes_since, :minutes_hence
|
210
|
-
alias_method :days_since, :days_hence
|
211
|
-
alias_method :weeks_since, :weeks_hence
|
212
|
-
alias_method :months_since, :months_hence
|
213
|
-
alias_method :years_since, :years_hence
|
214
|
-
|
215
|
-
#def years_since(years)
|
216
|
-
# change(:year => self.year + years)
|
217
|
-
#end
|
218
|
-
|
219
|
-
# Short-hand for years_ago(1)
|
220
|
-
def last_year
|
221
|
-
years_ago(1)
|
222
|
-
end
|
223
|
-
|
224
|
-
# Short-hand for years_since(1)
|
225
|
-
def next_year
|
226
|
-
years_since(1)
|
227
|
-
end
|
228
|
-
|
229
|
-
# Short-hand for months_ago(1)
|
230
|
-
def last_month
|
231
|
-
months_ago(1)
|
232
|
-
end
|
233
|
-
|
234
|
-
# Short-hand for months_since(1)
|
235
|
-
def next_month
|
236
|
-
months_since(1)
|
237
|
-
end
|
238
|
-
|
239
|
-
# Returns a new Time representing the "start" of this week (Monday, 0:00)
|
240
|
-
def beginning_of_week
|
241
|
-
(self - self.wday.days).midnight + 1.day
|
242
|
-
end
|
243
|
-
alias :monday :beginning_of_week
|
244
|
-
alias :at_beginning_of_week :beginning_of_week
|
245
|
-
|
246
|
-
# Returns a new Time representing the start of the given
|
247
|
-
# day in next week (default is Monday).
|
248
|
-
def next_week(day = :monday)
|
249
|
-
days_into_week = { :monday => 0, :tuesday => 1, :wednesday => 2,
|
250
|
-
:thursday => 3, :friday => 4, :saturday => 5,
|
251
|
-
:sunday => 6 }
|
252
|
-
since(1.week).beginning_of_week.since(days_into_week[day].day).change(:hour => 0)
|
253
|
-
end
|
254
|
-
|
255
|
-
# Set time to end of day
|
256
|
-
#def end_of_day
|
257
|
-
# return Time.mktime(year, month, day, 23, 59, 59, 999)
|
258
|
-
#end
|
259
|
-
|
260
|
-
# Returns a new Time representing the start of the day (0:00)
|
261
|
-
def beginning_of_day
|
262
|
-
self - self.seconds_since_midnight
|
263
|
-
end
|
264
|
-
alias :midnight :beginning_of_day
|
265
|
-
alias :at_midnight :beginning_of_day
|
266
|
-
alias :at_beginning_of_day :beginning_of_day
|
267
|
-
alias :start_of_day :beginning_of_day
|
268
|
-
|
269
|
-
# Returns a new Time representing the start of the month
|
270
|
-
# (1st of the month, 0:00)
|
271
|
-
def beginning_of_month
|
272
|
-
#self - ((self.mday-1).days + self.seconds_since_midnight)
|
273
|
-
change(:day => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0)
|
274
|
-
end
|
275
|
-
alias_method :at_beginning_of_month, :beginning_of_month
|
276
|
-
|
277
|
-
# Returns a new Time representing the start of the year (1st of january, 0:00)
|
278
|
-
def beginning_of_year
|
279
|
-
change(:month => 1,:day => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0)
|
280
|
-
end
|
281
|
-
alias :at_beginning_of_year :beginning_of_year
|
282
|
-
|
283
|
-
# Convenience method which returns a new Time representing
|
284
|
-
# the time 1 day ago
|
285
|
-
def yesterday
|
286
|
-
self.ago(1.day)
|
287
|
-
end
|
288
|
-
|
289
|
-
# Convenience method which returns a new Time representing
|
290
|
-
# the time 1 day since the instance time
|
291
|
-
def tomorrow
|
292
|
-
self.since(1.day)
|
293
|
-
end
|
294
|
-
|
295
|
-
# Returns a new time at start of day
|
296
|
-
def to_start_of_day
|
297
|
-
return Time.mktime(year, month, day, 0, 0, 0, 0)
|
298
|
-
end
|
299
|
-
|
300
|
-
# Returns a new time at end of day
|
301
|
-
def to_end_of_day
|
302
|
-
Time.mktime(year, month, day, 23, 59, 59, 999)
|
303
|
-
end
|
304
|
-
|
305
|
-
# Returns true only if day of time is included in the
|
306
|
-
# range (stime..etime). Only year days are checked.
|
307
|
-
def in_day_range?(stime=ZERO, etime=NEVER)
|
308
|
-
if (etime <= stime)
|
309
|
-
warn "invalid end time (#{etime} < #{stime})" if $DEBUG
|
310
|
-
etime = NEVER
|
311
|
-
end
|
312
|
-
|
313
|
-
stime = stime.to_start_of_day
|
314
|
-
etime = etime.to_end_of_day
|
315
|
-
|
316
|
-
return (stime..etime).include?(time)
|
317
|
-
end
|
318
|
-
end
|
319
|
-
|
320
|
-
|
321
|
-
class Numeric
|
322
|
-
|
323
|
-
# Enables the use of time calculations and declarations,
|
324
|
-
# like 45.minutes + 2.hours + 4.years. The base unit for
|
325
|
-
# all of these Numeric time methods is seconds.
|
326
|
-
def seconds ; self ; end
|
327
|
-
alias_method :second, :seconds
|
328
|
-
#def as_seconds ; self ; end
|
329
|
-
|
330
|
-
# Converts minutes into seconds.
|
331
|
-
def minutes ; self * 60 ; end
|
332
|
-
alias_method :minute, :minutes
|
333
|
-
#def as_minutes ; self.to_f / 60 ; end
|
334
|
-
|
335
|
-
# Converts hours into seconds.
|
336
|
-
def hours ; self * 60.minutes ; end
|
337
|
-
alias_method :hour, :hours
|
338
|
-
#def as_hours ; self / 60.minutes ; end
|
339
|
-
|
340
|
-
# Converts days into seconds.
|
341
|
-
def days ; self * 24.hours ; end
|
342
|
-
alias_method :day, :days
|
343
|
-
#def as_days ; self / 24.hours ; end
|
344
|
-
|
345
|
-
# Converts weeks into seconds.
|
346
|
-
def weeks ; self * 7.days ; end
|
347
|
-
alias_method :week, :weeks
|
348
|
-
#def as_weeks ; self / 7.days ; end
|
349
|
-
|
350
|
-
# Converts fortnights into seconds.
|
351
|
-
# (A fortnight is 2 weeks)
|
352
|
-
def fortnights ; self * 2.weeks ; end
|
353
|
-
alias_method :fortnight, :fortnights
|
354
|
-
#def as_fortnights ; self / 2.weeks ; end
|
355
|
-
|
356
|
-
# Converts months into seconds.
|
357
|
-
# WARNING: This is not exact as it assumes 30 days to a month.
|
358
|
-
def months ; self * 30.days ; end
|
359
|
-
alias_method :month, :months
|
360
|
-
#def as_months ; self / 30.days ; end
|
361
|
-
|
362
|
-
# Converts years into seconds.
|
363
|
-
def years ; self * 365.days ; end
|
364
|
-
alias_method :year, :years
|
365
|
-
#def as_years ; self / 365.days ; end
|
366
|
-
|
367
|
-
# Calculates time _before_ a given time. Default time is now.
|
368
|
-
# Reads best with arguments: 10.days.before( Time.now - 1.day )
|
369
|
-
def before(time = ::Time.now)
|
370
|
-
time - self
|
371
|
-
end
|
372
|
-
alias_method :until, :before # Reads best with argument: 10.minutes.until(time)
|
373
|
-
alias_method :ago, :before # Reads best without arguments: 10.minutes.ago
|
374
|
-
|
375
|
-
# Calculates time _after_ a given time. Default time is now.
|
376
|
-
# Reads best with argument: 10.minutes.after(time)
|
377
|
-
def after(time = ::Time.now)
|
378
|
-
time + self
|
379
|
-
end
|
380
|
-
alias_method :since, :after # Reads best with argument: 10.minutes.since(time)
|
381
|
-
alias_method :from_now, :after # Reads best without arguments: 10.minutes.from_now
|
382
|
-
alias_method :later, :after # Reads best without arguments: 10.minutes.later
|
383
|
-
|
384
|
-
# Works with day in terms of weekdays.
|
385
|
-
def weekdays
|
386
|
-
Weekdays.new(self)
|
387
|
-
end
|
388
|
-
alias :weekday :weekdays
|
389
|
-
|
390
|
-
end
|
391
|
-
|
392
|
-
|
393
|
-
# The Weekdays class provides useful weekday terminology to Numeric.
|
394
|
-
|
395
|
-
class Weekdays
|
396
|
-
WEEKDAYS = 1..5 # Monday is wday 1
|
397
|
-
ONE_DAY = 60 * 60 * 24
|
398
|
-
|
399
|
-
def initialize(n)
|
400
|
-
@n = n
|
401
|
-
end
|
402
|
-
|
403
|
-
def ago(time = ::Time.now)
|
404
|
-
step :down, time
|
405
|
-
end
|
406
|
-
alias :until :ago
|
407
|
-
alias :before :ago
|
408
|
-
|
409
|
-
def since(time = ::Time.now)
|
410
|
-
step :up, time
|
411
|
-
end
|
412
|
-
alias :from_now :since
|
413
|
-
alias :after :since
|
414
|
-
|
415
|
-
private
|
416
|
-
|
417
|
-
def step(direction, original_time)
|
418
|
-
result = original_time
|
419
|
-
time = ONE_DAY
|
420
|
-
|
421
|
-
compare = direction == :up ? ">" : "<"
|
422
|
-
time *= -1 if direction == :down
|
423
|
-
|
424
|
-
@n.times do
|
425
|
-
result += time until result.send(compare, original_time) && WEEKDAYS.member?(result.wday)
|
426
|
-
original_time = result
|
427
|
-
end
|
428
|
-
result
|
429
|
-
end
|
430
|
-
end
|
431
|
-
|
@@ -1,464 +0,0 @@
|
|
1
|
-
# = UploadUtils
|
2
|
-
#
|
3
|
-
# Upload files to host. These means of uploading are current
|
4
|
-
# supported: ftp, sftp, scp and rsync.
|
5
|
-
#
|
6
|
-
# user Username for host.
|
7
|
-
# host Host server's domain name.
|
8
|
-
# root Document root path on host.
|
9
|
-
# copy Directory of files to publish, or
|
10
|
-
# Files to publish using from and to.
|
11
|
-
#
|
12
|
-
# dryrun If true only pretend to upload.
|
13
|
-
# quiet Supress all output.
|
14
|
-
# verbose Provide extra details.
|
15
|
-
#
|
16
|
-
# The copy parameter allows you to simply specify a file
|
17
|
-
# or directory which will be published to host's document
|
18
|
-
# root location.
|
19
|
-
#
|
20
|
-
# If you need more control over which files to publish
|
21
|
-
# where, you can use the copy parameter instead. Provide
|
22
|
-
# an array of pattern strings in the form of "{from} {to}".
|
23
|
-
# If the desitination is the host's document root you do
|
24
|
-
# not need to specify the {to} part. For example:
|
25
|
-
#
|
26
|
-
# copy = [ 'web/*', 'doc/api/* doc/api' ]
|
27
|
-
#
|
28
|
-
# The first copies the files under your project's web directory
|
29
|
-
# to the host's document root. The second copies your projects
|
30
|
-
# doc/api files to the doc/api location on the host.
|
31
|
-
#
|
32
|
-
# The internal template used for the outbound destination
|
33
|
-
# is 'username@host:root/'.
|
34
|
-
#
|
35
|
-
# == AUTHORS
|
36
|
-
#
|
37
|
-
# * Thomas Sawyer
|
38
|
-
#
|
39
|
-
# == TODOs
|
40
|
-
#
|
41
|
-
# * Needs general improvements.
|
42
|
-
# * Reduce shelling-out.
|
43
|
-
# * Incorporate password into scp and ftp ?
|
44
|
-
# * rsync needs --delete option
|
45
|
-
#
|
46
|
-
# == COPYRIGHT
|
47
|
-
#
|
48
|
-
# Copyright (c) 2006 Thomas Sawyer
|
49
|
-
#
|
50
|
-
# == LICENSE
|
51
|
-
#
|
52
|
-
# Ruby License
|
53
|
-
#
|
54
|
-
# This module is free software. You may use, modify, and/or redistribute this
|
55
|
-
# software under the same terms as Ruby.
|
56
|
-
#
|
57
|
-
# This program is distributed in the hope that it will be useful, but WITHOUT
|
58
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
59
|
-
# FOR A PARTICULAR PURPOSE.
|
60
|
-
|
61
|
-
require 'openssl'
|
62
|
-
require 'shellwords'
|
63
|
-
require 'tmpdir'
|
64
|
-
require 'facets/openobject'
|
65
|
-
|
66
|
-
# = UploadUtils
|
67
|
-
#
|
68
|
-
# Upload files to host. These means of uploading are current
|
69
|
-
# supported: ftp, sftp, scp and rsync.
|
70
|
-
#
|
71
|
-
# user Username for host.
|
72
|
-
# host Host server's domain name.
|
73
|
-
# root Document root path on host.
|
74
|
-
# copy Directory of files to publish, or
|
75
|
-
# Files to publish using from and to.
|
76
|
-
#
|
77
|
-
# dryrun If true only pretend to upload.
|
78
|
-
# quiet Supress all output.
|
79
|
-
# verbose Provide extra details.
|
80
|
-
#
|
81
|
-
# The copy parameter allows you to simply specify a file
|
82
|
-
# or directory which will be published to host's document
|
83
|
-
# root location.
|
84
|
-
#
|
85
|
-
# If you need more control over which files to publish
|
86
|
-
# where, you can use the copy parameter instead. Provide
|
87
|
-
# an array of pattern strings in the form of "{from} {to}".
|
88
|
-
# If the desitination is the host's document root you do
|
89
|
-
# not need to specify the {to} part. For example:
|
90
|
-
#
|
91
|
-
# copy = [ 'web/*', 'doc/api/* doc/api' ]
|
92
|
-
#
|
93
|
-
# The first copies the files under your project's web directory
|
94
|
-
# to the host's document root. The second copies your projects
|
95
|
-
# doc/api files to the doc/api location on the host.
|
96
|
-
#
|
97
|
-
# The internal template used for the outbound destination
|
98
|
-
# is 'username@host:root/'.
|
99
|
-
|
100
|
-
module UploadUtils
|
101
|
-
|
102
|
-
module_function
|
103
|
-
|
104
|
-
#
|
105
|
-
# Upload via given protocol.
|
106
|
-
#
|
107
|
-
|
108
|
-
def upload( protocol, opts )
|
109
|
-
send(protocol.to_s.downcase,opts)
|
110
|
-
end
|
111
|
-
|
112
|
-
#
|
113
|
-
# Use ftp to upload files.
|
114
|
-
#
|
115
|
-
|
116
|
-
def ftp( keys )
|
117
|
-
keys = upload_parameters(keys)
|
118
|
-
|
119
|
-
# set transfer rules
|
120
|
-
if keys.stage
|
121
|
-
trans = stage_transfer(keys.stage)
|
122
|
-
else
|
123
|
-
files(keys.dir, keys.copy).each do |from|
|
124
|
-
trans << [from,from]
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
# append location of publication dir to from
|
129
|
-
dir = keys.dir
|
130
|
-
trans.collect!{ |from,to| [File.join(dir,from), to] }
|
131
|
-
|
132
|
-
if keys.dryrun
|
133
|
-
puts "ftp open #{keys.user}@#{keys.host}:#{keys.root}/"
|
134
|
-
keys.trans.each do |f, t|
|
135
|
-
puts "ftp put #{f} #{t}"
|
136
|
-
end
|
137
|
-
else
|
138
|
-
require 'net/ftp'
|
139
|
-
Net::FTP.open(keys.host) do |ftp|
|
140
|
-
ftp.login(keys.user) #password?
|
141
|
-
ftp.chdir(keys.root)
|
142
|
-
keys.trans.each do |f, t|
|
143
|
-
puts "ftp #{f} #{t}" unless keys.quiet
|
144
|
-
ftp.putbinaryfile( f, t, 1024 )
|
145
|
-
end
|
146
|
-
end
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
#
|
151
|
-
# Use sftp to upload files.
|
152
|
-
#
|
153
|
-
|
154
|
-
def sftp( keys )
|
155
|
-
keys = upload_parameters(keys)
|
156
|
-
|
157
|
-
# set transfer rules
|
158
|
-
if keys.stage
|
159
|
-
trans = stage_transfer(keys.stage)
|
160
|
-
else
|
161
|
-
files(keys.dir, keys.copy).each do |from|
|
162
|
-
trans << [from,from]
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
# append location of publication dir to from
|
167
|
-
dir = keys.dir
|
168
|
-
trans.collect!{ |from,to| [File.join(dir,from), to] }
|
169
|
-
|
170
|
-
if keys.dryrun
|
171
|
-
puts "sftp open #{keys.user}@#{keys.host}:#{keys.root}/"
|
172
|
-
keys.trans.each do |f,t|
|
173
|
-
puts "sftp put #{f} #{t}"
|
174
|
-
end
|
175
|
-
else
|
176
|
-
require 'net/sftp'
|
177
|
-
Net::SFTP.start(keys.host, keys.user, keys.pass) do |sftp|
|
178
|
-
#sftp.login( user )
|
179
|
-
sftp.chdir(keys.root)
|
180
|
-
keys.trans.each do |f,t|
|
181
|
-
puts "sftp #{f} #{t}" unless keys.quiet
|
182
|
-
sftp.put_file(f,t) #, 1024 )
|
183
|
-
end
|
184
|
-
end
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
|
-
#
|
189
|
-
# Use rsync to upload files.
|
190
|
-
#
|
191
|
-
|
192
|
-
def rsync( keys )
|
193
|
-
keys = upload_parameters(keys)
|
194
|
-
|
195
|
-
flags = []
|
196
|
-
flags << "-n" if keys.dryrun
|
197
|
-
flags << "-q" if keys.quiet
|
198
|
-
flags << "-v" if keys.verbose
|
199
|
-
flags << "--progress" unless keys.quiet
|
200
|
-
flags = flags.join(' ').strip
|
201
|
-
flags = ' ' + flags unless flags.empty?
|
202
|
-
|
203
|
-
manfile = 'Publish.txt'
|
204
|
-
|
205
|
-
if keys.stage
|
206
|
-
dir = stage_linkdir(keys.dir, keys.stage)
|
207
|
-
Dir.chdir(dir) do
|
208
|
-
cpy = files(keys.copy)
|
209
|
-
end
|
210
|
-
manifest = File.join(dir,manfile)
|
211
|
-
cmd = %{rsync#{flags} -L -arz --files-from='#{manifest}' #{dir} #{keys.user}@#{keys.host}:/#{keys.root}}
|
212
|
-
else
|
213
|
-
dir = keys.dir
|
214
|
-
cpy = files(dir, keys.copy)
|
215
|
-
manifest = File.join(dir,manfile)
|
216
|
-
cmd = %{rsync#{flags} -arz --files-from='#{manifest}' #{dir} #{keys.user}@#{keys.host}:/#{keys.root}}
|
217
|
-
end
|
218
|
-
|
219
|
-
#Dir.chdir(keys.dir) do
|
220
|
-
begin
|
221
|
-
File.open(manifest, 'w'){ |f| f << cpy.join("\n") }
|
222
|
-
ENV['RSYNC_PASSWORD'] = keys.pass if keys.pass
|
223
|
-
puts cmd unless keys.quiet
|
224
|
-
system cmd
|
225
|
-
ensure
|
226
|
-
ENV.delete('RSYNC_PASSWORD') if keys.pass
|
227
|
-
end
|
228
|
-
#end
|
229
|
-
|
230
|
-
end
|
231
|
-
|
232
|
-
# private (can't do b/c of module_function)
|
233
|
-
|
234
|
-
# parse publishing options.
|
235
|
-
|
236
|
-
def upload_parameters( keys )
|
237
|
-
keys = OpenObject.new(keys)
|
238
|
-
|
239
|
-
keys.copy = keys.copy || '**/*'
|
240
|
-
keys.host = keys.host || keys.domain
|
241
|
-
keys.user = keys.user || keys.username
|
242
|
-
keys.root = keys.root || '/'
|
243
|
-
#keys.pass = keys.pass || keys.password
|
244
|
-
|
245
|
-
# validate
|
246
|
-
raise ArgumentError, "missing publish parameter -- dir" unless keys.dir
|
247
|
-
raise ArgumentError, "missing publish parameter -- host" unless keys.host
|
248
|
-
raise ArgumentError, "missing publish parameter -- user" unless keys.user
|
249
|
-
#raise ArgumentError, "missing publish parameter -- copy" unless keys.copy
|
250
|
-
#raise ArgumentError, "missing publish parameter -- root" unless keys.root
|
251
|
-
|
252
|
-
keys.root = '' if keys.root.nil?
|
253
|
-
keys.root.sub!(/^\//,'')
|
254
|
-
|
255
|
-
if String===keys.copy and File.directory?(keys.copy)
|
256
|
-
copy = File.join(keys.copy, '*')
|
257
|
-
end
|
258
|
-
keys.copy = [keys.copy].flatten.compact
|
259
|
-
|
260
|
-
# trans = []
|
261
|
-
# keys.copy.each do |from|
|
262
|
-
# #from, to = *Shellwords.shellwords(c)
|
263
|
-
# #to = from if to.nil?
|
264
|
-
# #to = to[1..-1] if to[0,1] == '/'
|
265
|
-
# from.sub('*','**/*') unless from =~ /\*\*/
|
266
|
-
# files = Dir.glob(from)
|
267
|
-
# files.each do |f|
|
268
|
-
# #t = File.join(to,File.basename(f))
|
269
|
-
# #t = t[1..-1] if t[0,1] == '/'
|
270
|
-
# trans << [f,f]
|
271
|
-
# end
|
272
|
-
# end
|
273
|
-
# keys.trans = trans
|
274
|
-
|
275
|
-
return keys
|
276
|
-
end
|
277
|
-
|
278
|
-
# Put together the list of files to copy.
|
279
|
-
|
280
|
-
def files( dir, copy )
|
281
|
-
Dir.chdir(dir) do
|
282
|
-
del, add = copy.partition{ |f| /^[-]/ =~ f }
|
283
|
-
|
284
|
-
# remove - and + prefixes
|
285
|
-
del.collect!{ |f| f.sub(/^[-]/,'') }
|
286
|
-
add.collect!{ |f| f.sub(/^[+]/,'') }
|
287
|
-
|
288
|
-
#del.concat(must_exclude)
|
289
|
-
|
290
|
-
files = []
|
291
|
-
add.each{ |g| files += Dir.multiglob(g) }
|
292
|
-
del.each{ |g| files -= Dir.multiglob(g) }
|
293
|
-
|
294
|
-
files.collect!{ |f| f.sub(/^\//,'') }
|
295
|
-
|
296
|
-
return files
|
297
|
-
end
|
298
|
-
end
|
299
|
-
|
300
|
-
# Combine three part stage list into a two part from->to list.
|
301
|
-
#
|
302
|
-
# Using the stage list of three space separated fields.
|
303
|
-
#
|
304
|
-
# fromdir file todir
|
305
|
-
#
|
306
|
-
# This is used to generate a from -> to list of the form:
|
307
|
-
#
|
308
|
-
# fromdir/file todir/file
|
309
|
-
#
|
310
|
-
|
311
|
-
def stage_transfer( list )
|
312
|
-
trans = []
|
313
|
-
list.each do |line|
|
314
|
-
trans << Shellwords.shellwords(line)
|
315
|
-
end
|
316
|
-
|
317
|
-
trans.collect! do |from, base, to|
|
318
|
-
file = File.join(from,base)
|
319
|
-
to = File.join(to,base)
|
320
|
-
[from, to]
|
321
|
-
end
|
322
|
-
end
|
323
|
-
|
324
|
-
# When using stage options this will create temporary linked location.
|
325
|
-
|
326
|
-
def stage_linkdir( dir, list )
|
327
|
-
folder = File.join(Dir.tmpdir, 'ratchets', 'project', object_id.abs.to_s)
|
328
|
-
FileUtils.mkdir_p(folder)
|
329
|
-
|
330
|
-
Dir.chdir(dir) do
|
331
|
-
stage_transfer(list).each do |file, to|
|
332
|
-
link = File.join(folder,to)
|
333
|
-
FileUtils.ln_s(link,file)
|
334
|
-
end
|
335
|
-
end
|
336
|
-
|
337
|
-
return folder
|
338
|
-
end
|
339
|
-
|
340
|
-
|
341
|
-
=begin
|
342
|
-
|
343
|
-
|
344
|
-
#--
|
345
|
-
# SHELLS OUT! Need net/scp library to fix.
|
346
|
-
#++
|
347
|
-
|
348
|
-
# Use scp to upload files.
|
349
|
-
|
350
|
-
def scp( keys )
|
351
|
-
keys = upload_parameters(keys)
|
352
|
-
|
353
|
-
flags = []
|
354
|
-
flags << "-v" if keys.verbose
|
355
|
-
flags << "-q" if keys.quiet
|
356
|
-
flags = flags.join(' ').strip
|
357
|
-
flags = ' ' + flags unless flags.empty?
|
358
|
-
|
359
|
-
upload_stage(keys) do #|tmpdir|
|
360
|
-
cmd = "scp -r#{flags} * #{keys.user}@#{keys.host}:/#{keys.root}"
|
361
|
-
puts cmd unless keys.quiet
|
362
|
-
system cmd unless keys.dryrun
|
363
|
-
end
|
364
|
-
end
|
365
|
-
|
366
|
-
# Use rsync to upload files.
|
367
|
-
|
368
|
-
def rsync( keys )
|
369
|
-
keys = upload_parameters(keys)
|
370
|
-
|
371
|
-
flags = []
|
372
|
-
flags << "-n" if keys.dryrun
|
373
|
-
flags << "-v" if keys.verbose
|
374
|
-
flags << "-q" if keys.quiet
|
375
|
-
flags = flags.join(' ').strip
|
376
|
-
flags = ' ' + flags unless flags.empty?
|
377
|
-
|
378
|
-
upload_stage(keys) do #|tmpdir|
|
379
|
-
begin
|
380
|
-
ENV['RSYNC_PASSWORD'] = keys.pass if keys.pass
|
381
|
-
cmd = "rsync -R#{flags} -arz * #{keys.user}@#{keys.host} /#{keys.root}"
|
382
|
-
ensure
|
383
|
-
ENV.delete('RSYNC_PASSWORD') if keys.pass
|
384
|
-
end
|
385
|
-
end
|
386
|
-
end
|
387
|
-
|
388
|
-
# Use ftp to upload files.
|
389
|
-
|
390
|
-
def ftp( keys )
|
391
|
-
keys = upload_parameters(keys)
|
392
|
-
|
393
|
-
if keys.dryrun
|
394
|
-
puts "ftp open #{keys.user}@#{keys.host}:#{keys.root}/"
|
395
|
-
keys.trans.each do |f, t|
|
396
|
-
puts "ftp put #{f} #{t}"
|
397
|
-
end
|
398
|
-
else
|
399
|
-
require 'net/ftp'
|
400
|
-
Net::FTP.open(keys.host) do |ftp|
|
401
|
-
ftp.login(keys.user) #password?
|
402
|
-
ftp.chdir(keys.root)
|
403
|
-
keys.trans.each do |f, t|
|
404
|
-
puts "ftp #{f} #{t}" unless keys.quiet
|
405
|
-
ftp.putbinaryfile( f, t, 1024 )
|
406
|
-
end
|
407
|
-
end
|
408
|
-
end
|
409
|
-
end
|
410
|
-
|
411
|
-
# Use sftp to upload files.
|
412
|
-
|
413
|
-
def sftp( keys )
|
414
|
-
keys = upload_parameters(keys)
|
415
|
-
|
416
|
-
if keys.dryrun
|
417
|
-
puts "sftp open #{keys.user}@#{keys.host}:#{keys.root}/"
|
418
|
-
keys.trans.each do |f,t|
|
419
|
-
puts "sftp put #{f} #{t}"
|
420
|
-
end
|
421
|
-
else
|
422
|
-
require 'net/sftp'
|
423
|
-
Net::SFTP.start(keys.host, keys.user, keys.pass) do |sftp|
|
424
|
-
#sftp.login( user )
|
425
|
-
sftp.chdir(keys.root)
|
426
|
-
keys.trans.each do |f,t|
|
427
|
-
puts "sftp #{f} #{t}" unless keys.quiet
|
428
|
-
sftp.put_file(f,t) #, 1024 )
|
429
|
-
end
|
430
|
-
end
|
431
|
-
end
|
432
|
-
end
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
# Creates a stage from which the whole directory can be uploaded.
|
437
|
-
# This is needed for scp and rsync which have to shelled out,
|
438
|
-
# and can't conveniently copy one file at a time.
|
439
|
-
|
440
|
-
def upload_stage(keys) #:yield:
|
441
|
-
tmp = "scp_#{object_id.abs}_#{ Time.now.strftime("%Y%m%d%H%M%S")}"
|
442
|
-
tmpdir = File.join(Dir.tmpdir,tmp)
|
443
|
-
|
444
|
-
puts "mkdir -p #{tmpdir}" unless keys.quiet
|
445
|
-
FileUtils.mkdir_p(tmpdir) # go ahead and do this even if dryrun
|
446
|
-
|
447
|
-
fu = keys.dryrun ? FileUtils::DryRun : FileUtils
|
448
|
-
keys.trans.each do |f, t|
|
449
|
-
to = File.join(tmpdir, t)
|
450
|
-
fu.mv(f,to)
|
451
|
-
end
|
452
|
-
|
453
|
-
puts "cd #{tmpdir}" unless keys.quiet
|
454
|
-
Dir.chdir(tmpdir) do
|
455
|
-
yield #(tmpdir)
|
456
|
-
end
|
457
|
-
|
458
|
-
puts "rm -r #{tmpdir}" unless keys.quiet
|
459
|
-
FileUtils.rm_r(tmpdir) # now remove the temp dir
|
460
|
-
end
|
461
|
-
|
462
|
-
=end
|
463
|
-
|
464
|
-
end
|