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
@@ -109,9 +109,10 @@ Combine intervals.
|
|
109
109
|
<pre>
|
110
110
|
Range.combine(1..2, 2..4) #=> [1..4]
|
111
111
|
Range.combine(1..2, 3..4) #=> [1..2, 3..4]
|
112
|
-
|
113
|
-
CREDIT: Trans
|
114
112
|
</pre>
|
113
|
+
<p>
|
114
|
+
CREDIT: Trans
|
115
|
+
</p>
|
115
116
|
</div>
|
116
117
|
<div class="sourcecode">
|
117
118
|
<p class="source-link">[ <a href="javascript:toggleSource('M000003_source')" id="l_M000003_source">+</a> ]</p>
|
@@ -159,9 +160,10 @@ Combine ranges.
|
|
159
160
|
(1..2).combine(3..4) #=> [1..2, 3..4]
|
160
161
|
|
161
162
|
TODO: Incorporate end-sentinal inclusion vs. exclusion.
|
162
|
-
|
163
|
-
CREDIT: Trans
|
164
163
|
</pre>
|
164
|
+
<p>
|
165
|
+
CREDIT: Trans
|
166
|
+
</p>
|
165
167
|
</div>
|
166
168
|
<div class="sourcecode">
|
167
169
|
<p class="source-link">[ <a href="javascript:toggleSource('M000002_source')" id="l_M000002_source">+</a> ]</p>
|
@@ -183,16 +185,15 @@ Combine ranges.
|
|
183
185
|
<p>
|
184
186
|
Do two ranges <a href="Range.html#M000001">overlap?</a>
|
185
187
|
</p>
|
186
|
-
<
|
187
|
-
|
188
|
-
|
189
|
-
</pre>
|
188
|
+
<p>
|
189
|
+
CREDIT: Daniel Schierbeck, Brandon Keepers
|
190
|
+
</p>
|
190
191
|
</div>
|
191
192
|
<div class="sourcecode">
|
192
193
|
<p class="source-link">[ <a href="javascript:toggleSource('M000001_source')" id="l_M000001_source">+</a> ]</p>
|
193
194
|
<div id="M000001_source" class="dyn-source">
|
194
195
|
<pre>
|
195
|
-
<span class="ruby-comment cmt"># File lib/core/facets/range/overlap.rb, line
|
196
|
+
<span class="ruby-comment cmt"># File lib/core/facets/range/overlap.rb, line 7</span>
|
196
197
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">overlap?</span>(<span class="ruby-identifier">other</span>)
|
197
198
|
<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">first</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">first</span>)
|
198
199
|
<span class="ruby-keyword kw">end</span>
|
@@ -289,16 +290,16 @@ Example:
|
|
289
290
|
</p>
|
290
291
|
<pre>
|
291
292
|
(0..3).umbrella(1..2) #=> [-1,-1]
|
292
|
-
|
293
|
-
CREDIT: Trans
|
294
|
-
CREDIT: Chris Kappler
|
295
293
|
</pre>
|
294
|
+
<p>
|
295
|
+
CREDIT: Trans, Chris Kappler
|
296
|
+
</p>
|
296
297
|
</div>
|
297
298
|
<div class="sourcecode">
|
298
299
|
<p class="source-link">[ <a href="javascript:toggleSource('M000007_source')" id="l_M000007_source">+</a> ]</p>
|
299
300
|
<div id="M000007_source" class="dyn-source">
|
300
301
|
<pre>
|
301
|
-
<span class="ruby-comment cmt"># File lib/core/facets/range/within.rb, line
|
302
|
+
<span class="ruby-comment cmt"># File lib/core/facets/range/within.rb, line 49</span>
|
302
303
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">umbrella</span>(<span class="ruby-identifier">r</span>)
|
303
304
|
<span class="ruby-identifier">s</span> = <span class="ruby-identifier">first</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">first</span>
|
304
305
|
<span class="ruby-identifier">e</span> = <span class="ruby-identifier">r</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator"><=></span> <span class="ruby-identifier">last</span>
|
@@ -329,9 +330,10 @@ within this <a href="Range.html">Range</a>.
|
|
329
330
|
</p>
|
330
331
|
<pre>
|
331
332
|
(1..3).within?(0..4) #=> true
|
332
|
-
|
333
|
-
CREDIT: Trans
|
334
333
|
</pre>
|
334
|
+
<p>
|
335
|
+
CREDIT: Trans
|
336
|
+
</p>
|
335
337
|
</div>
|
336
338
|
<div class="sourcecode">
|
337
339
|
<p class="source-link">[ <a href="javascript:toggleSource('M000006_source')" id="l_M000006_source">+</a> ]</p>
|
@@ -82,9 +82,9 @@ Object
|
|
82
82
|
|
83
83
|
|
84
84
|
<div class="sectiontitle">Methods</div>
|
85
|
-
<span style="padding-right: 5px;"><a href="#
|
86
|
-
<span style="padding-right: 5px;"><a href="#
|
87
|
-
<span style="padding-right: 5px;"><a href="#
|
85
|
+
<span style="padding-right: 5px;"><a href="#M000029">arity</a></span>
|
86
|
+
<span style="padding-right: 5px;"><a href="#M000028">to_re</a></span>
|
87
|
+
<span style="padding-right: 5px;"><a href="#M000027">to_regexp</a></span>
|
88
88
|
|
89
89
|
|
90
90
|
|
@@ -94,7 +94,7 @@ Object
|
|
94
94
|
<div class="sectiontitle">Public Instance methods</div>
|
95
95
|
<div class="method">
|
96
96
|
<div class="title">
|
97
|
-
<a name="
|
97
|
+
<a name="M000029"></a><b>arity</b>()
|
98
98
|
</div>
|
99
99
|
<div class="description">
|
100
100
|
<p>
|
@@ -108,13 +108,13 @@ Returns the number of backreferencing subexpressions.
|
|
108
108
|
Note that this is not perfect, especially with regards to \x and embedded
|
109
109
|
comments.
|
110
110
|
</p>
|
111
|
-
<
|
112
|
-
|
113
|
-
</
|
111
|
+
<p>
|
112
|
+
CREDIT: Trans
|
113
|
+
</p>
|
114
114
|
</div>
|
115
115
|
<div class="sourcecode">
|
116
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
117
|
-
<div id="
|
116
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000029_source')" id="l_M000029_source">+</a> ]</p>
|
117
|
+
<div id="M000029_source" class="dyn-source">
|
118
118
|
<pre>
|
119
119
|
<span class="ruby-comment cmt"># File lib/core/facets/regexp/arity.rb, line 13</span>
|
120
120
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">arity</span>
|
@@ -126,14 +126,14 @@ comments.
|
|
126
126
|
</div>
|
127
127
|
<div class="method">
|
128
128
|
<div class="title">
|
129
|
-
<a name="
|
129
|
+
<a name="M000028"></a><b>to_re</b>(esc=false)
|
130
130
|
</div>
|
131
131
|
<div class="description">
|
132
132
|
<p>
|
133
133
|
Simply returns itself. Helpful when converting strings to regular
|
134
134
|
expressions, where regexp might occur as well —in the same vien as
|
135
135
|
using to_s on symbols. The parameter is actaully a dummy parameter to
|
136
|
-
coincide with <a href="String.html#
|
136
|
+
coincide with <a href="String.html#M000255">String#to_re</a>.
|
137
137
|
</p>
|
138
138
|
<pre>
|
139
139
|
/abc/.to_re #=> /abc/
|
@@ -143,8 +143,8 @@ CREDIT: Trans
|
|
143
143
|
</p>
|
144
144
|
</div>
|
145
145
|
<div class="sourcecode">
|
146
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
147
|
-
<div id="
|
146
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000028_source')" id="l_M000028_source">+</a> ]</p>
|
147
|
+
<div id="M000028_source" class="dyn-source">
|
148
148
|
<pre>
|
149
149
|
<span class="ruby-comment cmt"># File lib/core/facets/regexp/to_re.rb, line 24</span>
|
150
150
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_re</span>(<span class="ruby-identifier">esc</span>=<span class="ruby-keyword kw">false</span>)
|
@@ -156,11 +156,11 @@ CREDIT: Trans
|
|
156
156
|
</div>
|
157
157
|
<div class="method">
|
158
158
|
<div class="title">
|
159
|
-
<a name="
|
159
|
+
<a name="M000027"></a><b>to_regexp</b>()
|
160
160
|
</div>
|
161
161
|
<div class="description">
|
162
162
|
<p>
|
163
|
-
Like <a href="Regexp.html#
|
163
|
+
Like <a href="Regexp.html#M000028">to_re</a>, but following Ruby‘s
|
164
164
|
formal definitions, only a Regular expression type object will respond to
|
165
165
|
this.
|
166
166
|
</p>
|
@@ -172,8 +172,8 @@ CREDIT: Florian Gross
|
|
172
172
|
</p>
|
173
173
|
</div>
|
174
174
|
<div class="sourcecode">
|
175
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
176
|
-
<div id="
|
175
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000027_source')" id="l_M000027_source">+</a> ]</p>
|
176
|
+
<div id="M000027_source" class="dyn-source">
|
177
177
|
<pre>
|
178
178
|
<span class="ruby-comment cmt"># File lib/core/facets/regexp/to_re.rb, line 10</span>
|
179
179
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_regexp</span>
|
@@ -72,9 +72,9 @@
|
|
72
72
|
<div class="description"><h1><a href="Stackable.html">Stackable</a></h1>
|
73
73
|
<p>
|
74
74
|
<a href="Stackable.html">Stackable</a> mixin provides <a
|
75
|
-
href="Stackable.html#
|
76
|
-
href="Stackable.html#
|
77
|
-
href="Stackable.html#
|
75
|
+
href="Stackable.html#M000335">pop</a>, <a
|
76
|
+
href="Stackable.html#M000336">push</a>, <a
|
77
|
+
href="Stackable.html#M000337">pull</a>, etc. It depends on slice, splice
|
78
78
|
and insert.
|
79
79
|
</p>
|
80
80
|
</div>
|
@@ -82,13 +82,13 @@ and insert.
|
|
82
82
|
|
83
83
|
|
84
84
|
<div class="sectiontitle">Methods</div>
|
85
|
-
<span style="padding-right: 5px;"><a href="#
|
86
|
-
<span style="padding-right: 5px;"><a href="#
|
87
|
-
<span style="padding-right: 5px;"><a href="#
|
88
|
-
<span style="padding-right: 5px;"><a href="#
|
89
|
-
<span style="padding-right: 5px;"><a href="#
|
90
|
-
<span style="padding-right: 5px;"><a href="#
|
91
|
-
<span style="padding-right: 5px;"><a href="#
|
85
|
+
<span style="padding-right: 5px;"><a href="#M000341">peek</a></span>
|
86
|
+
<span style="padding-right: 5px;"><a href="#M000339">poke</a></span>
|
87
|
+
<span style="padding-right: 5px;"><a href="#M000335">pop</a></span>
|
88
|
+
<span style="padding-right: 5px;"><a href="#M000337">pull</a></span>
|
89
|
+
<span style="padding-right: 5px;"><a href="#M000336">push</a></span>
|
90
|
+
<span style="padding-right: 5px;"><a href="#M000338">shift</a></span>
|
91
|
+
<span style="padding-right: 5px;"><a href="#M000340">unshift</a></span>
|
92
92
|
|
93
93
|
|
94
94
|
|
@@ -98,7 +98,7 @@ and insert.
|
|
98
98
|
<div class="sectiontitle">Public Instance methods</div>
|
99
99
|
<div class="method">
|
100
100
|
<div class="title">
|
101
|
-
<a name="
|
101
|
+
<a name="M000341"></a><b>peek</b>()
|
102
102
|
</div>
|
103
103
|
<div class="description">
|
104
104
|
<p>
|
@@ -111,8 +111,8 @@ Peek at the top of the stack.
|
|
111
111
|
</pre>
|
112
112
|
</div>
|
113
113
|
<div class="sourcecode">
|
114
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
115
|
-
<div id="
|
114
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000341_source')" id="l_M000341_source">+</a> ]</p>
|
115
|
+
<div id="M000341_source" class="dyn-source">
|
116
116
|
<pre>
|
117
117
|
<span class="ruby-comment cmt"># File lib/core/facets/stackable.rb, line 81</span>
|
118
118
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">peek</span>
|
@@ -124,7 +124,7 @@ Peek at the top of the stack.
|
|
124
124
|
</div>
|
125
125
|
<div class="method">
|
126
126
|
<div class="title">
|
127
|
-
<a name="
|
127
|
+
<a name="M000339"></a><b>poke</b>(x)
|
128
128
|
</div>
|
129
129
|
<div class="description">
|
130
130
|
<p>
|
@@ -139,11 +139,11 @@ Poke item onto the stack.
|
|
139
139
|
</div>
|
140
140
|
<div class="aka">
|
141
141
|
This method is also aliased as
|
142
|
-
<a href="Stackable.html#
|
142
|
+
<a href="Stackable.html#M000340">unshift</a>
|
143
143
|
</div>
|
144
144
|
<div class="sourcecode">
|
145
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
146
|
-
<div id="
|
145
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000339_source')" id="l_M000339_source">+</a> ]</p>
|
146
|
+
<div id="M000339_source" class="dyn-source">
|
147
147
|
<pre>
|
148
148
|
<span class="ruby-comment cmt"># File lib/core/facets/stackable.rb, line 69</span>
|
149
149
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">poke</span>(<span class="ruby-identifier">x</span>)
|
@@ -155,7 +155,7 @@ Poke item onto the stack.
|
|
155
155
|
</div>
|
156
156
|
<div class="method">
|
157
157
|
<div class="title">
|
158
|
-
<a name="
|
158
|
+
<a name="M000335"></a><b>pop</b>()
|
159
159
|
</div>
|
160
160
|
<div class="description">
|
161
161
|
<p>
|
@@ -168,8 +168,8 @@ Pop item off stack.
|
|
168
168
|
</pre>
|
169
169
|
</div>
|
170
170
|
<div class="sourcecode">
|
171
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
172
|
-
<div id="
|
171
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000335_source')" id="l_M000335_source">+</a> ]</p>
|
172
|
+
<div id="M000335_source" class="dyn-source">
|
173
173
|
<pre>
|
174
174
|
<span class="ruby-comment cmt"># File lib/core/facets/stackable.rb, line 37</span>
|
175
175
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pop</span>
|
@@ -181,7 +181,7 @@ Pop item off stack.
|
|
181
181
|
</div>
|
182
182
|
<div class="method">
|
183
183
|
<div class="title">
|
184
|
-
<a name="
|
184
|
+
<a name="M000337"></a><b>pull</b>()
|
185
185
|
</div>
|
186
186
|
<div class="description">
|
187
187
|
<p>
|
@@ -195,11 +195,11 @@ Pull item off the stack.
|
|
195
195
|
</div>
|
196
196
|
<div class="aka">
|
197
197
|
This method is also aliased as
|
198
|
-
<a href="Stackable.html#
|
198
|
+
<a href="Stackable.html#M000338">shift</a>
|
199
199
|
</div>
|
200
200
|
<div class="sourcecode">
|
201
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
202
|
-
<div id="
|
201
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000337_source')" id="l_M000337_source">+</a> ]</p>
|
202
|
+
<div id="M000337_source" class="dyn-source">
|
203
203
|
<pre>
|
204
204
|
<span class="ruby-comment cmt"># File lib/core/facets/stackable.rb, line 56</span>
|
205
205
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pull</span>
|
@@ -211,7 +211,7 @@ Pull item off the stack.
|
|
211
211
|
</div>
|
212
212
|
<div class="method">
|
213
213
|
<div class="title">
|
214
|
-
<a name="
|
214
|
+
<a name="M000336"></a><b>push</b>(x)
|
215
215
|
</div>
|
216
216
|
<div class="description">
|
217
217
|
<p>
|
@@ -223,8 +223,8 @@ Push item onto the stack.
|
|
223
223
|
</pre>
|
224
224
|
</div>
|
225
225
|
<div class="sourcecode">
|
226
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
227
|
-
<div id="
|
226
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000336_source')" id="l_M000336_source">+</a> ]</p>
|
227
|
+
<div id="M000336_source" class="dyn-source">
|
228
228
|
<pre>
|
229
229
|
<span class="ruby-comment cmt"># File lib/core/facets/stackable.rb, line 46</span>
|
230
230
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">push</span>(<span class="ruby-identifier">x</span>)
|
@@ -236,21 +236,21 @@ Push item onto the stack.
|
|
236
236
|
</div>
|
237
237
|
<div class="method">
|
238
238
|
<div class="title">
|
239
|
-
<a name="
|
239
|
+
<a name="M000338"></a><b>shift</b>()
|
240
240
|
</div>
|
241
241
|
<div class="description">
|
242
242
|
<p>
|
243
|
-
Alias for <a href="Stackable.html#
|
243
|
+
Alias for <a href="Stackable.html#M000337">pull</a>
|
244
244
|
</p>
|
245
245
|
</div>
|
246
246
|
</div>
|
247
247
|
<div class="method">
|
248
248
|
<div class="title">
|
249
|
-
<a name="
|
249
|
+
<a name="M000340"></a><b>unshift</b>(x)
|
250
250
|
</div>
|
251
251
|
<div class="description">
|
252
252
|
<p>
|
253
|
-
Alias for <a href="Stackable.html#
|
253
|
+
Alias for <a href="Stackable.html#M000339">poke</a>
|
254
254
|
</p>
|
255
255
|
</div>
|
256
256
|
</div>
|
@@ -58,7 +58,6 @@
|
|
58
58
|
<td>In:</td>
|
59
59
|
<td>
|
60
60
|
<a href="../files/lib/core/facets/boolean_rb.html">lib/core/facets/boolean.rb</a>
|
61
|
-
<a href="../files/lib/core/facets/comparable/bound_rb.html">lib/core/facets/comparable/bound.rb</a>
|
62
61
|
<a href="../files/lib/core/facets/comparable/cmp_rb.html">lib/core/facets/comparable/cmp.rb</a>
|
63
62
|
<a href="../files/lib/core/facets/string/shatter_rb.html">lib/core/facets/string/shatter.rb</a>
|
64
63
|
<a href="../files/lib/core/facets/string/to_re_rb.html">lib/core/facets/string/to_re.rb</a>
|
@@ -72,17 +71,22 @@
|
|
72
71
|
<a href="../files/lib/core/facets/string/tab_rb.html">lib/core/facets/string/tab.rb</a>
|
73
72
|
<a href="../files/lib/core/facets/string/methodize_rb.html">lib/core/facets/string/methodize.rb</a>
|
74
73
|
<a href="../files/lib/core/facets/string/op_sub_rb.html">lib/core/facets/string/op_sub.rb</a>
|
74
|
+
<a href="../files/lib/core/facets/string/compress_lines_rb.html">lib/core/facets/string/compress_lines.rb</a>
|
75
75
|
<a href="../files/lib/core/facets/string/range_rb.html">lib/core/facets/string/range.rb</a>
|
76
76
|
<a href="../files/lib/core/facets/string/snakecase_rb.html">lib/core/facets/string/snakecase.rb</a>
|
77
77
|
<a href="../files/lib/core/facets/string/each_char_rb.html">lib/core/facets/string/each_char.rb</a>
|
78
78
|
<a href="../files/lib/core/facets/string/divide_rb.html">lib/core/facets/string/divide.rb</a>
|
79
|
+
<a href="../files/lib/core/facets/string/margin_rb.html">lib/core/facets/string/margin.rb</a>
|
79
80
|
<a href="../files/lib/core/facets/string/mscan_rb.html">lib/core/facets/string/mscan.rb</a>
|
80
81
|
<a href="../files/lib/core/facets/string/capitalized_rb.html">lib/core/facets/string/capitalized.rb</a>
|
82
|
+
<a href="../files/lib/core/facets/string/expand_tab_rb.html">lib/core/facets/string/expand_tab.rb</a>
|
81
83
|
<a href="../files/lib/core/facets/string/natcmp_rb.html">lib/core/facets/string/natcmp.rb</a>
|
82
84
|
<a href="../files/lib/core/facets/string/variablize_rb.html">lib/core/facets/string/variablize.rb</a>
|
83
85
|
<a href="../files/lib/core/facets/string/bytes_rb.html">lib/core/facets/string/bytes.rb</a>
|
84
86
|
<a href="../files/lib/core/facets/string/pathize_rb.html">lib/core/facets/string/pathize.rb</a>
|
87
|
+
<a href="../files/lib/core/facets/string/indent_rb.html">lib/core/facets/string/indent.rb</a>
|
85
88
|
<a href="../files/lib/core/facets/string/titlecase_rb.html">lib/core/facets/string/titlecase.rb</a>
|
89
|
+
<a href="../files/lib/core/facets/string/tabto_rb.html">lib/core/facets/string/tabto.rb</a>
|
86
90
|
<a href="../files/lib/core/facets/string/words_rb.html">lib/core/facets/string/words.rb</a>
|
87
91
|
<a href="../files/lib/core/facets/string/interpolate_rb.html">lib/core/facets/string/interpolate.rb</a>
|
88
92
|
<a href="../files/lib/core/facets/string/cleave_rb.html">lib/core/facets/string/cleave.rb</a>
|
@@ -119,68 +123,68 @@ Object
|
|
119
123
|
|
120
124
|
|
121
125
|
<div class="sectiontitle">Methods</div>
|
122
|
-
<span style="padding-right: 5px;"><a href="#
|
123
|
-
<span style="padding-right: 5px;"><a href="#
|
124
|
-
<span style="padding-right: 5px;"><a href="#
|
125
|
-
<span style="padding-right: 5px;"><a href="#
|
126
|
-
<span style="padding-right: 5px;"><a href="#
|
127
|
-
<span style="padding-right: 5px;"><a href="#
|
128
|
-
<span style="padding-right: 5px;"><a href="#
|
129
|
-
<span style="padding-right: 5px;"><a href="#
|
130
|
-
<span style="padding-right: 5px;"><a href="#
|
131
|
-
<span style="padding-right: 5px;"><a href="#
|
132
|
-
<span style="padding-right: 5px;"><a href="#
|
126
|
+
<span style="padding-right: 5px;"><a href="#M000271">-</a></span>
|
127
|
+
<span style="padding-right: 5px;"><a href="#M000311">^</a></span>
|
128
|
+
<span style="padding-right: 5px;"><a href="#M000265">align</a></span>
|
129
|
+
<span style="padding-right: 5px;"><a href="#M000268">align_center</a></span>
|
130
|
+
<span style="padding-right: 5px;"><a href="#M000267">align_left</a></span>
|
131
|
+
<span style="padding-right: 5px;"><a href="#M000266">align_right</a></span>
|
132
|
+
<span style="padding-right: 5px;"><a href="#M000313">blank?</a></span>
|
133
|
+
<span style="padding-right: 5px;"><a href="#M000299">bracket</a></span>
|
134
|
+
<span style="padding-right: 5px;"><a href="#M000300">bracket!</a></span>
|
135
|
+
<span style="padding-right: 5px;"><a href="#M000289">bytes</a></span>
|
136
|
+
<span style="padding-right: 5px;"><a href="#M000260">camelcase</a></span>
|
133
137
|
<span style="padding-right: 5px;"><a href="#M000282">capitalized?</a></span>
|
134
|
-
<span style="padding-right: 5px;"><a href="#
|
135
|
-
<span style="padding-right: 5px;"><a href="#
|
136
|
-
<span style="padding-right: 5px;"><a href="#
|
137
|
-
<span style="padding-right: 5px;"><a href="#
|
138
|
-
<span style="padding-right: 5px;"><a href="#
|
138
|
+
<span style="padding-right: 5px;"><a href="#M000305">chars</a></span>
|
139
|
+
<span style="padding-right: 5px;"><a href="#M000297">cleave</a></span>
|
140
|
+
<span style="padding-right: 5px;"><a href="#M000253">cmp</a></span>
|
141
|
+
<span style="padding-right: 5px;"><a href="#M000272">compress_lines</a></span>
|
142
|
+
<span style="padding-right: 5px;"><a href="#M000304">dequote</a></span>
|
143
|
+
<span style="padding-right: 5px;"><a href="#M000279">divide</a></span>
|
139
144
|
<span style="padding-right: 5px;"><a href="#M000283">downcase?</a></span>
|
140
|
-
<span style="padding-right: 5px;"><a href="#
|
141
|
-
<span style="padding-right: 5px;"><a href="#
|
142
|
-
<span style="padding-right: 5px;"><a href="#
|
143
|
-
<span style="padding-right: 5px;"><a href="#
|
144
|
-
<span style="padding-right: 5px;"><a href="#
|
145
|
-
<span style="padding-right: 5px;"><a href="#
|
146
|
-
<span style="padding-right: 5px;"><a href="#
|
147
|
-
<span style="padding-right: 5px;"><a href="#
|
148
|
-
<span style="padding-right: 5px;"><a href="#
|
149
|
-
<span style="padding-right: 5px;"><a href="#
|
150
|
-
<span style="padding-right: 5px;"><a href="#
|
151
|
-
<span style="padding-right: 5px;"><a href="#
|
152
|
-
<span style="padding-right: 5px;"><a href="#
|
153
|
-
<span style="padding-right: 5px;"><a href="#
|
154
|
-
<span style="padding-right: 5px;"><a href="#
|
145
|
+
<span style="padding-right: 5px;"><a href="#M000278">each_char</a></span>
|
146
|
+
<span style="padding-right: 5px;"><a href="#M000312">each_word</a></span>
|
147
|
+
<span style="padding-right: 5px;"><a href="#M000259">end_with?</a></span>
|
148
|
+
<span style="padding-right: 5px;"><a href="#M000285">expand_tab</a></span>
|
149
|
+
<span style="padding-right: 5px;"><a href="#M000286">expand_tabs</a></span>
|
150
|
+
<span style="padding-right: 5px;"><a href="#M000257">fold</a></span>
|
151
|
+
<span style="padding-right: 5px;"><a href="#M000291">indent</a></span>
|
152
|
+
<span style="padding-right: 5px;"><a href="#M000276">index_all</a></span>
|
153
|
+
<span style="padding-right: 5px;"><a href="#M000296">interpolate</a></span>
|
154
|
+
<span style="padding-right: 5px;"><a href="#M000306">lchomp</a></span>
|
155
|
+
<span style="padding-right: 5px;"><a href="#M000307">lchomp!</a></span>
|
156
|
+
<span style="padding-right: 5px;"><a href="#M000298">line_wrap</a></span>
|
157
|
+
<span style="padding-right: 5px;"><a href="#M000261">lines</a></span>
|
158
|
+
<span style="padding-right: 5px;"><a href="#M000280">margin</a></span>
|
159
|
+
<span style="padding-right: 5px;"><a href="#M000270">methodize</a></span>
|
160
|
+
<span style="padding-right: 5px;"><a href="#M000262">modulize</a></span>
|
155
161
|
<span style="padding-right: 5px;"><a href="#M000281">mscan</a></span>
|
156
|
-
<span style="padding-right: 5px;"><a href="#
|
157
|
-
<span style="padding-right: 5px;"><a href="#
|
158
|
-
<span style="padding-right: 5px;"><a href="#
|
159
|
-
<span style="padding-right: 5px;"><a href="#
|
160
|
-
<span style="padding-right: 5px;"><a href="#
|
161
|
-
<span style="padding-right: 5px;"><a href="#
|
162
|
-
<span style="padding-right: 5px;"><a href="#
|
163
|
-
<span style="padding-right: 5px;"><a href="#
|
164
|
-
<span style="padding-right: 5px;"><a href="#
|
165
|
-
<span style="padding-right: 5px;"><a href="#
|
166
|
-
<span style="padding-right: 5px;"><a href="#
|
167
|
-
<span style="padding-right: 5px;"><a href="#
|
168
|
-
<span style="padding-right: 5px;"><a href="#
|
169
|
-
<span style="padding-right: 5px;"><a href="#
|
170
|
-
<span style="padding-right: 5px;"><a href="#
|
171
|
-
<span style="padding-right: 5px;"><a href="#
|
172
|
-
<span style="padding-right: 5px;"><a href="#
|
173
|
-
<span style="padding-right: 5px;"><a href="#
|
174
|
-
<span style="padding-right: 5px;"><a href="#
|
175
|
-
<span style="padding-right: 5px;"><a href="#
|
176
|
-
<span style="padding-right: 5px;"><a href="#
|
177
|
-
<span style="padding-right: 5px;"><a href="#M000296">unbracket</a></span>
|
178
|
-
<span style="padding-right: 5px;"><a href="#M000297">unbracket!</a></span>
|
162
|
+
<span style="padding-right: 5px;"><a href="#M000287">natcmp</a></span>
|
163
|
+
<span style="padding-right: 5px;"><a href="#M000310">nchar</a></span>
|
164
|
+
<span style="padding-right: 5px;"><a href="#M000292">outdent</a></span>
|
165
|
+
<span style="padding-right: 5px;"><a href="#M000290">pathize</a></span>
|
166
|
+
<span style="padding-right: 5px;"><a href="#M000303">quote</a></span>
|
167
|
+
<span style="padding-right: 5px;"><a href="#M000273">range</a></span>
|
168
|
+
<span style="padding-right: 5px;"><a href="#M000274">range_all</a></span>
|
169
|
+
<span style="padding-right: 5px;"><a href="#M000275">range_of_line</a></span>
|
170
|
+
<span style="padding-right: 5px;"><a href="#M000309">rewrite</a></span>
|
171
|
+
<span style="padding-right: 5px;"><a href="#M000254">shatter</a></span>
|
172
|
+
<span style="padding-right: 5px;"><a href="#M000277">snakecase</a></span>
|
173
|
+
<span style="padding-right: 5px;"><a href="#M000308">splice</a></span>
|
174
|
+
<span style="padding-right: 5px;"><a href="#M000258">start_with?</a></span>
|
175
|
+
<span style="padding-right: 5px;"><a href="#M000269">tab</a></span>
|
176
|
+
<span style="padding-right: 5px;"><a href="#M000294">tabto</a></span>
|
177
|
+
<span style="padding-right: 5px;"><a href="#M000293">titlecase</a></span>
|
178
|
+
<span style="padding-right: 5px;"><a href="#M000252">to_b</a></span>
|
179
|
+
<span style="padding-right: 5px;"><a href="#M000255">to_re</a></span>
|
180
|
+
<span style="padding-right: 5px;"><a href="#M000256">to_rx</a></span>
|
181
|
+
<span style="padding-right: 5px;"><a href="#M000301">unbracket</a></span>
|
182
|
+
<span style="padding-right: 5px;"><a href="#M000302">unbracket!</a></span>
|
179
183
|
<span style="padding-right: 5px;"><a href="#M000284">upcase?</a></span>
|
180
|
-
<span style="padding-right: 5px;"><a href="#
|
181
|
-
<span style="padding-right: 5px;"><a href="#
|
182
|
-
<span style="padding-right: 5px;"><a href="#
|
183
|
-
<span style="padding-right: 5px;"><a href="#
|
184
|
+
<span style="padding-right: 5px;"><a href="#M000288">variablize</a></span>
|
185
|
+
<span style="padding-right: 5px;"><a href="#M000263">word_wrap</a></span>
|
186
|
+
<span style="padding-right: 5px;"><a href="#M000264">word_wrap!</a></span>
|
187
|
+
<span style="padding-right: 5px;"><a href="#M000295">words</a></span>
|
184
188
|
|
185
189
|
|
186
190
|
|
@@ -198,7 +202,7 @@ Object
|
|
198
202
|
<div class="sectiontitle">Public Class methods</div>
|
199
203
|
<div class="method">
|
200
204
|
<div class="title">
|
201
|
-
<a name="
|
205
|
+
<a name="M000296"></a><b>interpolate</b>(&str)
|
202
206
|
</div>
|
203
207
|
<div class="description">
|
204
208
|
<p>
|
@@ -212,13 +216,14 @@ mechinism.
|
|
212
216
|
|
213
217
|
NOTE: The block neccessary in order to get
|
214
218
|
then binding of the caller.
|
215
|
-
|
216
|
-
CREDIT: Trans
|
217
219
|
</pre>
|
220
|
+
<p>
|
221
|
+
CREDIT: Trans
|
222
|
+
</p>
|
218
223
|
</div>
|
219
224
|
<div class="sourcecode">
|
220
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
221
|
-
<div id="
|
225
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000296_source')" id="l_M000296_source">+</a> ]</p>
|
226
|
+
<div id="M000296_source" class="dyn-source">
|
222
227
|
<pre>
|
223
228
|
<span class="ruby-comment cmt"># File lib/core/facets/string/interpolate.rb, line 15</span>
|
224
229
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">interpolate</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">str</span>)
|
@@ -231,7 +236,7 @@ mechinism.
|
|
231
236
|
<div class="sectiontitle">Public Instance methods</div>
|
232
237
|
<div class="method">
|
233
238
|
<div class="title">
|
234
|
-
<a name="
|
239
|
+
<a name="M000271"></a><b>-</b>(pattern)
|
235
240
|
</div>
|
236
241
|
<div class="description">
|
237
242
|
<p>
|
@@ -239,13 +244,14 @@ Removes occurances of a string or regexp.
|
|
239
244
|
</p>
|
240
245
|
<pre>
|
241
246
|
"HELLO HELLO" - "LL" #=> "HEO HEO"
|
242
|
-
|
243
|
-
CREDIT: Benjamin David Oakes
|
244
247
|
</pre>
|
248
|
+
<p>
|
249
|
+
CREDIT: Benjamin David Oakes
|
250
|
+
</p>
|
245
251
|
</div>
|
246
252
|
<div class="sourcecode">
|
247
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
248
|
-
<div id="
|
253
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000271_source')" id="l_M000271_source">+</a> ]</p>
|
254
|
+
<div id="M000271_source" class="dyn-source">
|
249
255
|
<pre>
|
250
256
|
<span class="ruby-comment cmt"># File lib/core/facets/string/op_sub.rb, line 9</span>
|
251
257
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">-</span>(<span class="ruby-identifier">pattern</span>)
|
@@ -257,7 +263,7 @@ Removes occurances of a string or regexp.
|
|
257
263
|
</div>
|
258
264
|
<div class="method">
|
259
265
|
<div class="title">
|
260
|
-
<a name="
|
266
|
+
<a name="M000311"></a><b>^</b>(aString)
|
261
267
|
</div>
|
262
268
|
<div class="description">
|
263
269
|
<p>
|
@@ -268,8 +274,8 @@ TODO: This is used by crypt.rb, it needs to be documented.
|
|
268
274
|
</p>
|
269
275
|
</div>
|
270
276
|
<div class="sourcecode">
|
271
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
272
|
-
<div id="
|
277
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000311_source')" id="l_M000311_source">+</a> ]</p>
|
278
|
+
<div id="M000311_source" class="dyn-source">
|
273
279
|
<pre>
|
274
280
|
<span class="ruby-comment cmt"># File lib/core/facets/string/xor.rb, line 7</span>
|
275
281
|
<span class="ruby-keyword kw">def</span> <span class="ruby-operator">^</span>(<span class="ruby-identifier">aString</span>)
|
@@ -291,11 +297,11 @@ TODO: This is used by crypt.rb, it needs to be documented.
|
|
291
297
|
</div>
|
292
298
|
<div class="method">
|
293
299
|
<div class="title">
|
294
|
-
<a name="
|
300
|
+
<a name="M000265"></a><b>align</b>(direction, n, sep="\n", c=' ')
|
295
301
|
</div>
|
296
302
|
<div class="sourcecode">
|
297
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
298
|
-
<div id="
|
303
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000265_source')" id="l_M000265_source">+</a> ]</p>
|
304
|
+
<div id="M000265_source" class="dyn-source">
|
299
305
|
<pre>
|
300
306
|
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line 3</span>
|
301
307
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align</span>(<span class="ruby-identifier">direction</span>, <span class="ruby-identifier">n</span>, <span class="ruby-identifier">sep</span>=<span class="ruby-value str">"\n"</span>, <span class="ruby-identifier">c</span>=<span class="ruby-value str">' '</span>)
|
@@ -316,7 +322,7 @@ TODO: This is used by crypt.rb, it needs to be documented.
|
|
316
322
|
</div>
|
317
323
|
<div class="method">
|
318
324
|
<div class="title">
|
319
|
-
<a name="
|
325
|
+
<a name="M000268"></a><b>align_center</b>(n, sep="\n", c=' ')
|
320
326
|
</div>
|
321
327
|
<div class="description">
|
322
328
|
<p>
|
@@ -343,13 +349,14 @@ changed as can be the padding string which defaults to a single space
|
|
343
349
|
This is a test
|
344
350
|
and
|
345
351
|
so on
|
346
|
-
|
347
|
-
CREDIT: Trans
|
348
352
|
</pre>
|
353
|
+
<p>
|
354
|
+
CREDIT: Trans
|
355
|
+
</p>
|
349
356
|
</div>
|
350
357
|
<div class="sourcecode">
|
351
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
352
|
-
<div id="
|
358
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000268_source')" id="l_M000268_source">+</a> ]</p>
|
359
|
+
<div id="M000268_source" class="dyn-source">
|
353
360
|
<pre>
|
354
361
|
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line 97</span>
|
355
362
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align_center</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">sep</span>=<span class="ruby-value str">"\n"</span>, <span class="ruby-identifier">c</span>=<span class="ruby-value str">' '</span>)
|
@@ -365,7 +372,7 @@ changed as can be the padding string which defaults to a single space
|
|
365
372
|
</div>
|
366
373
|
<div class="method">
|
367
374
|
<div class="title">
|
368
|
-
<a name="
|
375
|
+
<a name="M000267"></a><b>align_left</b>(n, sep="\n", c=' ')
|
369
376
|
</div>
|
370
377
|
<div class="description">
|
371
378
|
<p>
|
@@ -392,13 +399,14 @@ changes as can be the padding string which defaults to a single space
|
|
392
399
|
This is a test
|
393
400
|
and
|
394
401
|
so on
|
395
|
-
|
396
|
-
CREDIT: Trans
|
397
402
|
</pre>
|
403
|
+
<p>
|
404
|
+
CREDIT: Trans
|
405
|
+
</p>
|
398
406
|
</div>
|
399
407
|
<div class="sourcecode">
|
400
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
401
|
-
<div id="
|
408
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000267_source')" id="l_M000267_source">+</a> ]</p>
|
409
|
+
<div id="M000267_source" class="dyn-source">
|
402
410
|
<pre>
|
403
411
|
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line 67</span>
|
404
412
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align_left</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">sep</span>=<span class="ruby-value str">"\n"</span>, <span class="ruby-identifier">c</span>=<span class="ruby-value str">' '</span>)
|
@@ -414,7 +422,7 @@ changes as can be the padding string which defaults to a single space
|
|
414
422
|
</div>
|
415
423
|
<div class="method">
|
416
424
|
<div class="title">
|
417
|
-
<a name="
|
425
|
+
<a name="M000266"></a><b>align_right</b>(n, sep="\n", c=' ')
|
418
426
|
</div>
|
419
427
|
<div class="description">
|
420
428
|
<p>
|
@@ -438,13 +446,14 @@ defaults to a single space (’ ’).
|
|
438
446
|
This is a test
|
439
447
|
and
|
440
448
|
so on
|
441
|
-
|
442
|
-
CREDIT: Trans
|
443
449
|
</pre>
|
450
|
+
<p>
|
451
|
+
CREDIT: Trans
|
452
|
+
</p>
|
444
453
|
</div>
|
445
454
|
<div class="sourcecode">
|
446
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
447
|
-
<div id="
|
455
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000266_source')" id="l_M000266_source">+</a> ]</p>
|
456
|
+
<div id="M000266_source" class="dyn-source">
|
448
457
|
<pre>
|
449
458
|
<span class="ruby-comment cmt"># File lib/core/facets/string/align.rb, line 37</span>
|
450
459
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">align_right</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">sep</span>=<span class="ruby-value str">"\n"</span>, <span class="ruby-identifier">c</span>=<span class="ruby-value str">' '</span>)
|
@@ -460,7 +469,7 @@ defaults to a single space (’ ’).
|
|
460
469
|
</div>
|
461
470
|
<div class="method">
|
462
471
|
<div class="title">
|
463
|
-
<a name="
|
472
|
+
<a name="M000313"></a><b>blank?</b>()
|
464
473
|
</div>
|
465
474
|
<div class="description">
|
466
475
|
<p>
|
@@ -472,8 +481,8 @@ Is this string just whitespace?
|
|
472
481
|
</pre>
|
473
482
|
</div>
|
474
483
|
<div class="sourcecode">
|
475
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
476
|
-
<div id="
|
484
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000313_source')" id="l_M000313_source">+</a> ]</p>
|
485
|
+
<div id="M000313_source" class="dyn-source">
|
477
486
|
<pre>
|
478
487
|
<span class="ruby-comment cmt"># File lib/core/facets/blank.rb, line 50</span>
|
479
488
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">blank?</span>
|
@@ -485,24 +494,25 @@ Is this string just whitespace?
|
|
485
494
|
</div>
|
486
495
|
<div class="method">
|
487
496
|
<div class="title">
|
488
|
-
<a name="
|
497
|
+
<a name="M000299"></a><b>bracket</b>(bra, ket=nil)
|
489
498
|
</div>
|
490
499
|
<div class="description">
|
491
500
|
<p>
|
492
501
|
Return a new string embraced by given brakets. If only one <a
|
493
|
-
href="String.html#
|
502
|
+
href="String.html#M000299">bracket</a> char is given it will be placed on
|
494
503
|
either side.
|
495
504
|
</p>
|
496
505
|
<pre>
|
497
506
|
"wrap me".bracket('{') #=> "{wrap me}"
|
498
507
|
"wrap me".bracket('--','!') #=> "--wrap me!"
|
499
|
-
|
500
|
-
CREDIT: Trans
|
501
508
|
</pre>
|
509
|
+
<p>
|
510
|
+
CREDIT: Trans
|
511
|
+
</p>
|
502
512
|
</div>
|
503
513
|
<div class="sourcecode">
|
504
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
505
|
-
<div id="
|
514
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000299_source')" id="l_M000299_source">+</a> ]</p>
|
515
|
+
<div id="M000299_source" class="dyn-source">
|
506
516
|
<pre>
|
507
517
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 14</span>
|
508
518
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bracket</span>(<span class="ruby-identifier">bra</span>, <span class="ruby-identifier">ket</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -516,19 +526,19 @@ either side.
|
|
516
526
|
</div>
|
517
527
|
<div class="method">
|
518
528
|
<div class="title">
|
519
|
-
<a name="
|
529
|
+
<a name="M000300"></a><b>bracket!</b>(bra, ket=nil)
|
520
530
|
</div>
|
521
531
|
<div class="description">
|
522
532
|
<p>
|
523
533
|
Inplace version of braket.
|
524
534
|
</p>
|
525
|
-
<
|
526
|
-
|
527
|
-
</
|
535
|
+
<p>
|
536
|
+
CREDIT: Trans
|
537
|
+
</p>
|
528
538
|
</div>
|
529
539
|
<div class="sourcecode">
|
530
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
531
|
-
<div id="
|
540
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000300_source')" id="l_M000300_source">+</a> ]</p>
|
541
|
+
<div id="M000300_source" class="dyn-source">
|
532
542
|
<pre>
|
533
543
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 24</span>
|
534
544
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bracket!</span>(<span class="ruby-identifier">bra</span>, <span class="ruby-identifier">ket</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -540,16 +550,16 @@ Inplace version of braket.
|
|
540
550
|
</div>
|
541
551
|
<div class="method">
|
542
552
|
<div class="title">
|
543
|
-
<a name="
|
553
|
+
<a name="M000289"></a><b>bytes</b>()
|
544
554
|
</div>
|
545
555
|
<div class="description">
|
546
556
|
<p>
|
547
|
-
Upacks string into <a href="String.html#
|
557
|
+
Upacks string into <a href="String.html#M000289">bytes</a>.
|
548
558
|
</p>
|
549
559
|
</div>
|
550
560
|
<div class="sourcecode">
|
551
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
552
|
-
<div id="
|
561
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000289_source')" id="l_M000289_source">+</a> ]</p>
|
562
|
+
<div id="M000289_source" class="dyn-source">
|
553
563
|
<pre>
|
554
564
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bytes.rb, line 8</span>
|
555
565
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bytes</span>
|
@@ -561,19 +571,19 @@ Upacks string into <a href="String.html#M000287">bytes</a>.
|
|
561
571
|
</div>
|
562
572
|
<div class="method">
|
563
573
|
<div class="title">
|
564
|
-
<a name="
|
574
|
+
<a name="M000260"></a><b>camelcase</b>(upcase_first_letter=true)
|
565
575
|
</div>
|
566
576
|
<div class="description">
|
567
577
|
<p>
|
568
|
-
Converts a string to <a href="String.html#
|
578
|
+
Converts a string to <a href="String.html#M000260">camelcase</a>.
|
569
579
|
</p>
|
570
580
|
<p>
|
571
|
-
By default <a href="String.html#
|
581
|
+
By default <a href="String.html#M000260">camelcase</a> convert to
|
572
582
|
UpperCamelCase, If an argument is set to <tt>false</tt>, then <a
|
573
|
-
href="String.html#
|
583
|
+
href="String.html#M000260">camelcase</a> will produce lowerCamelCase.
|
574
584
|
</p>
|
575
585
|
<p>
|
576
|
-
<tt><a href="String.html#
|
586
|
+
<tt><a href="String.html#M000260">camelcase</a></tt> also converts
|
577
587
|
’/’ to ’::’ which is useful for converting paths to
|
578
588
|
namespaces.
|
579
589
|
</p>
|
@@ -587,14 +597,14 @@ Examples
|
|
587
597
|
</pre>
|
588
598
|
</div>
|
589
599
|
<div class="sourcecode">
|
590
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
591
|
-
<div id="
|
600
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000260_source')" id="l_M000260_source">+</a> ]</p>
|
601
|
+
<div id="M000260_source" class="dyn-source">
|
592
602
|
<pre>
|
593
603
|
<span class="ruby-comment cmt"># File lib/core/facets/string/camelcase.rb, line 16</span>
|
594
604
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">camelcase</span>(<span class="ruby-identifier">upcase_first_letter</span>=<span class="ruby-keyword kw">true</span>)
|
595
605
|
<span class="ruby-identifier">up</span> = <span class="ruby-identifier">upcase_first_letter</span>
|
596
606
|
<span class="ruby-identifier">str</span> = <span class="ruby-identifier">dup</span>
|
597
|
-
<span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\/(.?)/</span>){ <span class="ruby-node">"::#{$1.upcase}"</span> } <span class="ruby-comment cmt"># NOT SO SURE ABOUT THIS
|
607
|
+
<span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\/(.?)/</span>){ <span class="ruby-node">"::#{$1.upcase}"</span> } <span class="ruby-comment cmt"># NOT SO SURE ABOUT THIS</span>
|
598
608
|
<span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/(?:_+|-+)([a-z])/</span>){ <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">upcase</span> }
|
599
609
|
<span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/(\A|\s)([a-z])/</span>){ <span class="ruby-identifier">$1</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">$2</span>.<span class="ruby-identifier">upcase</span> } <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">up</span>
|
600
610
|
<span class="ruby-identifier">str</span>
|
@@ -615,9 +625,10 @@ Return true if the string is capitalized, otherwise false.
|
|
615
625
|
"THIS".capitalized? #=> true
|
616
626
|
"This".capitalized? #=> true
|
617
627
|
"this".capitalized? #=> false
|
618
|
-
|
619
|
-
CREDIT: Phil Tomson
|
620
628
|
</pre>
|
629
|
+
<p>
|
630
|
+
CREDIT: Phil Tomson
|
631
|
+
</p>
|
621
632
|
</div>
|
622
633
|
<div class="sourcecode">
|
623
634
|
<p class="source-link">[ <a href="javascript:toggleSource('M000282_source')" id="l_M000282_source">+</a> ]</p>
|
@@ -633,7 +644,7 @@ Return true if the string is capitalized, otherwise false.
|
|
633
644
|
</div>
|
634
645
|
<div class="method">
|
635
646
|
<div class="title">
|
636
|
-
<a name="
|
647
|
+
<a name="M000305"></a><b>chars</b>()
|
637
648
|
</div>
|
638
649
|
<div class="description">
|
639
650
|
<p>
|
@@ -644,8 +655,8 @@ Returns an array of characters.
|
|
644
655
|
</pre>
|
645
656
|
</div>
|
646
657
|
<div class="sourcecode">
|
647
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
648
|
-
<div id="
|
658
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000305_source')" id="l_M000305_source">+</a> ]</p>
|
659
|
+
<div id="M000305_source" class="dyn-source">
|
649
660
|
<pre>
|
650
661
|
<span class="ruby-comment cmt"># File lib/core/facets/string/chars.rb, line 9</span>
|
651
662
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chars</span>
|
@@ -657,19 +668,19 @@ Returns an array of characters.
|
|
657
668
|
</div>
|
658
669
|
<div class="method">
|
659
670
|
<div class="title">
|
660
|
-
<a name="
|
671
|
+
<a name="M000297"></a><b>cleave</b>(threshold=nil, len=nil)
|
661
672
|
</div>
|
662
673
|
<div class="description">
|
663
674
|
<p>
|
664
675
|
Cleave a string. Break a string in two parts at the nearest whitespace.
|
665
676
|
</p>
|
666
|
-
<
|
667
|
-
|
668
|
-
</
|
677
|
+
<p>
|
678
|
+
CREDIT: Trans
|
679
|
+
</p>
|
669
680
|
</div>
|
670
681
|
<div class="sourcecode">
|
671
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
672
|
-
<div id="
|
682
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000297_source')" id="l_M000297_source">+</a> ]</p>
|
683
|
+
<div id="M000297_source" class="dyn-source">
|
673
684
|
<pre>
|
674
685
|
<span class="ruby-comment cmt"># File lib/core/facets/string/cleave.rb, line 8</span>
|
675
686
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cleave</span>(<span class="ruby-identifier">threshold</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">len</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -705,7 +716,7 @@ Cleave a string. Break a string in two parts at the nearest whitespace.
|
|
705
716
|
</div>
|
706
717
|
<div class="method">
|
707
718
|
<div class="title">
|
708
|
-
<a name="
|
719
|
+
<a name="M000253"></a><b>cmp</b>(other)
|
709
720
|
</div>
|
710
721
|
<div class="description">
|
711
722
|
<p>
|
@@ -717,13 +728,14 @@ compatible with succ.
|
|
717
728
|
"abcd".cmp("abc") #=> 1
|
718
729
|
"abc".cmp("abcd") #=> -1
|
719
730
|
"xyz".cmp("abc") #=> 1
|
720
|
-
|
721
|
-
CREDIT Peter Vanbroekhoven
|
722
731
|
</pre>
|
732
|
+
<p>
|
733
|
+
CREDIT: Peter Vanbroekhoven
|
734
|
+
</p>
|
723
735
|
</div>
|
724
736
|
<div class="sourcecode">
|
725
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
726
|
-
<div id="
|
737
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000253_source')" id="l_M000253_source">+</a> ]</p>
|
738
|
+
<div id="M000253_source" class="dyn-source">
|
727
739
|
<pre>
|
728
740
|
<span class="ruby-comment cmt"># File lib/core/facets/comparable/cmp.rb, line 31</span>
|
729
741
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cmp</span>(<span class="ruby-identifier">other</span>)
|
@@ -737,7 +749,38 @@ compatible with succ.
|
|
737
749
|
</div>
|
738
750
|
<div class="method">
|
739
751
|
<div class="title">
|
740
|
-
<a name="
|
752
|
+
<a name="M000272"></a><b>compress_lines</b>(spaced = true)
|
753
|
+
</div>
|
754
|
+
<div class="description">
|
755
|
+
<p>
|
756
|
+
Matches any whitespace (including newline) and replaces with a single space
|
757
|
+
</p>
|
758
|
+
<p>
|
759
|
+
@example
|
760
|
+
</p>
|
761
|
+
<pre>
|
762
|
+
<<-QUERY.compress_lines
|
763
|
+
SELECT name
|
764
|
+
FROM users
|
765
|
+
QUERY
|
766
|
+
=> "SELECT name FROM users"
|
767
|
+
</pre>
|
768
|
+
</div>
|
769
|
+
<div class="sourcecode">
|
770
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000272_source')" id="l_M000272_source">+</a> ]</p>
|
771
|
+
<div id="M000272_source" class="dyn-source">
|
772
|
+
<pre>
|
773
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/compress_lines.rb, line 12</span>
|
774
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compress_lines</span>(<span class="ruby-identifier">spaced</span> = <span class="ruby-keyword kw">true</span>)
|
775
|
+
<span class="ruby-identifier">split</span>(<span class="ruby-identifier">$/</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">strip</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">spaced</span> <span class="ruby-value">? </span><span class="ruby-value str">' '</span> <span class="ruby-operator">:</span> <span class="ruby-value str">''</span>)
|
776
|
+
<span class="ruby-keyword kw">end</span>
|
777
|
+
</pre>
|
778
|
+
</div>
|
779
|
+
</div>
|
780
|
+
</div>
|
781
|
+
<div class="method">
|
782
|
+
<div class="title">
|
783
|
+
<a name="M000304"></a><b>dequote</b>()
|
741
784
|
</div>
|
742
785
|
<div class="description">
|
743
786
|
<p>
|
@@ -745,13 +788,14 @@ Remove quotes from string.
|
|
745
788
|
</p>
|
746
789
|
<pre>
|
747
790
|
"'hi'".dequite #=> "hi"
|
748
|
-
|
749
|
-
CREDIT: Trans
|
750
791
|
</pre>
|
792
|
+
<p>
|
793
|
+
CREDIT: Trans
|
794
|
+
</p>
|
751
795
|
</div>
|
752
796
|
<div class="sourcecode">
|
753
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
754
|
-
<div id="
|
797
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000304_source')" id="l_M000304_source">+</a> ]</p>
|
798
|
+
<div id="M000304_source" class="dyn-source">
|
755
799
|
<pre>
|
756
800
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 88</span>
|
757
801
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dequote</span>
|
@@ -775,7 +819,7 @@ Remove quotes from string.
|
|
775
819
|
</div>
|
776
820
|
<div class="method">
|
777
821
|
<div class="title">
|
778
|
-
<a name="
|
822
|
+
<a name="M000279"></a><b>divide</b>( re )
|
779
823
|
</div>
|
780
824
|
<div class="description">
|
781
825
|
<p>
|
@@ -791,13 +835,14 @@ scan, but includes the matches.
|
|
791
835
|
</p>
|
792
836
|
<pre>
|
793
837
|
["<p>This", "<b>is", "</b>a test.", "</p>"]
|
794
|
-
|
795
|
-
CREDIT: Trans
|
796
838
|
</pre>
|
839
|
+
<p>
|
840
|
+
CREDIT: Trans
|
841
|
+
</p>
|
797
842
|
</div>
|
798
843
|
<div class="sourcecode">
|
799
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
800
|
-
<div id="
|
844
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000279_source')" id="l_M000279_source">+</a> ]</p>
|
845
|
+
<div id="M000279_source" class="dyn-source">
|
801
846
|
<pre>
|
802
847
|
<span class="ruby-comment cmt"># File lib/core/facets/string/divide.rb, line 15</span>
|
803
848
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">divide</span>( <span class="ruby-identifier">re</span> )
|
@@ -820,9 +865,10 @@ Return true if the string is lowercase (downcase), otherwise false.
|
|
820
865
|
"THIS".downcase? #=> false
|
821
866
|
"This".downcase? #=> false
|
822
867
|
"this".downcase? #=> true
|
823
|
-
|
824
|
-
CREDIT: Phil Tomson
|
825
868
|
</pre>
|
869
|
+
<p>
|
870
|
+
CREDIT: Phil Tomson
|
871
|
+
</p>
|
826
872
|
</div>
|
827
873
|
<div class="sourcecode">
|
828
874
|
<p class="source-link">[ <a href="javascript:toggleSource('M000283_source')" id="l_M000283_source">+</a> ]</p>
|
@@ -838,7 +884,7 @@ Return true if the string is lowercase (downcase), otherwise false.
|
|
838
884
|
</div>
|
839
885
|
<div class="method">
|
840
886
|
<div class="title">
|
841
|
-
<a name="
|
887
|
+
<a name="M000278"></a><b>each_char</b>() {|scanner.scan(char || break)| ...}
|
842
888
|
</div>
|
843
889
|
<div class="description">
|
844
890
|
<p>
|
@@ -848,8 +894,8 @@ appropriately.
|
|
848
894
|
</p>
|
849
895
|
</div>
|
850
896
|
<div class="sourcecode">
|
851
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
852
|
-
<div id="
|
897
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000278_source')" id="l_M000278_source">+</a> ]</p>
|
898
|
+
<div id="M000278_source" class="dyn-source">
|
853
899
|
<pre>
|
854
900
|
<span class="ruby-comment cmt"># File lib/core/facets/string/each_char.rb, line 22</span>
|
855
901
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_char</span>
|
@@ -862,7 +908,7 @@ appropriately.
|
|
862
908
|
</div>
|
863
909
|
<div class="method">
|
864
910
|
<div class="title">
|
865
|
-
<a name="
|
911
|
+
<a name="M000312"></a><b>each_word</b>(&block)
|
866
912
|
</div>
|
867
913
|
<div class="description">
|
868
914
|
<p>
|
@@ -873,8 +919,8 @@ Iterate through each word of a string.
|
|
873
919
|
</pre>
|
874
920
|
</div>
|
875
921
|
<div class="sourcecode">
|
876
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
877
|
-
<div id="
|
922
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000312_source')" id="l_M000312_source">+</a> ]</p>
|
923
|
+
<div id="M000312_source" class="dyn-source">
|
878
924
|
<pre>
|
879
925
|
<span class="ruby-comment cmt"># File lib/core/facets/string/each_word.rb, line 9</span>
|
880
926
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_word</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
@@ -886,7 +932,7 @@ Iterate through each word of a string.
|
|
886
932
|
</div>
|
887
933
|
<div class="method">
|
888
934
|
<div class="title">
|
889
|
-
<a name="
|
935
|
+
<a name="M000259"></a><b>end_with?</b>(suffix)
|
890
936
|
</div>
|
891
937
|
<div class="description">
|
892
938
|
<p>
|
@@ -895,16 +941,16 @@ Does a string end with the given suffix?
|
|
895
941
|
<pre>
|
896
942
|
"hello".ends_with?("lo") #=> true
|
897
943
|
"hello".ends_with?("to") #=> false
|
898
|
-
|
899
|
-
CREDIT: Lucas Carlson
|
900
|
-
CREDIT: Blaine Cook
|
901
944
|
</pre>
|
945
|
+
<p>
|
946
|
+
CREDIT: Lucas Carlson, Blaine Cook
|
947
|
+
</p>
|
902
948
|
</div>
|
903
949
|
<div class="sourcecode">
|
904
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
905
|
-
<div id="
|
950
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000259_source')" id="l_M000259_source">+</a> ]</p>
|
951
|
+
<div id="M000259_source" class="dyn-source">
|
906
952
|
<pre>
|
907
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/start_with.rb, line
|
953
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/start_with.rb, line 23</span>
|
908
954
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">end_with?</span>(<span class="ruby-identifier">suffix</span>)
|
909
955
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-identifier">suffix</span>) <span class="ruby-operator">==</span> <span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">suffix</span>.<span class="ruby-identifier">size</span>
|
910
956
|
<span class="ruby-keyword kw">end</span>
|
@@ -914,7 +960,7 @@ Does a string end with the given suffix?
|
|
914
960
|
</div>
|
915
961
|
<div class="method">
|
916
962
|
<div class="title">
|
917
|
-
<a name="
|
963
|
+
<a name="M000285"></a><b>expand_tab</b>(n=8)
|
918
964
|
</div>
|
919
965
|
<div class="description">
|
920
966
|
<p>
|
@@ -922,21 +968,26 @@ Expands tabs to <tt>n</tt> spaces. Non-destructive. If <tt>n</tt> is 0,
|
|
922
968
|
then tabs are simply removed. Raises an exception if <tt>n</tt> is
|
923
969
|
negative.
|
924
970
|
</p>
|
971
|
+
<pre>
|
972
|
+
"\t\tHey".expand_tab(2) #=> " Hey"
|
973
|
+
</pre>
|
925
974
|
<p>
|
926
975
|
Thanks to GGaramuno for a more efficient algorithm. Very nice.
|
927
976
|
</p>
|
928
|
-
<
|
929
|
-
|
930
|
-
|
931
|
-
CREDIT: GGaramuno
|
932
|
-
</pre>
|
977
|
+
<p>
|
978
|
+
CREDIT: Gavin Sinclair, Noah Gibbs, GGaramuno
|
979
|
+
</p>
|
933
980
|
</div>
|
981
|
+
<div class="aka">
|
982
|
+
This method is also aliased as
|
983
|
+
<a href="String.html#M000286">expand_tabs</a>
|
984
|
+
</div>
|
934
985
|
<div class="sourcecode">
|
935
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
936
|
-
<div id="
|
986
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000285_source')" id="l_M000285_source">+</a> ]</p>
|
987
|
+
<div id="M000285_source" class="dyn-source">
|
937
988
|
<pre>
|
938
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/
|
939
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
989
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/expand_tab.rb, line 13</span>
|
990
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expand_tab</span>(<span class="ruby-identifier">n</span>=<span class="ruby-value">8</span>)
|
940
991
|
<span class="ruby-identifier">n</span> = <span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_int</span>
|
941
992
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"n must be >= 0"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator"><</span> <span class="ruby-value">0</span>
|
942
993
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\t/</span>, <span class="ruby-value str">""</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
@@ -956,12 +1007,22 @@ Thanks to GGaramuno for a more efficient algorithm. Very nice.
|
|
956
1007
|
</div>
|
957
1008
|
<div class="method">
|
958
1009
|
<div class="title">
|
959
|
-
<a name="
|
1010
|
+
<a name="M000286"></a><b>expand_tabs</b>(n=8)
|
960
1011
|
</div>
|
961
1012
|
<div class="description">
|
962
1013
|
<p>
|
963
|
-
|
964
|
-
|
1014
|
+
Alias for <a href="String.html#M000285">expand_tab</a>
|
1015
|
+
</p>
|
1016
|
+
</div>
|
1017
|
+
</div>
|
1018
|
+
<div class="method">
|
1019
|
+
<div class="title">
|
1020
|
+
<a name="M000257"></a><b>fold</b>(ignore_indented=false)
|
1021
|
+
</div>
|
1022
|
+
<div class="description">
|
1023
|
+
<p>
|
1024
|
+
Returns a new string with all new <a href="String.html#M000261">lines</a>
|
1025
|
+
removed from adjacent <a href="String.html#M000261">lines</a> of text.
|
965
1026
|
</p>
|
966
1027
|
<pre>
|
967
1028
|
s = "This is\na test.\n\nIt clumps\nlines of text."
|
@@ -977,13 +1038,13 @@ removed from adjacent <a href="String.html#M000257">lines</a> of text.
|
|
977
1038
|
One arguable flaw with this, that might need a fix: if the given string
|
978
1039
|
ends in a newline, it is replaced with a single space.
|
979
1040
|
</p>
|
980
|
-
<
|
981
|
-
|
982
|
-
</
|
1041
|
+
<p>
|
1042
|
+
CREDIT: Trans
|
1043
|
+
</p>
|
983
1044
|
</div>
|
984
1045
|
<div class="sourcecode">
|
985
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
986
|
-
<div id="
|
1046
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000257_source')" id="l_M000257_source">+</a> ]</p>
|
1047
|
+
<div id="M000257_source" class="dyn-source">
|
987
1048
|
<pre>
|
988
1049
|
<span class="ruby-comment cmt"># File lib/core/facets/string/fold.rb, line 19</span>
|
989
1050
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fold</span>(<span class="ruby-identifier">ignore_indented</span>=<span class="ruby-keyword kw">false</span>)
|
@@ -1010,24 +1071,23 @@ ends in a newline, it is replaced with a single space.
|
|
1010
1071
|
</div>
|
1011
1072
|
<div class="method">
|
1012
1073
|
<div class="title">
|
1013
|
-
<a name="
|
1074
|
+
<a name="M000291"></a><b>indent</b>(n)
|
1014
1075
|
</div>
|
1015
1076
|
<div class="description">
|
1016
1077
|
<p>
|
1017
1078
|
Indent left or right by n spaces. (This used to be called <a
|
1018
|
-
href="String.html#
|
1019
|
-
href="String.html#
|
1079
|
+
href="String.html#M000269">tab</a> and aliased as <a
|
1080
|
+
href="String.html#M000291">indent</a>.)
|
1081
|
+
</p>
|
1082
|
+
<p>
|
1083
|
+
CREDIT: Gavin Sinclair, Trans
|
1020
1084
|
</p>
|
1021
|
-
<pre>
|
1022
|
-
CREDIT: Gavin Sinclair
|
1023
|
-
CREDIT: Trans
|
1024
|
-
</pre>
|
1025
1085
|
</div>
|
1026
1086
|
<div class="sourcecode">
|
1027
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1028
|
-
<div id="
|
1087
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000291_source')" id="l_M000291_source">+</a> ]</p>
|
1088
|
+
<div id="M000291_source" class="dyn-source">
|
1029
1089
|
<pre>
|
1030
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/
|
1090
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/indent.rb, line 8</span>
|
1031
1091
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">indent</span>(<span class="ruby-identifier">n</span>)
|
1032
1092
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator">>=</span> <span class="ruby-value">0</span>
|
1033
1093
|
<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^/</span>, <span class="ruby-value str">' '</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">n</span>)
|
@@ -1041,7 +1101,7 @@ href="String.html#M000269">indent</a>.)
|
|
1041
1101
|
</div>
|
1042
1102
|
<div class="method">
|
1043
1103
|
<div class="title">
|
1044
|
-
<a name="
|
1104
|
+
<a name="M000276"></a><b>index_all</b>(s, reuse=false)
|
1045
1105
|
</div>
|
1046
1106
|
<div class="description">
|
1047
1107
|
<p>
|
@@ -1053,13 +1113,15 @@ allows the trailing portion of a match to be reused for subsquent matches.
|
|
1053
1113
|
|
1054
1114
|
"bbb".index_all('bb', false) #=> [0]
|
1055
1115
|
"bbb".index_all('bb', true) #=> [0,1]
|
1056
|
-
|
1057
|
-
TODO: Culd probably be defined for Indexable in general too.
|
1058
1116
|
</pre>
|
1117
|
+
<p>
|
1118
|
+
TODO: Culd probably be defined for <a href="Indexable.html">Indexable</a>
|
1119
|
+
in general too.
|
1120
|
+
</p>
|
1059
1121
|
</div>
|
1060
1122
|
<div class="sourcecode">
|
1061
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1062
|
-
<div id="
|
1123
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000276_source')" id="l_M000276_source">+</a> ]</p>
|
1124
|
+
<div id="M000276_source" class="dyn-source">
|
1063
1125
|
<pre>
|
1064
1126
|
<span class="ruby-comment cmt"># File lib/core/facets/string/range.rb, line 66</span>
|
1065
1127
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index_all</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">reuse</span>=<span class="ruby-keyword kw">false</span>)
|
@@ -1077,7 +1139,7 @@ allows the trailing portion of a match to be reused for subsquent matches.
|
|
1077
1139
|
</div>
|
1078
1140
|
<div class="method">
|
1079
1141
|
<div class="title">
|
1080
|
-
<a name="
|
1142
|
+
<a name="M000306"></a><b>lchomp</b>(match)
|
1081
1143
|
</div>
|
1082
1144
|
<div class="description">
|
1083
1145
|
<p>
|
@@ -1086,13 +1148,14 @@ Left chomp.
|
|
1086
1148
|
<pre>
|
1087
1149
|
"help".lchomp("h") #=> "elp"
|
1088
1150
|
"help".lchomp("k") #=> "help"
|
1089
|
-
|
1090
|
-
CREDIT: Trans
|
1091
1151
|
</pre>
|
1152
|
+
<p>
|
1153
|
+
CREDIT: Trans
|
1154
|
+
</p>
|
1092
1155
|
</div>
|
1093
1156
|
<div class="sourcecode">
|
1094
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1095
|
-
<div id="
|
1157
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000306_source')" id="l_M000306_source">+</a> ]</p>
|
1158
|
+
<div id="M000306_source" class="dyn-source">
|
1096
1159
|
<pre>
|
1097
1160
|
<span class="ruby-comment cmt"># File lib/core/facets/string/chomp.rb, line 10</span>
|
1098
1161
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lchomp</span>(<span class="ruby-identifier">match</span>)
|
@@ -1108,7 +1171,7 @@ Left chomp.
|
|
1108
1171
|
</div>
|
1109
1172
|
<div class="method">
|
1110
1173
|
<div class="title">
|
1111
|
-
<a name="
|
1174
|
+
<a name="M000307"></a><b>lchomp!</b>(match)
|
1112
1175
|
</div>
|
1113
1176
|
<div class="description">
|
1114
1177
|
<p>
|
@@ -1117,13 +1180,14 @@ In-place left chomp.
|
|
1117
1180
|
<pre>
|
1118
1181
|
"help".lchomp("h") #=> "elp"
|
1119
1182
|
"help".lchomp("k") #=> "help"
|
1120
|
-
|
1121
|
-
CREDIT: Trans
|
1122
1183
|
</pre>
|
1184
|
+
<p>
|
1185
|
+
CREDIT: Trans
|
1186
|
+
</p>
|
1123
1187
|
</div>
|
1124
1188
|
<div class="sourcecode">
|
1125
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1126
|
-
<div id="
|
1189
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000307_source')" id="l_M000307_source">+</a> ]</p>
|
1190
|
+
<div id="M000307_source" class="dyn-source">
|
1127
1191
|
<pre>
|
1128
1192
|
<span class="ruby-comment cmt"># File lib/core/facets/string/chomp.rb, line 25</span>
|
1129
1193
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lchomp!</span>(<span class="ruby-identifier">match</span>)
|
@@ -1138,7 +1202,7 @@ In-place left chomp.
|
|
1138
1202
|
</div>
|
1139
1203
|
<div class="method">
|
1140
1204
|
<div class="title">
|
1141
|
-
<a name="
|
1205
|
+
<a name="M000298"></a><b>line_wrap</b>(width, tabs=4)
|
1142
1206
|
</div>
|
1143
1207
|
<div class="description">
|
1144
1208
|
<p>
|
@@ -1153,13 +1217,14 @@ Line wrap at width.
|
|
1153
1217
|
<pre>
|
1154
1218
|
12345
|
1155
1219
|
67890
|
1156
|
-
|
1157
|
-
CREDIT: Trans
|
1158
1220
|
</pre>
|
1221
|
+
<p>
|
1222
|
+
CREDIT: Trans
|
1223
|
+
</p>
|
1159
1224
|
</div>
|
1160
1225
|
<div class="sourcecode">
|
1161
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1162
|
-
<div id="
|
1226
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000298_source')" id="l_M000298_source">+</a> ]</p>
|
1227
|
+
<div id="M000298_source" class="dyn-source">
|
1163
1228
|
<pre>
|
1164
1229
|
<span class="ruby-comment cmt"># File lib/core/facets/string/line_wrap.rb, line 14</span>
|
1165
1230
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">line_wrap</span>(<span class="ruby-identifier">width</span>, <span class="ruby-identifier">tabs</span>=<span class="ruby-value">4</span>)
|
@@ -1174,7 +1239,7 @@ Line wrap at width.
|
|
1174
1239
|
</div>
|
1175
1240
|
<div class="method">
|
1176
1241
|
<div class="title">
|
1177
|
-
<a name="
|
1242
|
+
<a name="M000261"></a><b>lines</b>()
|
1178
1243
|
</div>
|
1179
1244
|
<div class="description">
|
1180
1245
|
<p>
|
@@ -1185,8 +1250,8 @@ Returns an array of characters.
|
|
1185
1250
|
</pre>
|
1186
1251
|
</div>
|
1187
1252
|
<div class="sourcecode">
|
1188
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1189
|
-
<div id="
|
1253
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000261_source')" id="l_M000261_source">+</a> ]</p>
|
1254
|
+
<div id="M000261_source" class="dyn-source">
|
1190
1255
|
<pre>
|
1191
1256
|
<span class="ruby-comment cmt"># File lib/core/facets/string/lines.rb, line 9</span>
|
1192
1257
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lines</span>
|
@@ -1198,11 +1263,11 @@ Returns an array of characters.
|
|
1198
1263
|
</div>
|
1199
1264
|
<div class="method">
|
1200
1265
|
<div class="title">
|
1201
|
-
<a name="
|
1266
|
+
<a name="M000280"></a><b>margin</b>(n=0)
|
1202
1267
|
</div>
|
1203
1268
|
<div class="description">
|
1204
1269
|
<p>
|
1205
|
-
Provides a <a href="String.html#
|
1270
|
+
Provides a <a href="String.html#M000280">margin</a> controlled string.
|
1206
1271
|
</p>
|
1207
1272
|
<pre>
|
1208
1273
|
x = %Q{
|
@@ -1210,17 +1275,19 @@ Provides a <a href="String.html#M000271">margin</a> controlled string.
|
|
1210
1275
|
| is
|
1211
1276
|
| margin controlled!
|
1212
1277
|
}.margin
|
1213
|
-
|
1214
|
-
NOTE: This may still need a bit of tweaking.
|
1215
|
-
|
1216
|
-
CREDIT: Trans
|
1217
1278
|
</pre>
|
1279
|
+
<p>
|
1280
|
+
NOTE: This may still need a bit of tweaking.
|
1281
|
+
</p>
|
1282
|
+
<p>
|
1283
|
+
CREDIT: Trans
|
1284
|
+
</p>
|
1218
1285
|
</div>
|
1219
1286
|
<div class="sourcecode">
|
1220
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1221
|
-
<div id="
|
1287
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000280_source')" id="l_M000280_source">+</a> ]</p>
|
1288
|
+
<div id="M000280_source" class="dyn-source">
|
1222
1289
|
<pre>
|
1223
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/
|
1290
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/margin.rb, line 16</span>
|
1224
1291
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">margin</span>(<span class="ruby-identifier">n</span>=<span class="ruby-value">0</span>)
|
1225
1292
|
<span class="ruby-comment cmt">#d = /\A.*\n\s*(.)/.match( self )[1]</span>
|
1226
1293
|
<span class="ruby-comment cmt">#d = /\A\s*(.)/.match( self)[1] unless d</span>
|
@@ -1239,7 +1306,7 @@ Provides a <a href="String.html#M000271">margin</a> controlled string.
|
|
1239
1306
|
</div>
|
1240
1307
|
<div class="method">
|
1241
1308
|
<div class="title">
|
1242
|
-
<a name="
|
1309
|
+
<a name="M000270"></a><b>methodize</b>()
|
1243
1310
|
</div>
|
1244
1311
|
<div class="description">
|
1245
1312
|
<p>
|
@@ -1250,14 +1317,14 @@ Translate a (class or module) name to a suitable method name.
|
|
1250
1317
|
</pre>
|
1251
1318
|
</div>
|
1252
1319
|
<div class="sourcecode">
|
1253
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1254
|
-
<div id="
|
1320
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000270_source')" id="l_M000270_source">+</a> ]</p>
|
1321
|
+
<div id="M000270_source" class="dyn-source">
|
1255
1322
|
<pre>
|
1256
1323
|
<span class="ruby-comment cmt"># File lib/core/facets/string/methodize.rb, line 7</span>
|
1257
1324
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">methodize</span>
|
1258
1325
|
<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([A-Z]+)([A-Z])/</span>,<span class="ruby-value str">'\1_\2'</span>).
|
1259
1326
|
<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([a-z])([A-Z])/</span>,<span class="ruby-value str">'\1_\2'</span>).
|
1260
|
-
<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'/'</span
|
1327
|
+
<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'/'</span> ,<span class="ruby-value str">'__'</span>).
|
1261
1328
|
<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'::'</span>,<span class="ruby-value str">'__'</span>).
|
1262
1329
|
<span class="ruby-identifier">downcase</span>
|
1263
1330
|
<span class="ruby-keyword kw">end</span>
|
@@ -1267,14 +1334,14 @@ Translate a (class or module) name to a suitable method name.
|
|
1267
1334
|
</div>
|
1268
1335
|
<div class="method">
|
1269
1336
|
<div class="title">
|
1270
|
-
<a name="
|
1337
|
+
<a name="M000262"></a><b>modulize</b>()
|
1271
1338
|
</div>
|
1272
1339
|
<div class="description">
|
1273
1340
|
<p>
|
1274
1341
|
Converts a string to module name representation.
|
1275
1342
|
</p>
|
1276
1343
|
<p>
|
1277
|
-
This is essentially <a href="String.html#
|
1344
|
+
This is essentially <a href="String.html#M000260">camelcase</a>. It also
|
1278
1345
|
converts ’/’ to ’::’ which is useful for converting
|
1279
1346
|
paths to namespaces.
|
1280
1347
|
</p>
|
@@ -1287,8 +1354,8 @@ Examples
|
|
1287
1354
|
</pre>
|
1288
1355
|
</div>
|
1289
1356
|
<div class="sourcecode">
|
1290
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1291
|
-
<div id="
|
1357
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000262_source')" id="l_M000262_source">+</a> ]</p>
|
1358
|
+
<div id="M000262_source" class="dyn-source">
|
1292
1359
|
<pre>
|
1293
1360
|
<span class="ruby-comment cmt"># File lib/core/facets/string/modulize.rb, line 13</span>
|
1294
1361
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">modulize</span>
|
@@ -1310,9 +1377,9 @@ Examples
|
|
1310
1377
|
Like scan but returns <a href="MatchData.html">MatchData</a> ($~) rather
|
1311
1378
|
then matched string ($&).
|
1312
1379
|
</p>
|
1313
|
-
<
|
1314
|
-
|
1315
|
-
</
|
1380
|
+
<p>
|
1381
|
+
CREDIT: Trans
|
1382
|
+
</p>
|
1316
1383
|
</div>
|
1317
1384
|
<div class="sourcecode">
|
1318
1385
|
<p class="source-link">[ <a href="javascript:toggleSource('M000281_source')" id="l_M000281_source">+</a> ]</p>
|
@@ -1334,7 +1401,7 @@ then matched string ($&).
|
|
1334
1401
|
</div>
|
1335
1402
|
<div class="method">
|
1336
1403
|
<div class="title">
|
1337
|
-
<a name="
|
1404
|
+
<a name="M000287"></a><b>natcmp</b>(str2, caseInsensitive=false)
|
1338
1405
|
</div>
|
1339
1406
|
<div class="description">
|
1340
1407
|
<p>
|
@@ -1351,16 +1418,16 @@ which does not follow alphabetically. A secondary parameter, if set to
|
|
1351
1418
|
"Hello.10".natcmp("Hello.1") #=> -1
|
1352
1419
|
|
1353
1420
|
TODO: Invert case flag?
|
1354
|
-
|
1355
|
-
CREDIT: Alan Davies
|
1356
|
-
CREDIT: Martin Pool
|
1357
1421
|
</pre>
|
1422
|
+
<p>
|
1423
|
+
CREDIT: Alan Davies, Martin Pool
|
1424
|
+
</p>
|
1358
1425
|
</div>
|
1359
1426
|
<div class="sourcecode">
|
1360
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1361
|
-
<div id="
|
1427
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000287_source')" id="l_M000287_source">+</a> ]</p>
|
1428
|
+
<div id="M000287_source" class="dyn-source">
|
1362
1429
|
<pre>
|
1363
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/natcmp.rb, line
|
1430
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/natcmp.rb, line 46</span>
|
1364
1431
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">natcmp</span>(<span class="ruby-identifier">str2</span>, <span class="ruby-identifier">caseInsensitive</span>=<span class="ruby-keyword kw">false</span>)
|
1365
1432
|
<span class="ruby-identifier">str1</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
|
1366
1433
|
<span class="ruby-identifier">str2</span> = <span class="ruby-identifier">str2</span>.<span class="ruby-identifier">dup</span>
|
@@ -1409,7 +1476,7 @@ which does not follow alphabetically. A secondary parameter, if set to
|
|
1409
1476
|
</div>
|
1410
1477
|
<div class="method">
|
1411
1478
|
<div class="title">
|
1412
|
-
<a name="
|
1479
|
+
<a name="M000310"></a><b>nchar</b>(n, replacement=nil)
|
1413
1480
|
</div>
|
1414
1481
|
<div class="description">
|
1415
1482
|
<p>
|
@@ -1426,15 +1493,13 @@ Alternatively a replacement string can be given, which will replace the
|
|
1426
1493
|
str.nchar(4) #=> "this"
|
1427
1494
|
str.nchar(4, 'that') #=> "that"
|
1428
1495
|
str #=> "that is text"
|
1429
|
-
|
1430
|
-
CREDIT: ?
|
1431
1496
|
</pre>
|
1432
1497
|
</div>
|
1433
1498
|
<div class="sourcecode">
|
1434
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1435
|
-
<div id="
|
1499
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000310_source')" id="l_M000310_source">+</a> ]</p>
|
1500
|
+
<div id="M000310_source" class="dyn-source">
|
1436
1501
|
<pre>
|
1437
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/nchar.rb, line
|
1502
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/nchar.rb, line 15</span>
|
1438
1503
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nchar</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">replacement</span>=<span class="ruby-keyword kw">nil</span>)
|
1439
1504
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replacement</span>
|
1440
1505
|
<span class="ruby-identifier">s</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
|
@@ -1450,21 +1515,21 @@ Alternatively a replacement string can be given, which will replace the
|
|
1450
1515
|
</div>
|
1451
1516
|
<div class="method">
|
1452
1517
|
<div class="title">
|
1453
|
-
<a name="
|
1518
|
+
<a name="M000292"></a><b>outdent</b>(n)
|
1454
1519
|
</div>
|
1455
1520
|
<div class="description">
|
1456
1521
|
<p>
|
1457
1522
|
Outdent just indents a negative number of spaces.
|
1458
1523
|
</p>
|
1459
|
-
<
|
1460
|
-
|
1461
|
-
</
|
1524
|
+
<p>
|
1525
|
+
CREDIT: Noah Gibbs
|
1526
|
+
</p>
|
1462
1527
|
</div>
|
1463
1528
|
<div class="sourcecode">
|
1464
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1465
|
-
<div id="
|
1529
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000292_source')" id="l_M000292_source">+</a> ]</p>
|
1530
|
+
<div id="M000292_source" class="dyn-source">
|
1466
1531
|
<pre>
|
1467
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/
|
1532
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/indent.rb, line 20</span>
|
1468
1533
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">outdent</span>(<span class="ruby-identifier">n</span>)
|
1469
1534
|
<span class="ruby-identifier">indent</span>(<span class="ruby-operator">-</span><span class="ruby-identifier">n</span>)
|
1470
1535
|
<span class="ruby-keyword kw">end</span>
|
@@ -1474,7 +1539,7 @@ Outdent just indents a negative number of spaces.
|
|
1474
1539
|
</div>
|
1475
1540
|
<div class="method">
|
1476
1541
|
<div class="title">
|
1477
|
-
<a name="
|
1542
|
+
<a name="M000290"></a><b>pathize</b>()
|
1478
1543
|
</div>
|
1479
1544
|
<div class="description">
|
1480
1545
|
<p>
|
@@ -1485,8 +1550,8 @@ Converts a (class or module) name to a unix path.
|
|
1485
1550
|
</pre>
|
1486
1551
|
</div>
|
1487
1552
|
<div class="sourcecode">
|
1488
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1489
|
-
<div id="
|
1553
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000290_source')" id="l_M000290_source">+</a> ]</p>
|
1554
|
+
<div id="M000290_source" class="dyn-source">
|
1490
1555
|
<pre>
|
1491
1556
|
<span class="ruby-comment cmt"># File lib/core/facets/string/pathize.rb, line 7</span>
|
1492
1557
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pathize</span>
|
@@ -1502,7 +1567,7 @@ Converts a (class or module) name to a unix path.
|
|
1502
1567
|
</div>
|
1503
1568
|
<div class="method">
|
1504
1569
|
<div class="title">
|
1505
|
-
<a name="
|
1570
|
+
<a name="M000303"></a><b>quote</b>(type=:s)
|
1506
1571
|
</div>
|
1507
1572
|
<div class="description">
|
1508
1573
|
<p>
|
@@ -1512,13 +1577,14 @@ then assumes single quotes.
|
|
1512
1577
|
<pre>
|
1513
1578
|
"quote me".quote #=> "'quote me'"
|
1514
1579
|
"quote me".quote(2) #=> "\"quote me\""
|
1515
|
-
|
1516
|
-
CREDIT: Trans
|
1517
1580
|
</pre>
|
1581
|
+
<p>
|
1582
|
+
CREDIT: Trans
|
1583
|
+
</p>
|
1518
1584
|
</div>
|
1519
1585
|
<div class="sourcecode">
|
1520
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1521
|
-
<div id="
|
1586
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000303_source')" id="l_M000303_source">+</a> ]</p>
|
1587
|
+
<div id="M000303_source" class="dyn-source">
|
1522
1588
|
<pre>
|
1523
1589
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 69</span>
|
1524
1590
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quote</span>(<span class="ruby-identifier">type</span>=<span class="ruby-identifier">:s</span>)
|
@@ -1539,7 +1605,7 @@ then assumes single quotes.
|
|
1539
1605
|
</div>
|
1540
1606
|
<div class="method">
|
1541
1607
|
<div class="title">
|
1542
|
-
<a name="
|
1608
|
+
<a name="M000273"></a><b>range</b>(s, offset=0)
|
1543
1609
|
</div>
|
1544
1610
|
<div class="description">
|
1545
1611
|
<p>
|
@@ -1547,13 +1613,14 @@ Like index but returns a <a href="Range.html">Range</a>.
|
|
1547
1613
|
</p>
|
1548
1614
|
<pre>
|
1549
1615
|
"This is a test!".range('test') #=> 10..13
|
1550
|
-
|
1551
|
-
CREDIT: Trans
|
1552
1616
|
</pre>
|
1617
|
+
<p>
|
1618
|
+
CREDIT: Trans
|
1619
|
+
</p>
|
1553
1620
|
</div>
|
1554
1621
|
<div class="sourcecode">
|
1555
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1556
|
-
<div id="
|
1622
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000273_source')" id="l_M000273_source">+</a> ]</p>
|
1623
|
+
<div id="M000273_source" class="dyn-source">
|
1557
1624
|
<pre>
|
1558
1625
|
<span class="ruby-comment cmt"># File lib/core/facets/string/range.rb, line 9</span>
|
1559
1626
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">range</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">offset</span>=<span class="ruby-value">0</span>)
|
@@ -1568,24 +1635,25 @@ Like index but returns a <a href="Range.html">Range</a>.
|
|
1568
1635
|
</div>
|
1569
1636
|
<div class="method">
|
1570
1637
|
<div class="title">
|
1571
|
-
<a name="
|
1638
|
+
<a name="M000274"></a><b>range_all</b>(s, reuse=false)
|
1572
1639
|
</div>
|
1573
1640
|
<div class="description">
|
1574
1641
|
<p>
|
1575
|
-
Like <a href="String.html#
|
1642
|
+
Like <a href="String.html#M000276">index_all</a> but returns an array of
|
1576
1643
|
Ranges.
|
1577
1644
|
</p>
|
1578
1645
|
<pre>
|
1579
1646
|
"abc123abc123".range_all('abc') #=> [0..2, 6..8]
|
1580
1647
|
|
1581
1648
|
TODO: Add offset, perhaps ?
|
1582
|
-
|
1583
|
-
CREDIT: Trans
|
1584
1649
|
</pre>
|
1650
|
+
<p>
|
1651
|
+
CREDIT: Trans
|
1652
|
+
</p>
|
1585
1653
|
</div>
|
1586
1654
|
<div class="sourcecode">
|
1587
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1588
|
-
<div id="
|
1655
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000274_source')" id="l_M000274_source">+</a> ]</p>
|
1656
|
+
<div id="M000274_source" class="dyn-source">
|
1589
1657
|
<pre>
|
1590
1658
|
<span class="ruby-comment cmt"># File lib/core/facets/string/range.rb, line 24</span>
|
1591
1659
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">range_all</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">reuse</span>=<span class="ruby-keyword kw">false</span>)
|
@@ -1607,7 +1675,7 @@ Ranges.
|
|
1607
1675
|
</div>
|
1608
1676
|
<div class="method">
|
1609
1677
|
<div class="title">
|
1610
|
-
<a name="
|
1678
|
+
<a name="M000275"></a><b>range_of_line</b>()
|
1611
1679
|
</div>
|
1612
1680
|
<div class="description">
|
1613
1681
|
<p>
|
@@ -1616,13 +1684,14 @@ Returns an array of ranges mapping the characters per line.
|
|
1616
1684
|
<pre>
|
1617
1685
|
"this\nis\na\ntest".range_of_line
|
1618
1686
|
#=> [0..4, 5..7, 8..9, 10..13]
|
1619
|
-
|
1620
|
-
CREDIT: Trans
|
1621
1687
|
</pre>
|
1688
|
+
<p>
|
1689
|
+
CREDIT: Trans
|
1690
|
+
</p>
|
1622
1691
|
</div>
|
1623
1692
|
<div class="sourcecode">
|
1624
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1625
|
-
<div id="
|
1693
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000275_source')" id="l_M000275_source">+</a> ]</p>
|
1694
|
+
<div id="M000275_source" class="dyn-source">
|
1626
1695
|
<pre>
|
1627
1696
|
<span class="ruby-comment cmt"># File lib/core/facets/string/range.rb, line 46</span>
|
1628
1697
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">range_of_line</span>
|
@@ -1639,7 +1708,7 @@ Returns an array of ranges mapping the characters per line.
|
|
1639
1708
|
</div>
|
1640
1709
|
<div class="method">
|
1641
1710
|
<div class="title">
|
1642
|
-
<a name="
|
1711
|
+
<a name="M000309"></a><b>rewrite</b>(rules)
|
1643
1712
|
</div>
|
1644
1713
|
<div class="description">
|
1645
1714
|
<p>
|
@@ -1658,13 +1727,13 @@ The array containing rule-pairs (match, write).
|
|
1658
1727
|
<p>
|
1659
1728
|
The rewritten string.
|
1660
1729
|
</p>
|
1661
|
-
<
|
1662
|
-
|
1663
|
-
</
|
1730
|
+
<p>
|
1731
|
+
CREDIT: George Moschovitis
|
1732
|
+
</p>
|
1664
1733
|
</div>
|
1665
1734
|
<div class="sourcecode">
|
1666
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1667
|
-
<div id="
|
1735
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000309_source')" id="l_M000309_source">+</a> ]</p>
|
1736
|
+
<div id="M000309_source" class="dyn-source">
|
1668
1737
|
<pre>
|
1669
1738
|
<span class="ruby-comment cmt"># File lib/core/facets/string/rewrite.rb, line 18</span>
|
1670
1739
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rewrite</span>(<span class="ruby-identifier">rules</span>)
|
@@ -1681,7 +1750,7 @@ The rewritten string.
|
|
1681
1750
|
</div>
|
1682
1751
|
<div class="method">
|
1683
1752
|
<div class="title">
|
1684
|
-
<a name="
|
1753
|
+
<a name="M000254"></a><b>shatter</b>( re )
|
1685
1754
|
</div>
|
1686
1755
|
<div class="description">
|
1687
1756
|
<p>
|
@@ -1697,13 +1766,14 @@ scan, but includes the matches.
|
|
1697
1766
|
</p>
|
1698
1767
|
<pre>
|
1699
1768
|
["<p>", "This", "<b>", "is", "</b>", "a test.", "</p>"]
|
1700
|
-
|
1701
|
-
CREDIT: Trans
|
1702
1769
|
</pre>
|
1770
|
+
<p>
|
1771
|
+
CREDIT: Trans
|
1772
|
+
</p>
|
1703
1773
|
</div>
|
1704
1774
|
<div class="sourcecode">
|
1705
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1706
|
-
<div id="
|
1775
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000254_source')" id="l_M000254_source">+</a> ]</p>
|
1776
|
+
<div id="M000254_source" class="dyn-source">
|
1707
1777
|
<pre>
|
1708
1778
|
<span class="ruby-comment cmt"># File lib/core/facets/string/shatter.rb, line 15</span>
|
1709
1779
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shatter</span>( <span class="ruby-identifier">re</span> )
|
@@ -1718,12 +1788,12 @@ scan, but includes the matches.
|
|
1718
1788
|
</div>
|
1719
1789
|
<div class="method">
|
1720
1790
|
<div class="title">
|
1721
|
-
<a name="
|
1791
|
+
<a name="M000277"></a><b>snakecase</b>()
|
1722
1792
|
</div>
|
1723
1793
|
<div class="description">
|
1724
1794
|
<p>
|
1725
|
-
The reverse of <tt><a href="String.html#
|
1726
|
-
an underscored of a <a href="String.html#
|
1795
|
+
The reverse of <tt><a href="String.html#M000260">camelcase</a></tt>. Makes
|
1796
|
+
an underscored of a <a href="String.html#M000260">camelcase</a> string.
|
1727
1797
|
</p>
|
1728
1798
|
<p>
|
1729
1799
|
Changes ’::’ to ’/’ to convert namespaces to paths.
|
@@ -1738,8 +1808,8 @@ Examples
|
|
1738
1808
|
</pre>
|
1739
1809
|
</div>
|
1740
1810
|
<div class="sourcecode">
|
1741
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1742
|
-
<div id="
|
1811
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000277_source')" id="l_M000277_source">+</a> ]</p>
|
1812
|
+
<div id="M000277_source" class="dyn-source">
|
1743
1813
|
<pre>
|
1744
1814
|
<span class="ruby-comment cmt"># File lib/core/facets/string/snakecase.rb, line 12</span>
|
1745
1815
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">snakecase</span>
|
@@ -1755,7 +1825,7 @@ Examples
|
|
1755
1825
|
</div>
|
1756
1826
|
<div class="method">
|
1757
1827
|
<div class="title">
|
1758
|
-
<a name="
|
1828
|
+
<a name="M000308"></a><b>splice</b>(idx, sub=nil)
|
1759
1829
|
</div>
|
1760
1830
|
<div class="description">
|
1761
1831
|
<p>
|
@@ -1773,13 +1843,14 @@ Essentlay slice, but writes rather than reads.
|
|
1773
1843
|
a = "HELLO"
|
1774
1844
|
a.splice(1) #=> "E"
|
1775
1845
|
a #=> "HLLO"
|
1776
|
-
|
1777
|
-
CREDIT: Trans
|
1778
1846
|
</pre>
|
1847
|
+
<p>
|
1848
|
+
CREDIT: Trans
|
1849
|
+
</p>
|
1779
1850
|
</div>
|
1780
1851
|
<div class="sourcecode">
|
1781
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1782
|
-
<div id="
|
1852
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000308_source')" id="l_M000308_source">+</a> ]</p>
|
1853
|
+
<div id="M000308_source" class="dyn-source">
|
1783
1854
|
<pre>
|
1784
1855
|
<span class="ruby-comment cmt"># File lib/core/facets/string/splice.rb, line 20</span>
|
1785
1856
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">splice</span>(<span class="ruby-identifier">idx</span>, <span class="ruby-identifier">sub</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -1788,7 +1859,7 @@ Essentlay slice, but writes rather than reads.
|
|
1788
1859
|
<span class="ruby-keyword kw">else</span>
|
1789
1860
|
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">idx</span>
|
1790
1861
|
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">Range</span>
|
1791
|
-
<span class="ruby-identifier">slice!</span>(<span class="ruby-identifier">idx</span>)
|
1862
|
+
<span class="ruby-identifier">slice!</span>(<span class="ruby-identifier">idx</span>)
|
1792
1863
|
<span class="ruby-keyword kw">else</span>
|
1793
1864
|
<span class="ruby-identifier">slice!</span>(<span class="ruby-identifier">idx</span>,<span class="ruby-value">1</span>)
|
1794
1865
|
<span class="ruby-keyword kw">end</span>
|
@@ -1800,7 +1871,7 @@ Essentlay slice, but writes rather than reads.
|
|
1800
1871
|
</div>
|
1801
1872
|
<div class="method">
|
1802
1873
|
<div class="title">
|
1803
|
-
<a name="
|
1874
|
+
<a name="M000258"></a><b>start_with?</b>(prefix)
|
1804
1875
|
</div>
|
1805
1876
|
<div class="description">
|
1806
1877
|
<p>
|
@@ -1809,16 +1880,16 @@ Does a string start with the given prefix.
|
|
1809
1880
|
<pre>
|
1810
1881
|
"hello".starts_with?("he") #=> true
|
1811
1882
|
"hello".starts_with?("to") #=> false
|
1812
|
-
|
1813
|
-
CREDIT: Lucas Carlson
|
1814
|
-
CREDIT: Blaine Cook
|
1815
1883
|
</pre>
|
1884
|
+
<p>
|
1885
|
+
CREDIT: Lucas Carlson, Blaine Cook
|
1886
|
+
</p>
|
1816
1887
|
</div>
|
1817
1888
|
<div class="sourcecode">
|
1818
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1819
|
-
<div id="
|
1889
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000258_source')" id="l_M000258_source">+</a> ]</p>
|
1890
|
+
<div id="M000258_source" class="dyn-source">
|
1820
1891
|
<pre>
|
1821
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/start_with.rb, line
|
1892
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/start_with.rb, line 12</span>
|
1822
1893
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">prefix</span>)
|
1823
1894
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">prefix</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
1824
1895
|
<span class="ruby-keyword kw">end</span>
|
@@ -1828,25 +1899,21 @@ Does a string start with the given prefix.
|
|
1828
1899
|
</div>
|
1829
1900
|
<div class="method">
|
1830
1901
|
<div class="title">
|
1831
|
-
<a name="
|
1902
|
+
<a name="M000269"></a><b>tab</b>(n)
|
1832
1903
|
</div>
|
1833
1904
|
<div class="description">
|
1834
1905
|
<p>
|
1835
1906
|
Aligns each line n spaces.
|
1836
1907
|
</p>
|
1837
|
-
<
|
1838
|
-
|
1839
|
-
</
|
1908
|
+
<p>
|
1909
|
+
CREDIT: Gavin Sinclair
|
1910
|
+
</p>
|
1840
1911
|
</div>
|
1841
|
-
<div class="aka">
|
1842
|
-
This method is also aliased as
|
1843
|
-
<a href="String.html#M000266">taballto</a>
|
1844
|
-
</div>
|
1845
1912
|
<div class="sourcecode">
|
1846
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1847
|
-
<div id="
|
1913
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000269_source')" id="l_M000269_source">+</a> ]</p>
|
1914
|
+
<div id="M000269_source" class="dyn-source">
|
1848
1915
|
<pre>
|
1849
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/tab.rb, line
|
1916
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/tab.rb, line 12</span>
|
1850
1917
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tab</span>(<span class="ruby-identifier">n</span>)
|
1851
1918
|
<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^ */</span>, <span class="ruby-value str">' '</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">n</span>)
|
1852
1919
|
<span class="ruby-keyword kw">end</span>
|
@@ -1856,32 +1923,22 @@ Aligns each line n spaces.
|
|
1856
1923
|
</div>
|
1857
1924
|
<div class="method">
|
1858
1925
|
<div class="title">
|
1859
|
-
<a name="
|
1860
|
-
</div>
|
1861
|
-
<div class="description">
|
1862
|
-
<p>
|
1863
|
-
Alias for <a href="String.html#M000265">tab</a>
|
1864
|
-
</p>
|
1865
|
-
</div>
|
1866
|
-
</div>
|
1867
|
-
<div class="method">
|
1868
|
-
<div class="title">
|
1869
|
-
<a name="M000268"></a><b>tabto</b>(n)
|
1926
|
+
<a name="M000294"></a><b>tabto</b>(n)
|
1870
1927
|
</div>
|
1871
1928
|
<div class="description">
|
1872
1929
|
<p>
|
1873
1930
|
Preserves relative tabbing. The first non-empty line ends up with n spaces
|
1874
1931
|
before nonspace.
|
1875
1932
|
</p>
|
1876
|
-
<
|
1877
|
-
|
1878
|
-
</
|
1933
|
+
<p>
|
1934
|
+
CREDIT: Gavin Sinclair
|
1935
|
+
</p>
|
1879
1936
|
</div>
|
1880
1937
|
<div class="sourcecode">
|
1881
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1882
|
-
<div id="
|
1938
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000294_source')" id="l_M000294_source">+</a> ]</p>
|
1939
|
+
<div id="M000294_source" class="dyn-source">
|
1883
1940
|
<pre>
|
1884
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/
|
1941
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/tabto.rb, line 10</span>
|
1885
1942
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tabto</span>(<span class="ruby-identifier">n</span>)
|
1886
1943
|
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^( *)\S/</span>
|
1887
1944
|
<span class="ruby-identifier">indent</span>(<span class="ruby-identifier">n</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">length</span>)
|
@@ -1895,7 +1952,7 @@ before nonspace.
|
|
1895
1952
|
</div>
|
1896
1953
|
<div class="method">
|
1897
1954
|
<div class="title">
|
1898
|
-
<a name="
|
1955
|
+
<a name="M000293"></a><b>titlecase</b>()
|
1899
1956
|
</div>
|
1900
1957
|
<div class="description">
|
1901
1958
|
<p>
|
@@ -1904,13 +1961,14 @@ Title case.
|
|
1904
1961
|
<pre>
|
1905
1962
|
"this is a string".titlecase
|
1906
1963
|
=> "This Is A String"
|
1907
|
-
|
1908
|
-
CREDIT: Eliazar Parra
|
1909
1964
|
</pre>
|
1965
|
+
<p>
|
1966
|
+
CREDIT: Eliazar Parra
|
1967
|
+
</p>
|
1910
1968
|
</div>
|
1911
1969
|
<div class="sourcecode">
|
1912
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1913
|
-
<div id="
|
1970
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000293_source')" id="l_M000293_source">+</a> ]</p>
|
1971
|
+
<div id="M000293_source" class="dyn-source">
|
1914
1972
|
<pre>
|
1915
1973
|
<span class="ruby-comment cmt"># File lib/core/facets/string/titlecase.rb, line 10</span>
|
1916
1974
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">titlecase</span>
|
@@ -1922,7 +1980,7 @@ Title case.
|
|
1922
1980
|
</div>
|
1923
1981
|
<div class="method">
|
1924
1982
|
<div class="title">
|
1925
|
-
<a name="
|
1983
|
+
<a name="M000252"></a><b>to_b</b>()
|
1926
1984
|
</div>
|
1927
1985
|
<div class="description">
|
1928
1986
|
<p>
|
@@ -1944,8 +2002,8 @@ Examples:
|
|
1944
2002
|
</pre>
|
1945
2003
|
</div>
|
1946
2004
|
<div class="sourcecode">
|
1947
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1948
|
-
<div id="
|
2005
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000252_source')" id="l_M000252_source">+</a> ]</p>
|
2006
|
+
<div id="M000252_source" class="dyn-source">
|
1949
2007
|
<pre>
|
1950
2008
|
<span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 43</span>
|
1951
2009
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_b</span>
|
@@ -1964,7 +2022,7 @@ Examples:
|
|
1964
2022
|
</div>
|
1965
2023
|
<div class="method">
|
1966
2024
|
<div class="title">
|
1967
|
-
<a name="
|
2025
|
+
<a name="M000255"></a><b>to_re</b>(esc=false)
|
1968
2026
|
</div>
|
1969
2027
|
<div class="description">
|
1970
2028
|
<p>
|
@@ -1972,13 +2030,14 @@ Turns a string into a regular expression.
|
|
1972
2030
|
</p>
|
1973
2031
|
<pre>
|
1974
2032
|
"a?".to_re #=> /a?/
|
1975
|
-
|
1976
|
-
CREDIT: Trans
|
1977
2033
|
</pre>
|
2034
|
+
<p>
|
2035
|
+
CREDIT: Trans
|
2036
|
+
</p>
|
1978
2037
|
</div>
|
1979
2038
|
<div class="sourcecode">
|
1980
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
1981
|
-
<div id="
|
2039
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000255_source')" id="l_M000255_source">+</a> ]</p>
|
2040
|
+
<div id="M000255_source" class="dyn-source">
|
1982
2041
|
<pre>
|
1983
2042
|
<span class="ruby-comment cmt"># File lib/core/facets/string/to_re.rb, line 9</span>
|
1984
2043
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_re</span>(<span class="ruby-identifier">esc</span>=<span class="ruby-keyword kw">false</span>)
|
@@ -1990,7 +2049,7 @@ Turns a string into a regular expression.
|
|
1990
2049
|
</div>
|
1991
2050
|
<div class="method">
|
1992
2051
|
<div class="title">
|
1993
|
-
<a name="
|
2052
|
+
<a name="M000256"></a><b>to_rx</b>(esc=true)
|
1994
2053
|
</div>
|
1995
2054
|
<div class="description">
|
1996
2055
|
<p>
|
@@ -1999,13 +2058,14 @@ characters. Use <tt>false</tt> argument to turn off escaping.
|
|
1999
2058
|
</p>
|
2000
2059
|
<pre>
|
2001
2060
|
"[".to_rx #=> /\[/
|
2002
|
-
|
2003
|
-
CREDIT: Trans
|
2004
2061
|
</pre>
|
2062
|
+
<p>
|
2063
|
+
CREDIT: Trans
|
2064
|
+
</p>
|
2005
2065
|
</div>
|
2006
2066
|
<div class="sourcecode">
|
2007
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2008
|
-
<div id="
|
2067
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000256_source')" id="l_M000256_source">+</a> ]</p>
|
2068
|
+
<div id="M000256_source" class="dyn-source">
|
2009
2069
|
<pre>
|
2010
2070
|
<span class="ruby-comment cmt"># File lib/core/facets/string/to_re.rb, line 21</span>
|
2011
2071
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_rx</span>(<span class="ruby-identifier">esc</span>=<span class="ruby-keyword kw">true</span>)
|
@@ -2017,40 +2077,25 @@ characters. Use <tt>false</tt> argument to turn off escaping.
|
|
2017
2077
|
</div>
|
2018
2078
|
<div class="method">
|
2019
2079
|
<div class="title">
|
2020
|
-
<a name="
|
2021
|
-
</div>
|
2022
|
-
<div class="sourcecode">
|
2023
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000248_source')" id="l_M000248_source">+</a> ]</p>
|
2024
|
-
<div id="M000248_source" class="dyn-source">
|
2025
|
-
<pre>
|
2026
|
-
<span class="ruby-comment cmt"># File lib/core/facets/comparable/bound.rb, line 2</span>
|
2027
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
2028
|
-
<span class="ruby-keyword kw">self</span>
|
2029
|
-
<span class="ruby-keyword kw">end</span>
|
2030
|
-
</pre>
|
2031
|
-
</div>
|
2032
|
-
</div>
|
2033
|
-
</div>
|
2034
|
-
<div class="method">
|
2035
|
-
<div class="title">
|
2036
|
-
<a name="M000296"></a><b>unbracket</b>(bra=nil, ket=nil)
|
2080
|
+
<a name="M000301"></a><b>unbracket</b>(bra=nil, ket=nil)
|
2037
2081
|
</div>
|
2038
2082
|
<div class="description">
|
2039
2083
|
<p>
|
2040
2084
|
Return a new string embraced by given brakets. If only one <a
|
2041
|
-
href="String.html#
|
2085
|
+
href="String.html#M000299">bracket</a> char is given it will be placed on
|
2042
2086
|
either side.
|
2043
2087
|
</p>
|
2044
2088
|
<pre>
|
2045
2089
|
"{unwrap me}".debracket('{') #=> "unwrap me"
|
2046
2090
|
"--unwrap me!".debracket('--','!') #=> "unwrap me!"
|
2047
|
-
|
2048
|
-
CREDIT: Trans
|
2049
2091
|
</pre>
|
2092
|
+
<p>
|
2093
|
+
CREDIT: Trans
|
2094
|
+
</p>
|
2050
2095
|
</div>
|
2051
2096
|
<div class="sourcecode">
|
2052
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2053
|
-
<div id="
|
2097
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000301_source')" id="l_M000301_source">+</a> ]</p>
|
2098
|
+
<div id="M000301_source" class="dyn-source">
|
2054
2099
|
<pre>
|
2055
2100
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 37</span>
|
2056
2101
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unbracket</span>(<span class="ruby-identifier">bra</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">ket</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -2074,19 +2119,19 @@ either side.
|
|
2074
2119
|
</div>
|
2075
2120
|
<div class="method">
|
2076
2121
|
<div class="title">
|
2077
|
-
<a name="
|
2122
|
+
<a name="M000302"></a><b>unbracket!</b>(bra=nil, ket=nil)
|
2078
2123
|
</div>
|
2079
2124
|
<div class="description">
|
2080
2125
|
<p>
|
2081
2126
|
Inplace version of debraket.
|
2082
2127
|
</p>
|
2083
|
-
<
|
2084
|
-
|
2085
|
-
</
|
2128
|
+
<p>
|
2129
|
+
CREDIT: Trans
|
2130
|
+
</p>
|
2086
2131
|
</div>
|
2087
2132
|
<div class="sourcecode">
|
2088
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2089
|
-
<div id="
|
2133
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000302_source')" id="l_M000302_source">+</a> ]</p>
|
2134
|
+
<div id="M000302_source" class="dyn-source">
|
2090
2135
|
<pre>
|
2091
2136
|
<span class="ruby-comment cmt"># File lib/core/facets/string/bracket.rb, line 57</span>
|
2092
2137
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unbracket!</span>(<span class="ruby-identifier">bra</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">ket</span>=<span class="ruby-keyword kw">nil</span>)
|
@@ -2108,9 +2153,10 @@ Is the string upcase/uppercase?
|
|
2108
2153
|
"THIS".upcase? #=> true
|
2109
2154
|
"This".upcase? #=> false
|
2110
2155
|
"this".upcase? #=> false
|
2111
|
-
|
2112
|
-
CREDIT: Phil Tomson
|
2113
2156
|
</pre>
|
2157
|
+
<p>
|
2158
|
+
CREDIT: Phil Tomson
|
2159
|
+
</p>
|
2114
2160
|
</div>
|
2115
2161
|
<div class="sourcecode">
|
2116
2162
|
<p class="source-link">[ <a href="javascript:toggleSource('M000284_source')" id="l_M000284_source">+</a> ]</p>
|
@@ -2126,7 +2172,7 @@ Is the string upcase/uppercase?
|
|
2126
2172
|
</div>
|
2127
2173
|
<div class="method">
|
2128
2174
|
<div class="title">
|
2129
|
-
<a name="
|
2175
|
+
<a name="M000288"></a><b>variablize</b>()
|
2130
2176
|
</div>
|
2131
2177
|
<div class="description">
|
2132
2178
|
<p>
|
@@ -2135,8 +2181,8 @@ variable name. This also replaces non-valid characters with underscores.
|
|
2135
2181
|
</p>
|
2136
2182
|
</div>
|
2137
2183
|
<div class="sourcecode">
|
2138
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2139
|
-
<div id="
|
2184
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000288_source')" id="l_M000288_source">+</a> ]</p>
|
2185
|
+
<div id="M000288_source" class="dyn-source">
|
2140
2186
|
<pre>
|
2141
2187
|
<span class="ruby-comment cmt"># File lib/core/facets/string/variablize.rb, line 7</span>
|
2142
2188
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">variablize</span>
|
@@ -2149,7 +2195,7 @@ variable name. This also replaces non-valid characters with underscores.
|
|
2149
2195
|
</div>
|
2150
2196
|
<div class="method">
|
2151
2197
|
<div class="title">
|
2152
|
-
<a name="
|
2198
|
+
<a name="M000263"></a><b>word_wrap</b>( col_width=80 )
|
2153
2199
|
</div>
|
2154
2200
|
<div class="description">
|
2155
2201
|
<p>
|
@@ -2170,16 +2216,15 @@ Word wrap a string not exceeding max width.
|
|
2170
2216
|
This is basic implementation of word wrap, but smart enough to suffice for
|
2171
2217
|
most use cases.
|
2172
2218
|
</p>
|
2173
|
-
<
|
2174
|
-
|
2175
|
-
|
2176
|
-
</pre>
|
2219
|
+
<p>
|
2220
|
+
CREDIT: Gavin Kistner, Dayne Broderson
|
2221
|
+
</p>
|
2177
2222
|
</div>
|
2178
2223
|
<div class="sourcecode">
|
2179
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2180
|
-
<div id="
|
2224
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000263_source')" id="l_M000263_source">+</a> ]</p>
|
2225
|
+
<div id="M000263_source" class="dyn-source">
|
2181
2226
|
<pre>
|
2182
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/word_wrap.rb, line
|
2227
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/word_wrap.rb, line 18</span>
|
2183
2228
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">word_wrap</span>( <span class="ruby-identifier">col_width</span>=<span class="ruby-value">80</span> )
|
2184
2229
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">word_wrap!</span>( <span class="ruby-identifier">col_width</span> )
|
2185
2230
|
<span class="ruby-keyword kw">end</span>
|
@@ -2189,23 +2234,22 @@ most use cases.
|
|
2189
2234
|
</div>
|
2190
2235
|
<div class="method">
|
2191
2236
|
<div class="title">
|
2192
|
-
<a name="
|
2237
|
+
<a name="M000264"></a><b>word_wrap!</b>( col_width=80 )
|
2193
2238
|
</div>
|
2194
2239
|
<div class="description">
|
2195
2240
|
<p>
|
2196
|
-
As with <a href="String.html#
|
2241
|
+
As with <a href="String.html#M000263">word_wrap</a>, but modifies the
|
2197
2242
|
string in place.
|
2198
2243
|
</p>
|
2199
|
-
<
|
2200
|
-
|
2201
|
-
|
2202
|
-
</pre>
|
2244
|
+
<p>
|
2245
|
+
CREDIT: Gavin Kistner, Dayne Broderson
|
2246
|
+
</p>
|
2203
2247
|
</div>
|
2204
2248
|
<div class="sourcecode">
|
2205
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2206
|
-
<div id="
|
2249
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000264_source')" id="l_M000264_source">+</a> ]</p>
|
2250
|
+
<div id="M000264_source" class="dyn-source">
|
2207
2251
|
<pre>
|
2208
|
-
<span class="ruby-comment cmt"># File lib/core/facets/string/word_wrap.rb, line
|
2252
|
+
<span class="ruby-comment cmt"># File lib/core/facets/string/word_wrap.rb, line 26</span>
|
2209
2253
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">word_wrap!</span>( <span class="ruby-identifier">col_width</span>=<span class="ruby-value">80</span> )
|
2210
2254
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">gsub!</span>( <span class="ruby-node">/(\S{#{col_width}})(?=\S)/</span>, <span class="ruby-value str">'\1 '</span> )
|
2211
2255
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">gsub!</span>( <span class="ruby-node">/(.{1,#{col_width}})(?:\s+|$)/</span>, <span class="ruby-value str">"\\1\n"</span> )
|
@@ -2217,7 +2261,7 @@ string in place.
|
|
2217
2261
|
</div>
|
2218
2262
|
<div class="method">
|
2219
2263
|
<div class="title">
|
2220
|
-
<a name="
|
2264
|
+
<a name="M000295"></a><b>words</b>()
|
2221
2265
|
</div>
|
2222
2266
|
<div class="description">
|
2223
2267
|
<p>
|
@@ -2228,8 +2272,8 @@ Returns an array of characters.
|
|
2228
2272
|
</pre>
|
2229
2273
|
</div>
|
2230
2274
|
<div class="sourcecode">
|
2231
|
-
<p class="source-link">[ <a href="javascript:toggleSource('
|
2232
|
-
<div id="
|
2275
|
+
<p class="source-link">[ <a href="javascript:toggleSource('M000295_source')" id="l_M000295_source">+</a> ]</p>
|
2276
|
+
<div id="M000295_source" class="dyn-source">
|
2233
2277
|
<pre>
|
2234
2278
|
<span class="ruby-comment cmt"># File lib/core/facets/string/words.rb, line 7</span>
|
2235
2279
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">words</span>
|