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/bytes.rb
DELETED
@@ -1,175 +0,0 @@
|
|
1
|
-
warn "use rich_units for future version"
|
2
|
-
|
3
|
-
# = Bytes
|
4
|
-
#
|
5
|
-
# WARNING: Use Rich Units package for future compatibilty!
|
6
|
-
#
|
7
|
-
# == Synopisis
|
8
|
-
#
|
9
|
-
# Additional methods for Numeric class to make working with
|
10
|
-
# bits and bytes easier.
|
11
|
-
#
|
12
|
-
# Additional methods for Numeric class to make working with
|
13
|
-
# bits and bytes easier. Bits are used as the base value and
|
14
|
-
# these methods can be used to convert between different
|
15
|
-
# magnitudes.
|
16
|
-
#
|
17
|
-
# 1.byte #=> 8
|
18
|
-
# 2.bytes #=> 16
|
19
|
-
# 1.kilobit #=> 1024
|
20
|
-
# 1.kilobyte #=> 8192
|
21
|
-
#
|
22
|
-
# Use the in_* methods to perform the inverse operations.
|
23
|
-
#
|
24
|
-
# 8192.in_kilobytes #=> 1
|
25
|
-
# 1024.in_kilobits #=> 1
|
26
|
-
#
|
27
|
-
# == History
|
28
|
-
#
|
29
|
-
# Special thanks to Richard Kilmer for the orignal work.
|
30
|
-
# This library is based on the original library bytes.rb
|
31
|
-
# Copyright (c) 2004 by Rich Kilmer.
|
32
|
-
#
|
33
|
-
# Also thanks to Alexander Kellett for suggesting it be
|
34
|
-
# included in Facets.
|
35
|
-
#
|
36
|
-
# == Authors
|
37
|
-
#
|
38
|
-
# * Rich Kilmer
|
39
|
-
# * Thomas Sawyer
|
40
|
-
#
|
41
|
-
# == NOTES
|
42
|
-
#
|
43
|
-
# This library is not compatible with STICK's units.rb (an spin-off
|
44
|
-
# of Facets old units.rb library). Do not attempt to use both at the same time.
|
45
|
-
#
|
46
|
-
# == Todo
|
47
|
-
#
|
48
|
-
# * Currently kilo, mega, etc. are all powers of two and not ten,
|
49
|
-
# which technically isn't corrent even though it is common usage.
|
50
|
-
# * The in_* notation is weak. If a better nomentclature is thought
|
51
|
-
# of then consider changing this.
|
52
|
-
#
|
53
|
-
# == Copying
|
54
|
-
#
|
55
|
-
# Copyright (c) 2005 Rich Kilmer
|
56
|
-
#
|
57
|
-
# Ruby License
|
58
|
-
#
|
59
|
-
# This module is free software. You may use, modify, and/or redistribute this
|
60
|
-
# software under the same terms as Ruby.
|
61
|
-
#
|
62
|
-
# This program is distributed in the hope that it will be useful, but WITHOUT
|
63
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
64
|
-
# FOR A PARTICULAR PURPOSE.
|
65
|
-
|
66
|
-
|
67
|
-
# = Bytes
|
68
|
-
#
|
69
|
-
# Additional methods for Numeric class to make working with
|
70
|
-
# bits and bytes easier. Bits are used as the base value and
|
71
|
-
# these methods can be used to convert between different
|
72
|
-
# magnitudes.
|
73
|
-
#
|
74
|
-
# 1.byte #=> 8
|
75
|
-
# 2.bytes #=> 16
|
76
|
-
# 1.kilobit #=> 1024
|
77
|
-
# 1.kilobyte #=> 8192
|
78
|
-
#
|
79
|
-
# Use the in_* methods to perform the inverse operations.
|
80
|
-
#
|
81
|
-
# 8192.in_kilobytes #=> 1
|
82
|
-
# 1024.in_kilobits #=> 1
|
83
|
-
#
|
84
|
-
class Numeric
|
85
|
-
|
86
|
-
def bit ; self ; end
|
87
|
-
def bits ; self ; end
|
88
|
-
def byte ; self * 8 ; end
|
89
|
-
def bytes ; self * 8 ; end
|
90
|
-
|
91
|
-
[ 'kilo', 'mega', 'giga', 'tera', 'peta', 'exa' ].each_with_index do |m, i|
|
92
|
-
j = i + 1
|
93
|
-
class_eval %{
|
94
|
-
def #{m}bit ; self * #{1024**j} ; end
|
95
|
-
def #{m}byte ; self * #{1024**j*8} ; end
|
96
|
-
def in_#{m}bits ; self / #{1024**j} ; end
|
97
|
-
def in_#{m}bytes ; self / #{1024**j*8} ; end
|
98
|
-
alias_method :#{m}bits, :#{m}bit
|
99
|
-
alias_method :#{m}bytes, :#{m}byte
|
100
|
-
}
|
101
|
-
end
|
102
|
-
|
103
|
-
[ 'kibi', 'mebi', 'gibi', 'tebi', 'pebi', 'exbi' ].each_with_index do |m, i|
|
104
|
-
j = i + 1
|
105
|
-
class_eval %{
|
106
|
-
def #{m}bit ; self * #{1024**j} ; end
|
107
|
-
def #{m}byte ; self * #{1024**j*8} ; end
|
108
|
-
def in_#{m}bits ; self / #{1024**j} ; end
|
109
|
-
def in_#{m}bytes ; self / #{1024**j*8} ; end
|
110
|
-
alias_method :#{m}bits, :#{m}bit
|
111
|
-
alias_method :#{m}bytes, :#{m}byte
|
112
|
-
}
|
113
|
-
end
|
114
|
-
|
115
|
-
# Formated string of bits proportial to size.
|
116
|
-
#
|
117
|
-
# 1024.bits_to_s #=> "1.00 kb"
|
118
|
-
# 1048576.bits_to_s #=> "1.00 mb"
|
119
|
-
# 1073741824.bits_to_s #=> "1.00 gb"
|
120
|
-
# 1099511627776.bits_to_s #=> "1.00 tb"
|
121
|
-
#
|
122
|
-
# Takes a format string to adjust output.
|
123
|
-
#
|
124
|
-
# 1024.bits_to_s('%.0f') #=> "1 kb"
|
125
|
-
#
|
126
|
-
def strfbits(fmt='%.2f')
|
127
|
-
case
|
128
|
-
when self < 1024
|
129
|
-
"#{self} bits"
|
130
|
-
when self < 1024**2
|
131
|
-
"#{fmt % (self.to_f / 1024)} kb"
|
132
|
-
when self < 1024**3
|
133
|
-
"#{fmt % (self.to_f / 1024**2)} mb"
|
134
|
-
when self < 1024**4
|
135
|
-
"#{fmt % (self.to_f / 1024**3)} gb"
|
136
|
-
when self < 1024**5
|
137
|
-
"#{fmt % (self.to_f / 1024**4)} tb"
|
138
|
-
else
|
139
|
-
"#{self} bits"
|
140
|
-
end
|
141
|
-
end
|
142
|
-
|
143
|
-
# Formated string of bytes proportial to size.
|
144
|
-
#
|
145
|
-
# 1024.bytes_to_s #=> "1.00 KB"
|
146
|
-
# 1048576.bytes_to_s #=> "1.00 MB"
|
147
|
-
# 1073741824.bytes_to_s #=> "1.00 GB"
|
148
|
-
# 1099511627776.bytes_to_s #=> "1.00 TB"
|
149
|
-
#
|
150
|
-
# Takes a format string to adjust output.
|
151
|
-
#
|
152
|
-
# 1024.bytes_to_s('%.0f') #=> "1 KB"
|
153
|
-
#
|
154
|
-
def strfbytes(fmt='%.2f')
|
155
|
-
case
|
156
|
-
when self < 1024
|
157
|
-
"#{self} bytes"
|
158
|
-
when self < 1024**2
|
159
|
-
"#{fmt % (self.to_f / 1024)} KB"
|
160
|
-
when self < 1024**3
|
161
|
-
"#{fmt % (self.to_f / 1024**2)} MB"
|
162
|
-
when self < 1024**4
|
163
|
-
"#{fmt % (self.to_f / 1024**3)} GB"
|
164
|
-
when self < 1024**5
|
165
|
-
"#{fmt % (self.to_f / 1024**4)} TB"
|
166
|
-
else
|
167
|
-
"#{self} bytes"
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
|
-
# deprecated
|
172
|
-
alias_method :octet_units, :strfbytes
|
173
|
-
|
174
|
-
end
|
175
|
-
|
@@ -1,117 +0,0 @@
|
|
1
|
-
# = CacheDecorator
|
2
|
-
#
|
3
|
-
# == Synopsis
|
4
|
-
#
|
5
|
-
# CacheDecorator wrap objects to provide cached versions of method calls.
|
6
|
-
#
|
7
|
-
# class X
|
8
|
-
# def initialize ; @tick = 0 ; end
|
9
|
-
# def tick; @tick + 1; end
|
10
|
-
# def cached; @cache ||= CacheDecorator.new(self) ; end
|
11
|
-
# end
|
12
|
-
#
|
13
|
-
# x = X.new
|
14
|
-
# x.tick #=> 1
|
15
|
-
# x.cached.tick #=> 2
|
16
|
-
# x.tick #=> 3
|
17
|
-
# x.cached.tick #=> 2
|
18
|
-
# x.tick #=> 4
|
19
|
-
# x.cached.tick #=> 2
|
20
|
-
#
|
21
|
-
# You can also use to cache a collections of objects to gain code
|
22
|
-
# speed ups.
|
23
|
-
#
|
24
|
-
# points = points.collect{|point| Cache.cache(point)}
|
25
|
-
#
|
26
|
-
# After our algorithm has finished using points, we want to get rid of
|
27
|
-
# these Cache objects. That's easy:
|
28
|
-
#
|
29
|
-
# points = points.collect{|point| point.self }
|
30
|
-
#
|
31
|
-
# Or if you prefer (it is ever so slightly safer):
|
32
|
-
#
|
33
|
-
# points = points.collect{|point| Cache.uncache(point)}
|
34
|
-
#
|
35
|
-
# == Authors
|
36
|
-
#
|
37
|
-
# * Erik Veenstra
|
38
|
-
# * Thomas Sawyer
|
39
|
-
#
|
40
|
-
# == Copying
|
41
|
-
#
|
42
|
-
# Copyright (c) 2006 Erik Veenstra
|
43
|
-
#
|
44
|
-
# Ruby License
|
45
|
-
#
|
46
|
-
# This module is free software. You may use, modify, and/or redistribute this
|
47
|
-
# software under the same terms as Ruby.
|
48
|
-
#
|
49
|
-
# This program is distributed in the hope that it will be useful, but WITHOUT
|
50
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
51
|
-
# FOR A PARTICULAR PURPOSE.
|
52
|
-
|
53
|
-
# = CacheDecorator
|
54
|
-
#
|
55
|
-
# CacheDecorator wrap objects to provide cached versions of method calls.
|
56
|
-
#
|
57
|
-
# == Usage
|
58
|
-
#
|
59
|
-
# class X
|
60
|
-
# def initialize ; @tick = 0 ; end
|
61
|
-
# def tick; @tick + 1; end
|
62
|
-
# def cached; @cache ||= CacheDecorator.new(self) ; end
|
63
|
-
# end
|
64
|
-
#
|
65
|
-
# x = X.new
|
66
|
-
# x.tick #=> 1
|
67
|
-
# x.cached.tick #=> 2
|
68
|
-
# x.tick #=> 3
|
69
|
-
# x.cached.tick #=> 2
|
70
|
-
# x.tick #=> 4
|
71
|
-
# x.cached.tick #=> 2
|
72
|
-
#
|
73
|
-
# You can also use to cache a collections of objects to gain code
|
74
|
-
# speed ups.
|
75
|
-
#
|
76
|
-
# points = points.collect{|point| Cache.cache(point)}
|
77
|
-
#
|
78
|
-
# After our algorithm has finished using points, we want to get rid of
|
79
|
-
# these Cache objects. That's easy:
|
80
|
-
#
|
81
|
-
# points = points.collect{|point| point.self }
|
82
|
-
#
|
83
|
-
# Or if you prefer (it is ever so slightly safer):
|
84
|
-
#
|
85
|
-
# points = points.collect{|point| Cache.uncache(point)}
|
86
|
-
#
|
87
|
-
class CacheDecorator
|
88
|
-
|
89
|
-
#private :class, :clone, :display, :type, :method, :to_a, :to_s
|
90
|
-
private *instance_methods(true).select{ |m| m.to_s !~ /^__/ }
|
91
|
-
|
92
|
-
def initialize(object)
|
93
|
-
@self = object
|
94
|
-
@cache = {}
|
95
|
-
end
|
96
|
-
|
97
|
-
def method_missing(method_name, *args, &block)
|
98
|
-
# Not thread-safe! Speed is important in caches... ;]
|
99
|
-
@cache[[method_name, args, block]] ||= @self.__send__(method_name, *args, &block)
|
100
|
-
end
|
101
|
-
|
102
|
-
def self; @self; end
|
103
|
-
|
104
|
-
def self.cache(object)
|
105
|
-
Cache.new(object)
|
106
|
-
end
|
107
|
-
|
108
|
-
def self.uncache(cached_object)
|
109
|
-
cached_object.self
|
110
|
-
end
|
111
|
-
|
112
|
-
end
|
113
|
-
|
114
|
-
# These are for backward compatibility (to be DEPRECATED)
|
115
|
-
Cache = CacheDecorator
|
116
|
-
CacheDelegator = Cache
|
117
|
-
|
data/lib/more/facets/chain.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
# = Chain
|
2
|
-
#
|
3
|
-
# Expiremental library for safe method chaining.
|
4
|
-
#
|
5
|
-
# person = "John Doe"
|
6
|
-
# def person.address = "123 West St."
|
7
|
-
# person.address.street #=> Error
|
8
|
-
#
|
9
|
-
# To avoid the error use #chain:
|
10
|
-
#
|
11
|
-
# person.chain.address.street.end #=> nil
|
12
|
-
#
|
13
|
-
# Or
|
14
|
-
#
|
15
|
-
# ~ person.chain.address.street #=> nil
|
16
|
-
#
|
17
|
-
class Chain
|
18
|
-
|
19
|
-
private *instance_methods.select{|m| m !~ /^__/ }
|
20
|
-
|
21
|
-
def initialize(value)
|
22
|
-
@value = value
|
23
|
-
end
|
24
|
-
|
25
|
-
def method_missing(s,*a, &b)
|
26
|
-
if @value.respond_to?(s)
|
27
|
-
@value = @value.__send__(s,*a,&b)
|
28
|
-
else
|
29
|
-
@missing = true
|
30
|
-
end
|
31
|
-
#begin
|
32
|
-
# @value = @value.__send__(s,*a,&b)
|
33
|
-
#rescue NoMethodError
|
34
|
-
# @missing = true
|
35
|
-
#end
|
36
|
-
self
|
37
|
-
end
|
38
|
-
|
39
|
-
#def value?
|
40
|
-
# @value
|
41
|
-
#end
|
42
|
-
|
43
|
-
def end
|
44
|
-
@missing ? nil : @value
|
45
|
-
end
|
46
|
-
|
47
|
-
def ~@
|
48
|
-
@missing ? nil : @value
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
module Kernel
|
54
|
-
def chain
|
55
|
-
Chain.new(self)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
data/lib/more/facets/command.rb
DELETED
@@ -1,439 +0,0 @@
|
|
1
|
-
# == CLI::Command
|
2
|
-
#
|
3
|
-
# Here is an example of usage:
|
4
|
-
#
|
5
|
-
# # General Options
|
6
|
-
#
|
7
|
-
# module GeneralOptions
|
8
|
-
# attr_accessor :dryrun ; alias_accessor :n, :noharm, :dryrun
|
9
|
-
# attr_accessor :quiet ; alias_accessor :q, :quiet
|
10
|
-
# attr_accessor :force
|
11
|
-
# attr_accessor :trace
|
12
|
-
# end
|
13
|
-
#
|
14
|
-
# # Build Subcommand
|
15
|
-
#
|
16
|
-
# class BuildCommand < CLI::Command
|
17
|
-
# include GeneralOptions
|
18
|
-
#
|
19
|
-
# # metadata files
|
20
|
-
# attr_accessor :file ; alias_accessor :f, :file
|
21
|
-
# attr_accessor :manifest ; alias_accessor :m, :manifest
|
22
|
-
#
|
23
|
-
# def call
|
24
|
-
# # do stuf here
|
25
|
-
# end
|
26
|
-
# end
|
27
|
-
#
|
28
|
-
# # Box Master Command
|
29
|
-
#
|
30
|
-
# class BoxCommand < CLI::Command
|
31
|
-
# subcommand :build, BuildCommand
|
32
|
-
# end
|
33
|
-
#
|
34
|
-
# BoxCommand.start
|
35
|
-
#
|
36
|
-
# == Authors
|
37
|
-
#
|
38
|
-
# * Trans
|
39
|
-
#
|
40
|
-
# == Todo
|
41
|
-
#
|
42
|
-
# * Move helpers into core.
|
43
|
-
# * Add global options to master command, or "all are master options" flag (?)
|
44
|
-
# * Add usage/help/documentation/man features (?)
|
45
|
-
#
|
46
|
-
# == Copying
|
47
|
-
#
|
48
|
-
# Copyright (c) 2005,2008 Thomas Sawyer
|
49
|
-
#
|
50
|
-
# Ruby License
|
51
|
-
#
|
52
|
-
# This module is free software. You may use, modify, and/or
|
53
|
-
# redistribute this software under the same terms as Ruby.
|
54
|
-
#
|
55
|
-
# This program is distributed in the hope that it will be
|
56
|
-
# useful, but WITHOUT ANY WARRANTY; without even the implied
|
57
|
-
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
58
|
-
# PURPOSE.
|
59
|
-
|
60
|
-
warn "command.rb will be deprecated, use clio instead (clio.rubyforge.org)"
|
61
|
-
|
62
|
-
require 'facets/arguments'
|
63
|
-
require 'facets/consoleutils'
|
64
|
-
require 'facets/array/not_empty'
|
65
|
-
|
66
|
-
module CLI
|
67
|
-
|
68
|
-
# For CommandOptions, but defined external to it, so
|
69
|
-
# that it is easy to access from user defined commands.
|
70
|
-
# (This lookup issue should be fixed in Ruby 1.9+, and then
|
71
|
-
# the class can be moved back into Command namespace.)
|
72
|
-
|
73
|
-
class NoOptionError < NoMethodError
|
74
|
-
def initialize(name, *arg)
|
75
|
-
super("unknown option -- #{name}", name, *args)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
class NoCommandError < NoMethodError
|
80
|
-
def initialize(name, *arg)
|
81
|
-
super("unknown subcommand -- #{name}", name, *args)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
# Here is an example of usage:
|
86
|
-
#
|
87
|
-
# # General Options
|
88
|
-
#
|
89
|
-
# module GeneralOptions
|
90
|
-
# attr_writer :dryrun ; alias_writer :n, :noharm, :dryrun
|
91
|
-
# attr_writer :quiet ; alias_writer :q, :quiet
|
92
|
-
# attr_writer :force
|
93
|
-
# attr_writer :trace
|
94
|
-
# end
|
95
|
-
#
|
96
|
-
# # Build Subcommand
|
97
|
-
#
|
98
|
-
# class BuildCommand < Command
|
99
|
-
# include GeneralOptions
|
100
|
-
#
|
101
|
-
# # metadata files
|
102
|
-
# attr_writer :file ; alias_writer :f, :file
|
103
|
-
# attr_writer :manifest ; alias_writer :m, :manifest
|
104
|
-
#
|
105
|
-
# def call
|
106
|
-
# # do stuf here
|
107
|
-
# end
|
108
|
-
# end
|
109
|
-
#
|
110
|
-
# # Box Master Command
|
111
|
-
#
|
112
|
-
# class BoxCommand < CLI::Command
|
113
|
-
# subcommand :build, BuildCommand
|
114
|
-
# end
|
115
|
-
#
|
116
|
-
# BoxCommand.start
|
117
|
-
|
118
|
-
class Command
|
119
|
-
|
120
|
-
# Include this in your dispatch command if you want
|
121
|
-
# all options to be traeted the same.
|
122
|
-
|
123
|
-
module UniversalOptions
|
124
|
-
end
|
125
|
-
|
126
|
-
#
|
127
|
-
|
128
|
-
def self.option_arity(arity_hash=nil)
|
129
|
-
@option_arity ||= {}
|
130
|
-
if arity_hash
|
131
|
-
@option_arity.merge!(arity_hash)
|
132
|
-
end
|
133
|
-
@option_arity
|
134
|
-
end
|
135
|
-
|
136
|
-
#
|
137
|
-
|
138
|
-
def self.start(line=nil)
|
139
|
-
cargs = Arguments.new(line || ARGV, option_arity)
|
140
|
-
pre = cargs.preoptions
|
141
|
-
|
142
|
-
if instance_method(:call).arity == 0 #is_a?(SingleCommand)
|
143
|
-
args, opts = *cargs.parameters
|
144
|
-
new(args, opts).call
|
145
|
-
else
|
146
|
-
subc, args, opts = *cargs.subcommand
|
147
|
-
if self < UniversalOptions
|
148
|
-
new(pre, opts).call(subc, args, opts)
|
149
|
-
else
|
150
|
-
new(pre).call(subc, args, opts)
|
151
|
-
end
|
152
|
-
end
|
153
|
-
end
|
154
|
-
|
155
|
-
# Command Arguments (for single commands).
|
156
|
-
|
157
|
-
attr :arguments
|
158
|
-
|
159
|
-
# Command options. For dispatch commands these are the pre-options.
|
160
|
-
|
161
|
-
attr :options
|
162
|
-
|
163
|
-
# For dispatchers, this is a convenience method for creating subcommands.
|
164
|
-
|
165
|
-
def self.subcommand(name, command_class, options=nil)
|
166
|
-
options ||= {}
|
167
|
-
if options[:no_merge]
|
168
|
-
file, line = __FILE__, __LINE__+1
|
169
|
-
code = %{
|
170
|
-
def #{name}(args, opts)
|
171
|
-
#{command_class}.new(args, opts).call
|
172
|
-
end
|
173
|
-
}
|
174
|
-
else
|
175
|
-
file, line = __FILE__, __LINE__+1
|
176
|
-
code = %{
|
177
|
-
def #{name}(args, opts)
|
178
|
-
opts.merge(options)
|
179
|
-
#{command_class}.new(args, opts).call
|
180
|
-
end
|
181
|
-
}
|
182
|
-
end
|
183
|
-
class_eval(code, file, line)
|
184
|
-
end
|
185
|
-
|
186
|
-
private
|
187
|
-
|
188
|
-
#
|
189
|
-
|
190
|
-
def initialize(*args)
|
191
|
-
@arguments = []
|
192
|
-
@options = {}
|
193
|
-
|
194
|
-
opts, args = *args.partition{ |e| Hash===e }
|
195
|
-
#TEST("options should all be hashes"){ ! opts.all?{ |e| Hash===e }
|
196
|
-
initialize_arguments(*args)
|
197
|
-
initialize_options(*opts)
|
198
|
-
end
|
199
|
-
|
200
|
-
#
|
201
|
-
|
202
|
-
def initialize_arguments(*arguments)
|
203
|
-
@arguments.concat(arguments)
|
204
|
-
end
|
205
|
-
|
206
|
-
#
|
207
|
-
|
208
|
-
def initialize_options(*options)
|
209
|
-
options = options.inject{ |h,o| h.merge(o) }
|
210
|
-
begin
|
211
|
-
opt, val = nil, nil
|
212
|
-
options.each do |opt, val|
|
213
|
-
opt = opt.gsub('-','_')
|
214
|
-
send("#{opt}=", val)
|
215
|
-
end
|
216
|
-
rescue NoMethodError
|
217
|
-
option_missing(opt, val)
|
218
|
-
end
|
219
|
-
@options.update(options)
|
220
|
-
end
|
221
|
-
|
222
|
-
public
|
223
|
-
|
224
|
-
# For a single command (ie. a subcommand) override #call with arity=0.
|
225
|
-
|
226
|
-
def call(cmd=nil, *args)
|
227
|
-
opts = Hash==args.last ? args.pop : {}
|
228
|
-
#TEST("options should all be hashes"){ ! opts.all?{ |e| Hash===e }
|
229
|
-
#cmd = :default if cmd.nil?
|
230
|
-
if cmd.nil?
|
231
|
-
default
|
232
|
-
else
|
233
|
-
begin
|
234
|
-
# FIXME: rename call to [] ?
|
235
|
-
raise NameError if cmd == 'call'
|
236
|
-
raise NameError unless commands.include?(cmd.to_sym)
|
237
|
-
subcommand = method(cmd)
|
238
|
-
parameters = [args, opts]
|
239
|
-
rescue NameError
|
240
|
-
subcommand = method(:command_missing)
|
241
|
-
parameters = [cmd, args, opts]
|
242
|
-
end
|
243
|
-
if subcommand.arity < 0
|
244
|
-
subcommand.call(*parameters[0..subcommand.arity])
|
245
|
-
else
|
246
|
-
subcommand.call(*parameters[0,subcommand.arity])
|
247
|
-
end
|
248
|
-
end
|
249
|
-
end
|
250
|
-
|
251
|
-
# Display help message.
|
252
|
-
# The one provided is just a very limited dummy routine.
|
253
|
-
|
254
|
-
# def help
|
255
|
-
# puts "USAGE #{File.basename($0)} [options]"
|
256
|
-
# puts "\nOptions:"
|
257
|
-
# options = self.class.instance_methods(false)
|
258
|
-
# options = options - Command.instance_methods(true)
|
259
|
-
# options = options.select{ |m| m.to_s =~ /=$/ }
|
260
|
-
# options.each do |opt|
|
261
|
-
# puts " --#{opt.to_s.chomp('=')}"
|
262
|
-
# end
|
263
|
-
# end
|
264
|
-
|
265
|
-
private
|
266
|
-
|
267
|
-
# Override default to provide non-subcommand functionality.
|
268
|
-
|
269
|
-
def default; end
|
270
|
-
|
271
|
-
#
|
272
|
-
def commands
|
273
|
-
@_commands ||= (
|
274
|
-
cmds = self.class.instance_methods(true) - Command.instance_methods(true)
|
275
|
-
cmds.select{ |c| c !~ /\W/ }
|
276
|
-
cmds.collect{ |c| c.to_sym }
|
277
|
-
)
|
278
|
-
end
|
279
|
-
|
280
|
-
#
|
281
|
-
|
282
|
-
def command_missing(cmd, args, opt)
|
283
|
-
raise NoCommandError.new(cmd, args << opt)
|
284
|
-
end
|
285
|
-
|
286
|
-
#
|
287
|
-
|
288
|
-
def option_missing(opt, arg=nil)
|
289
|
-
raise NoOptionError.new(opt)
|
290
|
-
end
|
291
|
-
|
292
|
-
end
|
293
|
-
|
294
|
-
# Temporary backward compatability.
|
295
|
-
MasterCommand = Command
|
296
|
-
|
297
|
-
end
|
298
|
-
|
299
|
-
|
300
|
-
module Console #:nodoc:
|
301
|
-
# For backward compatibility.
|
302
|
-
Command = CLI::Command
|
303
|
-
end
|
304
|
-
|
305
|
-
|
306
|
-
# SCRAP CODE FOR REFERENCE TO POSSIBLE ADD FUTURE FEATURES
|
307
|
-
|
308
|
-
=begin
|
309
|
-
|
310
|
-
# We include a module here so you can define your own help
|
311
|
-
# command and call #super to utilize this one.
|
312
|
-
|
313
|
-
module Help
|
314
|
-
|
315
|
-
def help
|
316
|
-
opts = help_options
|
317
|
-
s = ""
|
318
|
-
s << "#{File.basename($0)}\n\n"
|
319
|
-
unless opts.empty?
|
320
|
-
s << "OPTIONS\n"
|
321
|
-
s << help_options
|
322
|
-
s << "\n"
|
323
|
-
end
|
324
|
-
s << "COMMANDS\n"
|
325
|
-
s << help_commands
|
326
|
-
puts s
|
327
|
-
end
|
328
|
-
|
329
|
-
private
|
330
|
-
|
331
|
-
def help_commands
|
332
|
-
help = self.class.help
|
333
|
-
bufs = help.keys.collect{ |a| a.to_s.size }.max + 3
|
334
|
-
lines = []
|
335
|
-
help.each { |cmd, str|
|
336
|
-
cmd = cmd.to_s
|
337
|
-
if cmd !~ /^_/
|
338
|
-
lines << " " + cmd + (" " * (bufs - cmd.size)) + str
|
339
|
-
end
|
340
|
-
}
|
341
|
-
lines.join("\n")
|
342
|
-
end
|
343
|
-
|
344
|
-
def help_options
|
345
|
-
help = self.class.help
|
346
|
-
bufs = help.keys.collect{ |a| a.to_s.size }.max + 3
|
347
|
-
lines = []
|
348
|
-
help.each { |cmd, str|
|
349
|
-
cmd = cmd.to_s
|
350
|
-
if cmd =~ /^_/
|
351
|
-
lines << " " + cmd.gsub(/_/,'-') + (" " * (bufs - cmd.size)) + str
|
352
|
-
end
|
353
|
-
}
|
354
|
-
lines.join("\n")
|
355
|
-
end
|
356
|
-
|
357
|
-
module ClassMethods
|
358
|
-
|
359
|
-
def help( str=nil )
|
360
|
-
return (@help ||= {}) unless str
|
361
|
-
@current_help = str
|
362
|
-
end
|
363
|
-
|
364
|
-
def method_added( meth )
|
365
|
-
if @current_help
|
366
|
-
@help ||= {}
|
367
|
-
@help[meth] = @current_help
|
368
|
-
@current_help = nil
|
369
|
-
end
|
370
|
-
end
|
371
|
-
|
372
|
-
end
|
373
|
-
|
374
|
-
end
|
375
|
-
|
376
|
-
include Help
|
377
|
-
extend Help::ClassMethods
|
378
|
-
|
379
|
-
=end
|
380
|
-
|
381
|
-
=begin
|
382
|
-
|
383
|
-
# Provides a very basic usage help string.
|
384
|
-
#
|
385
|
-
# TODO Add support for __options.
|
386
|
-
def usage
|
387
|
-
str = []
|
388
|
-
public_methods(false).sort.each do |meth|
|
389
|
-
meth = meth.to_s
|
390
|
-
case meth
|
391
|
-
when /^_/
|
392
|
-
opt = meth.sub(/^_+/, '')
|
393
|
-
meth = method(meth)
|
394
|
-
if meth.arity == 0
|
395
|
-
str << (opt.size > 1 ? "[--#{opt}]" : "[-#{opt}]")
|
396
|
-
elsif meth.arity == 1
|
397
|
-
str << (opt.size > 1 ? "[--#{opt} value]" : "[-#{opt} value]")
|
398
|
-
elsif meth.arity > 0
|
399
|
-
v = []; meth.arity.times{ |i| v << 'value' + (i + 1).to_s }
|
400
|
-
str << (opt.size > 1 ? "[--#{opt} #{v.join(' ')}]" : "[-#{opt} #{v.join(' ')}]")
|
401
|
-
else
|
402
|
-
str << (opt.size > 1 ? "[--#{opt} *values]" : "[-#{opt} *values]")
|
403
|
-
end
|
404
|
-
when /=$/
|
405
|
-
opt = meth.chomp('=')
|
406
|
-
str << (opt.size > 1 ? "[--#{opt} value]" : "[-#{opt} value]")
|
407
|
-
when /!$/
|
408
|
-
opt = meth.chomp('!')
|
409
|
-
str << (opt.size > 1 ? "[--#{opt}]" : "[-#{opt}]")
|
410
|
-
end
|
411
|
-
end
|
412
|
-
return str.join(" ")
|
413
|
-
end
|
414
|
-
|
415
|
-
#
|
416
|
-
|
417
|
-
def self.usage_class(usage)
|
418
|
-
c = Class.new(self)
|
419
|
-
argv = Shellwords.shellwords(usage)
|
420
|
-
argv.each_with_index do |name, i|
|
421
|
-
if name =~ /^-/
|
422
|
-
if argv[i+1] =~ /^[(.*?)]/
|
423
|
-
c.class_eval %{
|
424
|
-
attr_accessor :#{name}
|
425
|
-
}
|
426
|
-
else
|
427
|
-
c.class_eval %{
|
428
|
-
attr_reader :#{name}
|
429
|
-
def #{name}! ; @#{name} = true ; end
|
430
|
-
}
|
431
|
-
end
|
432
|
-
end
|
433
|
-
end
|
434
|
-
return c
|
435
|
-
end
|
436
|
-
|
437
|
-
end
|
438
|
-
|
439
|
-
=end
|