facets-glimmer 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.index +89 -0
- data/.yardopts +10 -0
- data/CONTRIBUTING.md +112 -0
- data/HISTORY.md +2497 -0
- data/LICENSE.txt +26 -0
- data/NOTICE.rdoc +167 -0
- data/README.md +305 -0
- data/demo/applique/assertion_framework.rb +1 -0
- data/demo/applique/file_helpers.rb +34 -0
- data/demo/core/array/after.md +13 -0
- data/demo/core/array/arrange.md +17 -0
- data/demo/core/array/before.md +14 -0
- data/demo/core/array/collapse.md +15 -0
- data/demo/core/array/collisions.md +30 -0
- data/demo/core/array/commonality.md +31 -0
- data/demo/core/array/conjoin.md +47 -0
- data/demo/core/array/contains.md +9 -0
- data/demo/core/array/delete_unless.md +13 -0
- data/demo/core/array/delete_values.md +10 -0
- data/demo/core/array/delete_values_at.md +15 -0
- data/demo/core/array/divide.md +14 -0
- data/demo/core/array/duplicates.md +14 -0
- data/demo/core/array/each_overlap.md +12 -0
- data/demo/core/array/each_pair.md +13 -0
- data/demo/core/array/each_value.md +12 -0
- data/demo/core/array/entropy.md +13 -0
- data/demo/core/array/extract_options.md +13 -0
- data/demo/core/array/first.md +11 -0
- data/demo/core/array/from.md +11 -0
- data/demo/core/array/ideal_entropy.md +11 -0
- data/demo/core/array/intersection.md +11 -0
- data/demo/core/array/last.md +11 -0
- data/demo/core/array/median.md +23 -0
- data/demo/core/array/merge.md +15 -0
- data/demo/core/array/missing.md +10 -0
- data/demo/core/array/mode.md +9 -0
- data/demo/core/array/nonuniq.md +16 -0
- data/demo/core/array/not_empty.md +8 -0
- data/demo/core/array/occur.md +18 -0
- data/demo/core/array/occurrence.md +13 -0
- data/demo/core/array/only.md +9 -0
- data/demo/core/array/op_pow.md +10 -0
- data/demo/core/array/pad.md +28 -0
- data/demo/core/array/peek.md +10 -0
- data/demo/core/array/poke.md +15 -0
- data/demo/core/array/probability +8 -0
- data/demo/core/array/pull.md +10 -0
- data/demo/core/array/recurse.md +10 -0
- data/demo/core/array/recursively.md +20 -0
- data/demo/core/array/reject_values.md +10 -0
- data/demo/core/array/span.md +16 -0
- data/demo/core/array/splice.md +14 -0
- data/demo/core/array/split.md +13 -0
- data/demo/core/array/split_at.md +12 -0
- data/demo/core/array/squeeze.md +14 -0
- data/demo/core/array/step.md +16 -0
- data/demo/core/array/store.md +9 -0
- data/demo/core/array/thru.md +12 -0
- data/demo/core/array/to_h.md +11 -0
- data/demo/core/array/traverse.md +20 -0
- data/demo/core/array/uniq_by.md +16 -0
- data/demo/core/array/unique_permutation.md +14 -0
- data/demo/core/array/zip.md +8 -0
- data/demo/core/binding/caller.md +57 -0
- data/demo/core/binding/defined.md +10 -0
- data/demo/core/binding/opvars.md +16 -0
- data/demo/core/binding/self.md +6 -0
- data/demo/core/class/descendants.md +13 -0
- data/demo/core/class/to_proc.md +11 -0
- data/demo/core/comparable/at_least.md +11 -0
- data/demo/core/comparable/at_most.md +11 -0
- data/demo/core/comparable/bound.md +13 -0
- data/demo/core/comparable/cap.md +11 -0
- data/demo/core/comparable/clip.md +29 -0
- data/demo/core/comparable/cmp.md +18 -0
- data/demo/core/comparable/op_get.md +32 -0
- data/demo/core/dir/ascend.md +24 -0
- data/demo/core/dir/descend.md +16 -0
- data/demo/core/dir/multiglob.md +41 -0
- data/demo/core/dir/parent.md +6 -0
- data/demo/core/dir/recurse.md +41 -0
- data/demo/core/exception/detail.md +19 -0
- data/demo/core/facets.md +6 -0
- data/demo/core/filetest/root.md +13 -0
- data/demo/core/hash/recursively.md +21 -0
- data/demo/core/indexable.md +95 -0
- data/demo/core/integer/bitmask.md +46 -0
- data/demo/core/integer/factorial.md +10 -0
- data/demo/core/integer/length.md +7 -0
- data/demo/core/integer/multiple.md +12 -0
- data/demo/core/integer/of.md +11 -0
- data/demo/core/integer/ordinal.md +11 -0
- data/demo/core/integer/times_collect.md +9 -0
- data/demo/core/matchdata/match.md +7 -0
- data/demo/core/matchdata/matchset.md +7 -0
- data/demo/core/matchdata/matchtree.md +10 -0
- data/demo/core/module/cattr.md +43 -0
- data/demo/core/module/class_extend.md +64 -0
- data/demo/core/module/class_inheritor.md +126 -0
- data/demo/core/module/copy_inheritor.md +30 -0
- data/demo/core/module/include_as.md +31 -0
- data/demo/core/module/method_space.md +24 -0
- data/demo/core/string/acronym.md +9 -0
- data/demo/core/string/align.md +34 -0
- data/demo/core/string/ascii_only.md +37 -0
- data/demo/core/string/bracket.md +35 -0
- data/demo/core/string/camelcase.md +47 -0
- data/demo/core/string/capitalized.md +27 -0
- data/demo/core/string/cleanlines.md +10 -0
- data/demo/core/string/cleave.md +49 -0
- data/demo/core/string/compress_lines.md +22 -0
- data/demo/core/string/crypt.md +15 -0
- data/demo/core/string/divide.md +9 -0
- data/demo/core/string/each_word.md +11 -0
- data/demo/core/string/edit_distance.md +15 -0
- data/demo/core/string/exclude.md +15 -0
- data/demo/core/string/expand_tabs.md +69 -0
- data/demo/core/string/fold.md +14 -0
- data/demo/core/string/indent.md +65 -0
- data/demo/core/string/index_all.md +14 -0
- data/demo/core/string/interpolate.md +8 -0
- data/demo/core/string/lchomp.md +14 -0
- data/demo/core/string/line_wrap.md +7 -0
- data/demo/core/string/lowercase.md +12 -0
- data/demo/core/string/methodize.md +22 -0
- data/demo/core/string/modulize.md +22 -0
- data/demo/core/string/mscan.md +10 -0
- data/demo/core/string/natcmp.md +10 -0
- data/demo/core/string/nchar.md +9 -0
- data/demo/core/string/newlines.md +9 -0
- data/demo/core/string/number.md +27 -0
- data/demo/core/string/op_div.md +10 -0
- data/demo/core/string/op_sub.md +7 -0
- data/demo/core/string/pathize.md +22 -0
- data/demo/core/string/quote.md +20 -0
- data/demo/core/string/random.md +25 -0
- data/demo/core/string/range.md +19 -0
- data/demo/core/string/remove.md +33 -0
- data/demo/core/string/rewrite.md +9 -0
- data/demo/core/string/shatter.md +9 -0
- data/demo/core/string/similarity.md +12 -0
- data/demo/core/string/snakecase.md +14 -0
- data/demo/core/string/splice.md +28 -0
- data/demo/core/string/squish.md +27 -0
- data/demo/core/string/store.md +10 -0
- data/demo/core/string/subtract.md +8 -0
- data/demo/core/string/titlecase.md +8 -0
- data/demo/core/string/to_re.md +22 -0
- data/demo/core/string/trim.md +92 -0
- data/demo/core/string/unbracket.md +24 -0
- data/demo/core/string/underscore.md +17 -0
- data/demo/core/string/unfold.md +9 -0
- data/demo/core/string/unindent.md +65 -0
- data/demo/core/string/unquote.md +6 -0
- data/demo/core/string/uppercase.md +15 -0
- data/demo/core/string/variablize.md +7 -0
- data/demo/core/string/word_wrap.md +54 -0
- data/demo/core/string/words.md +13 -0
- data/demo/core/string/xor.md +8 -0
- data/demo/standard/02_cloneable.rdoc +46 -0
- data/demo/standard/03_enumargs.rdoc +75 -0
- data/demo/standard/04_equitable.rdoc +35 -0
- data/demo/standard/05_instantiable.rdoc +42 -0
- data/demo/standard/date/comparison.md +33 -0
- data/demo/standard/memoizable.rdoc +134 -0
- data/demo/standard/mulititon.rdoc +156 -0
- data/lib/core/facets/applique/file_helpers.rb +33 -0
- data/lib/core/facets/array/after.rb +1 -0
- data/lib/core/facets/array/arrange.rb +42 -0
- data/lib/core/facets/array/average.rb +15 -0
- data/lib/core/facets/array/before.rb +41 -0
- data/lib/core/facets/array/collapse.rb +18 -0
- data/lib/core/facets/array/collisions.rb +1 -0
- data/lib/core/facets/array/commonality.rb +49 -0
- data/lib/core/facets/array/conjoin.rb +89 -0
- data/lib/core/facets/array/contains.rb +7 -0
- data/lib/core/facets/array/delete.rb +4 -0
- 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/delete_values_at.rb +1 -0
- data/lib/core/facets/array/divide.rb +27 -0
- data/lib/core/facets/array/duplicates.rb +24 -0
- data/lib/core/facets/array/each_overlap.rb +25 -0
- data/lib/core/facets/array/each_pair.rb +11 -0
- data/lib/core/facets/array/each_value.rb +6 -0
- data/lib/core/facets/array/entropy.rb +39 -0
- data/lib/core/facets/array/extract_options.rb +31 -0
- data/lib/core/facets/array/first.rb +1 -0
- data/lib/core/facets/array/from.rb +28 -0
- data/lib/core/facets/array/indexable.rb +31 -0
- data/lib/core/facets/array/intersection.rb +25 -0
- data/lib/core/facets/array/last.rb +1 -0
- data/lib/core/facets/array/median.rb +32 -0
- data/lib/core/facets/array/merge.rb +22 -0
- data/lib/core/facets/array/missing.rb +29 -0
- data/lib/core/facets/array/mode.rb +22 -0
- data/lib/core/facets/array/nonuniq.rb +28 -0
- data/lib/core/facets/array/not_empty.rb +13 -0
- data/lib/core/facets/array/occur.rb +38 -0
- data/lib/core/facets/array/occurrence.rb +29 -0
- data/lib/core/facets/array/only.rb +37 -0
- data/lib/core/facets/array/op_pow.rb +12 -0
- data/lib/core/facets/array/pad.rb +41 -0
- data/lib/core/facets/array/peek.rb +1 -0
- data/lib/core/facets/array/poke.rb +1 -0
- data/lib/core/facets/array/probability.rb +39 -0
- data/lib/core/facets/array/pull.rb +30 -0
- data/lib/core/facets/array/recurse.rb +29 -0
- data/lib/core/facets/array/recursively.rb +53 -0
- data/lib/core/facets/array/reject_values.rb +21 -0
- data/lib/core/facets/array/span.rb +24 -0
- data/lib/core/facets/array/splice.rb +31 -0
- data/lib/core/facets/array/split.rb +30 -0
- data/lib/core/facets/array/split_at.rb +25 -0
- data/lib/core/facets/array/squeeze.rb +23 -0
- data/lib/core/facets/array/standard_deviation.rb +23 -0
- data/lib/core/facets/array/step.rb +31 -0
- data/lib/core/facets/array/store.rb +16 -0
- data/lib/core/facets/array/thru.rb +1 -0
- data/lib/core/facets/array/to_h.rb +19 -0
- data/lib/core/facets/array/traverse.rb +50 -0
- data/lib/core/facets/array/uniq_by.rb +24 -0
- data/lib/core/facets/array/unique_permutation.rb +29 -0
- data/lib/core/facets/array/variance.rb +20 -0
- data/lib/core/facets/array/zip.rb +21 -0
- data/lib/core/facets/array.rb +49 -0
- data/lib/core/facets/binding/__callee__.rb +1 -0
- data/lib/core/facets/binding/__method__.rb +1 -0
- data/lib/core/facets/binding/call_stack.rb +1 -0
- data/lib/core/facets/binding/caller.rb +42 -0
- data/lib/core/facets/binding/callstack.rb +1 -0
- data/lib/core/facets/binding/defined.rb +10 -0
- data/lib/core/facets/binding/op.rb +4 -0
- data/lib/core/facets/binding/op_get.rb +25 -0
- data/lib/core/facets/binding/op_set.rb +1 -0
- data/lib/core/facets/binding/self.rb +15 -0
- data/lib/core/facets/binding/with.rb +12 -0
- data/lib/core/facets/binding.rb +12 -0
- data/lib/core/facets/boolean.rb +121 -0
- data/lib/core/facets/cattr.rb +1 -0
- data/lib/core/facets/class/cattr.rb +1 -0
- data/lib/core/facets/class/descendants.rb +36 -0
- data/lib/core/facets/class/hierarchically.rb +12 -0
- data/lib/core/facets/class/methodize.rb +19 -0
- data/lib/core/facets/class/pathize.rb +19 -0
- data/lib/core/facets/class/preallocate.rb +55 -0
- data/lib/core/facets/class/singleton.rb +1 -0
- data/lib/core/facets/class/singleton_class.rb +16 -0
- data/lib/core/facets/class/subclasses.rb +26 -0
- data/lib/core/facets/class/to_proc.rb +25 -0
- data/lib/core/facets/class.rb +9 -0
- 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 -0
- 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 +41 -0
- data/lib/core/facets/comparable/op_get.rb +45 -0
- data/lib/core/facets/comparable.rb +8 -0
- data/lib/core/facets/denumerable.rb +77 -0
- data/lib/core/facets/dir/ascend.rb +56 -0
- data/lib/core/facets/dir/descend.rb +1 -0
- data/lib/core/facets/dir/each_child.rb +16 -0
- data/lib/core/facets/dir/lookup.rb +20 -0
- data/lib/core/facets/dir/multiglob.rb +78 -0
- data/lib/core/facets/dir/parent.rb +16 -0
- data/lib/core/facets/dir/recurse.rb +35 -0
- data/lib/core/facets/dir.rb +7 -0
- data/lib/core/facets/enumerable/accumulate.rb +67 -0
- data/lib/core/facets/enumerable/apply.rb +20 -0
- data/lib/core/facets/enumerable/associate.rb +6 -0
- data/lib/core/facets/enumerable/cluster.rb +26 -0
- data/lib/core/facets/enumerable/collect_with_index.rb +2 -0
- data/lib/core/facets/enumerable/compact_map.rb +36 -0
- data/lib/core/facets/enumerable/defer.rb +46 -0
- data/lib/core/facets/enumerable/each_by.rb +33 -0
- data/lib/core/facets/enumerable/every.rb +40 -0
- data/lib/core/facets/enumerable/ewise.rb +61 -0
- data/lib/core/facets/enumerable/exclude.rb +16 -0
- data/lib/core/facets/enumerable/expand.rb +15 -0
- data/lib/core/facets/enumerable/filter.rb +33 -0
- data/lib/core/facets/enumerable/find_yield.rb +42 -0
- data/lib/core/facets/enumerable/frequency.rb +24 -0
- data/lib/core/facets/enumerable/graph.rb +34 -0
- data/lib/core/facets/enumerable/hashify.rb +230 -0
- data/lib/core/facets/enumerable/hinge.rb +18 -0
- data/lib/core/facets/enumerable/incase.rb +19 -0
- data/lib/core/facets/enumerable/key_by.rb +27 -0
- data/lib/core/facets/enumerable/map_by.rb +35 -0
- data/lib/core/facets/enumerable/map_detect.rb +1 -0
- data/lib/core/facets/enumerable/map_send.rb +26 -0
- data/lib/core/facets/enumerable/map_to.rb +13 -0
- data/lib/core/facets/enumerable/map_with.rb +21 -0
- data/lib/core/facets/enumerable/map_with_index.rb +23 -0
- data/lib/core/facets/enumerable/mash.rb +34 -0
- data/lib/core/facets/enumerable/modulate.rb +22 -0
- data/lib/core/facets/enumerable/occur.rb +41 -0
- data/lib/core/facets/enumerable/only.rb +56 -0
- data/lib/core/facets/enumerable/organize_by.rb +19 -0
- data/lib/core/facets/enumerable/pair.rb +20 -0
- data/lib/core/facets/enumerable/per.rb +77 -0
- data/lib/core/facets/enumerable/purge.rb +43 -0
- data/lib/core/facets/enumerable/recursively.rb +66 -0
- data/lib/core/facets/enumerable/squeeze.rb +36 -0
- data/lib/core/facets/enumerable/sum.rb +40 -0
- data/lib/core/facets/enumerable/unassociate.rb +23 -0
- data/lib/core/facets/enumerable/uniq_by.rb +13 -0
- data/lib/core/facets/enumerable/value_by.rb +25 -0
- data/lib/core/facets/enumerable/visit.rb +30 -0
- data/lib/core/facets/enumerable/with_position.rb +58 -0
- data/lib/core/facets/enumerable/zip_map.rb +1 -0
- data/lib/core/facets/enumerable.rb +40 -0
- data/lib/core/facets/enumerator/fx.rb +27 -0
- data/lib/core/facets/enumerator/lazy/squeeze.rb +33 -0
- data/lib/core/facets/enumerator.rb +75 -0
- data/lib/core/facets/essentials.rb +65 -0
- data/lib/core/facets/exception/detail.rb +17 -0
- data/lib/core/facets/exception/error_print.rb +80 -0
- data/lib/core/facets/exception/raised.rb +14 -0
- data/lib/core/facets/exception/set_message.rb +10 -0
- data/lib/core/facets/exception/suppress.rb +22 -0
- data/lib/core/facets/exception.rb +4 -0
- data/lib/core/facets/file/append.rb +14 -0
- data/lib/core/facets/file/atomic_id.rb +9 -0
- data/lib/core/facets/file/atomic_open.rb +26 -0
- data/lib/core/facets/file/atomic_write.rb +58 -0
- data/lib/core/facets/file/common_path.rb +17 -0
- data/lib/core/facets/file/create.rb +21 -0
- data/lib/core/facets/file/ext.rb +36 -0
- data/lib/core/facets/file/null.rb +21 -0
- data/lib/core/facets/file/read_binary.rb +18 -0
- data/lib/core/facets/file/read_list.rb +34 -0
- data/lib/core/facets/file/rewrite.rb +90 -0
- data/lib/core/facets/file/rootname.rb +23 -0
- data/lib/core/facets/file/sanitize.rb +18 -0
- data/lib/core/facets/file/split_all.rb +19 -0
- data/lib/core/facets/file/split_root.rb +13 -0
- data/lib/core/facets/file/write.rb +24 -0
- data/lib/core/facets/file/writelines.rb +27 -0
- data/lib/core/facets/file.rb +16 -0
- data/lib/core/facets/filetest/absolute.rb +1 -0
- data/lib/core/facets/filetest/contains.rb +12 -0
- data/lib/core/facets/filetest/relative.rb +38 -0
- data/lib/core/facets/filetest/root.rb +17 -0
- data/lib/core/facets/filetest/safe.rb +24 -0
- data/lib/core/facets/filetest/separator_pattern.rb +19 -0
- data/lib/core/facets/filetest.rb +7 -0
- data/lib/core/facets/float/round_to.rb +1 -0
- data/lib/core/facets/float.rb +2 -0
- data/lib/core/facets/functor.rb +92 -0
- data/lib/core/facets/hash/alias.rb +31 -0
- data/lib/core/facets/hash/argumentize.rb +28 -0
- data/lib/core/facets/hash/at.rb +8 -0
- data/lib/core/facets/hash/autonew.rb +24 -0
- data/lib/core/facets/hash/collate.rb +49 -0
- data/lib/core/facets/hash/count.rb +16 -0
- data/lib/core/facets/hash/data.rb +44 -0
- data/lib/core/facets/hash/dearray_values.rb +46 -0
- data/lib/core/facets/hash/deep_merge.rb +33 -0
- data/lib/core/facets/hash/deep_rekey.rb +54 -0
- data/lib/core/facets/hash/delete.rb +4 -0
- data/lib/core/facets/hash/delete_at.rb +7 -0
- data/lib/core/facets/hash/delete_unless.rb +17 -0
- data/lib/core/facets/hash/delete_values.rb +41 -0
- data/lib/core/facets/hash/diff.rb +17 -0
- data/lib/core/facets/hash/each_with_key.rb +12 -0
- data/lib/core/facets/hash/except.rb +37 -0
- data/lib/core/facets/hash/fetch_nested.rb +20 -0
- data/lib/core/facets/hash/graph.rb +18 -0
- data/lib/core/facets/hash/insert.rb +19 -0
- data/lib/core/facets/hash/inverse.rb +30 -0
- data/lib/core/facets/hash/join.rb +17 -0
- data/lib/core/facets/hash/keys.rb +36 -0
- data/lib/core/facets/hash/mash.rb +1 -0
- data/lib/core/facets/hash/new_with.rb +15 -0
- data/lib/core/facets/hash/only_keys.rb +1 -0
- data/lib/core/facets/hash/op.rb +7 -0
- data/lib/core/facets/hash/op_add.rb +12 -0
- data/lib/core/facets/hash/op_and.rb +33 -0
- data/lib/core/facets/hash/op_mul.rb +18 -0
- data/lib/core/facets/hash/op_or.rb +12 -0
- data/lib/core/facets/hash/op_push.rb +25 -0
- data/lib/core/facets/hash/op_sub.rb +27 -0
- data/lib/core/facets/hash/recurse.rb +29 -0
- data/lib/core/facets/hash/recursively.rb +61 -0
- data/lib/core/facets/hash/rekey.rb +81 -0
- data/lib/core/facets/hash/replace_each.rb +16 -0
- data/lib/core/facets/hash/revalue.rb +61 -0
- data/lib/core/facets/hash/reverse_merge.rb +30 -0
- data/lib/core/facets/hash/slice.rb +49 -0
- data/lib/core/facets/hash/stringify_keys.rb +1 -0
- data/lib/core/facets/hash/subset.rb +27 -0
- data/lib/core/facets/hash/swap.rb +17 -0
- data/lib/core/facets/hash/symbolize_keys.rb +92 -0
- data/lib/core/facets/hash/to_mod.rb +33 -0
- data/lib/core/facets/hash/to_options.rb +1 -0
- data/lib/core/facets/hash/to_proc.rb +39 -0
- data/lib/core/facets/hash/to_struct.rb +17 -0
- data/lib/core/facets/hash/traverse.rb +47 -0
- data/lib/core/facets/hash/update.rb +6 -0
- data/lib/core/facets/hash/update_each.rb +18 -0
- data/lib/core/facets/hash/update_keys.rb +21 -0
- data/lib/core/facets/hash/update_values.rb +20 -0
- data/lib/core/facets/hash/weave.rb +76 -0
- data/lib/core/facets/hash/zip.rb +18 -0
- data/lib/core/facets/hash.rb +53 -0
- data/lib/core/facets/indexable.rb +270 -0
- data/lib/core/facets/integer/bit.rb +1 -0
- data/lib/core/facets/integer/bitmask.rb +99 -0
- data/lib/core/facets/integer/factorial.rb +21 -0
- data/lib/core/facets/integer/multiple.rb +19 -0
- data/lib/core/facets/integer/of.rb +18 -0
- data/lib/core/facets/integer/ordinal.rb +24 -0
- data/lib/core/facets/integer/roman.rb +1 -0
- data/lib/core/facets/integer.rb +8 -0
- data/lib/core/facets/kernel/__class__.rb +9 -0
- data/lib/core/facets/kernel/__dir__.rb +28 -0
- data/lib/core/facets/kernel/__get__.rb +15 -0
- data/lib/core/facets/kernel/__set__.rb +1 -0
- data/lib/core/facets/kernel/as.rb +116 -0
- data/lib/core/facets/kernel/ask.rb +28 -0
- data/lib/core/facets/kernel/assign.rb +74 -0
- data/lib/core/facets/kernel/assign_from.rb +1 -0
- data/lib/core/facets/kernel/attr_singleton.rb +59 -0
- data/lib/core/facets/kernel/blank.rb +84 -0
- data/lib/core/facets/kernel/call_stack.rb +1 -0
- data/lib/core/facets/kernel/callstack.rb +56 -0
- data/lib/core/facets/kernel/case.rb +8 -0
- data/lib/core/facets/kernel/complete.rb +26 -0
- data/lib/core/facets/kernel/d.rb +27 -0
- data/lib/core/facets/kernel/deep_clone.rb +27 -0
- data/lib/core/facets/kernel/deep_copy.rb +14 -0
- data/lib/core/facets/kernel/demo.rb +30 -0
- data/lib/core/facets/kernel/disable_warnings.rb +26 -0
- data/lib/core/facets/kernel/eigen.rb +2 -0
- data/lib/core/facets/kernel/eigenclass.rb +24 -0
- data/lib/core/facets/kernel/enable_warnings.rb +1 -0
- data/lib/core/facets/kernel/ergo.rb +43 -0
- data/lib/core/facets/kernel/extend.rb +28 -0
- data/lib/core/facets/kernel/extension.rb +12 -0
- data/lib/core/facets/kernel/false.rb +2 -0
- data/lib/core/facets/kernel/here.rb +11 -0
- data/lib/core/facets/kernel/hierarchical_send.rb +44 -0
- data/lib/core/facets/kernel/identical.rb +4 -0
- data/lib/core/facets/kernel/in.rb +13 -0
- data/lib/core/facets/kernel/instance_assign.rb +22 -0
- data/lib/core/facets/kernel/instance_class.rb +26 -0
- data/lib/core/facets/kernel/instance_exec.rb +47 -0
- data/lib/core/facets/kernel/instance_extract.rb +22 -0
- data/lib/core/facets/kernel/instance_replace.rb +40 -0
- data/lib/core/facets/kernel/instance_send.rb +7 -0
- data/lib/core/facets/kernel/like.rb +19 -0
- data/lib/core/facets/kernel/load_all.rb +1 -0
- data/lib/core/facets/kernel/load_relative.rb +25 -0
- data/lib/core/facets/kernel/maybe.rb +19 -0
- data/lib/core/facets/kernel/memo.rb +44 -0
- data/lib/core/facets/kernel/meta.rb +35 -0
- data/lib/core/facets/kernel/meta_alias.rb +23 -0
- data/lib/core/facets/kernel/meta_class.rb +17 -0
- data/lib/core/facets/kernel/meta_def.rb +24 -0
- data/lib/core/facets/kernel/meta_eval.rb +20 -0
- data/lib/core/facets/kernel/method.rb +50 -0
- data/lib/core/facets/kernel/no.rb +1 -0
- data/lib/core/facets/kernel/not.rb +37 -0
- data/lib/core/facets/kernel/not_nil.rb +18 -0
- data/lib/core/facets/kernel/object_class.rb +10 -0
- data/lib/core/facets/kernel/object_hexid.rb +33 -0
- data/lib/core/facets/kernel/object_send.rb +30 -0
- data/lib/core/facets/kernel/p.rb +24 -0
- data/lib/core/facets/kernel/presence.rb +1 -0
- data/lib/core/facets/kernel/present.rb +1 -0
- data/lib/core/facets/kernel/qua_class.rb +31 -0
- data/lib/core/facets/kernel/require_all.rb +42 -0
- data/lib/core/facets/kernel/respond.rb +32 -0
- data/lib/core/facets/kernel/returning.rb +27 -0
- data/lib/core/facets/kernel/silence.rb +73 -0
- data/lib/core/facets/kernel/silence_warnings.rb +1 -0
- data/lib/core/facets/kernel/singleton_class.rb +10 -0
- data/lib/core/facets/kernel/super_method.rb +11 -0
- data/lib/core/facets/kernel/tap.rb +36 -0
- data/lib/core/facets/kernel/temporarily.rb +23 -0
- data/lib/core/facets/kernel/trap_chain.rb +28 -0
- data/lib/core/facets/kernel/true.rb +26 -0
- data/lib/core/facets/kernel/try.rb +58 -0
- data/lib/core/facets/kernel/val.rb +19 -0
- data/lib/core/facets/kernel/with.rb +20 -0
- data/lib/core/facets/kernel/writers.rb +91 -0
- data/lib/core/facets/kernel/y.rb +23 -0
- data/lib/core/facets/kernel/yes.rb +25 -0
- data/lib/core/facets/kernel.rb +75 -0
- data/lib/core/facets/lazy.rb +237 -0
- data/lib/core/facets/load_path/search.rb +16 -0
- data/lib/core/facets/load_path.rb +1 -0
- data/lib/core/facets/matchdata/match.rb +15 -0
- data/lib/core/facets/matchdata/matchset.rb +44 -0
- data/lib/core/facets/matchdata/matchtree.rb +2 -0
- data/lib/core/facets/matchdata.rb +3 -0
- data/lib/core/facets/metaid.rb +7 -0
- data/lib/core/facets/method/composition.rb +96 -0
- data/lib/core/facets/method/curry.rb +13 -0
- data/lib/core/facets/method/memoize.rb +17 -0
- data/lib/core/facets/method/op_mul.rb +1 -0
- data/lib/core/facets/method/op_pow.rb +1 -0
- data/lib/core/facets/method/partial.rb +10 -0
- data/lib/core/facets/method/public.rb +33 -0
- data/lib/core/facets/method.rb +5 -0
- data/lib/core/facets/module/abstract.rb +24 -0
- data/lib/core/facets/module/alias_accessor.rb +45 -0
- data/lib/core/facets/module/alias_class_method.rb +11 -0
- data/lib/core/facets/module/alias_method_chain.rb +67 -0
- data/lib/core/facets/module/alias_module_function.rb +30 -0
- data/lib/core/facets/module/all_instance_methods.rb +19 -0
- data/lib/core/facets/module/ancestor.rb +16 -0
- data/lib/core/facets/module/anonymous.rb +25 -0
- data/lib/core/facets/module/attr_class_accessor.rb +51 -0
- data/lib/core/facets/module/attr_setter.rb +52 -0
- data/lib/core/facets/module/attr_tester.rb +56 -0
- data/lib/core/facets/module/attr_validator.rb +46 -0
- data/lib/core/facets/module/basename.rb +1 -0
- data/lib/core/facets/module/can.rb +20 -0
- data/lib/core/facets/module/cattr.rb +1 -0
- data/lib/core/facets/module/class.rb +12 -0
- data/lib/core/facets/module/class_accessor.rb +46 -0
- data/lib/core/facets/module/class_def.rb +2 -0
- data/lib/core/facets/module/class_extend.rb +92 -0
- data/lib/core/facets/module/class_inheritor.rb +80 -0
- data/lib/core/facets/module/class_method_defined.rb +1 -0
- data/lib/core/facets/module/copy_inheritor.rb +45 -0
- data/lib/core/facets/module/enclosure.rb +94 -0
- data/lib/core/facets/module/enclosures.rb +1 -0
- data/lib/core/facets/module/extend.rb +1 -0
- data/lib/core/facets/module/home.rb +90 -0
- data/lib/core/facets/module/homename.rb +1 -0
- data/lib/core/facets/module/housing.rb +1 -0
- data/lib/core/facets/module/include_as.rb +1 -0
- data/lib/core/facets/module/include_function_module.rb +25 -0
- data/lib/core/facets/module/instance_function.rb +94 -0
- data/lib/core/facets/module/instance_method.rb +25 -0
- data/lib/core/facets/module/instance_method_defined.rb +23 -0
- data/lib/core/facets/module/integrate.rb +49 -0
- data/lib/core/facets/module/is.rb +57 -0
- data/lib/core/facets/module/lastname.rb +30 -0
- data/lib/core/facets/module/let.rb +31 -0
- data/lib/core/facets/module/mattr.rb +296 -0
- data/lib/core/facets/module/memoize.rb +16 -0
- data/lib/core/facets/module/method_clash.rb +66 -0
- data/lib/core/facets/module/method_space.rb +107 -0
- data/lib/core/facets/module/methodize.rb +20 -0
- data/lib/core/facets/module/modname.rb +1 -0
- data/lib/core/facets/module/module_def.rb +31 -0
- data/lib/core/facets/module/module_load.rb +83 -0
- data/lib/core/facets/module/nodef.rb +13 -0
- data/lib/core/facets/module/op.rb +107 -0
- data/lib/core/facets/module/op_add.rb +1 -0
- data/lib/core/facets/module/op_mul.rb +1 -0
- data/lib/core/facets/module/op_sub.rb +1 -0
- data/lib/core/facets/module/pathize.rb +20 -0
- data/lib/core/facets/module/preextend.rb +32 -0
- data/lib/core/facets/module/redefine_method.rb +37 -0
- data/lib/core/facets/module/redirect_method.rb +46 -0
- data/lib/core/facets/module/remove.rb +1 -0
- data/lib/core/facets/module/rename_method.rb +30 -0
- data/lib/core/facets/module/revise.rb +41 -0
- data/lib/core/facets/module/set.rb +36 -0
- data/lib/core/facets/module/singleton_method_defined.rb +1 -0
- data/lib/core/facets/module/spacename.rb +25 -0
- data/lib/core/facets/module/to_obj.rb +20 -0
- data/lib/core/facets/module/wrap_method.rb +35 -0
- data/lib/core/facets/module.rb +60 -0
- data/lib/core/facets/na.rb +21 -0
- data/lib/core/facets/nilclass/ergo.rb +1 -0
- data/lib/core/facets/nilclass.rb +2 -0
- data/lib/core/facets/numeric/approx.rb +39 -0
- data/lib/core/facets/numeric/close.rb +1 -0
- data/lib/core/facets/numeric/delimit.rb +20 -0
- data/lib/core/facets/numeric/distance.rb +14 -0
- data/lib/core/facets/numeric/length.rb +10 -0
- data/lib/core/facets/numeric/negative.rb +1 -0
- data/lib/core/facets/numeric/positive.rb +15 -0
- data/lib/core/facets/numeric/range.rb +12 -0
- data/lib/core/facets/numeric/round_to.rb +32 -0
- data/lib/core/facets/numeric/spacing.rb +20 -0
- data/lib/core/facets/numeric.rb +8 -0
- data/lib/core/facets/object/clone.rb +1 -0
- data/lib/core/facets/object/dup.rb +79 -0
- data/lib/core/facets/object/itself.rb +16 -0
- data/lib/core/facets/object/object_state.rb +77 -0
- data/lib/core/facets/object/try_dup.rb +1 -0
- data/lib/core/facets/object.rb +7 -0
- data/lib/core/facets/objectspace/classes.rb +11 -0
- data/lib/core/facets/objectspace/op_fetch.rb +3 -0
- data/lib/core/facets/objectspace.rb +3 -0
- data/lib/core/facets/proc/bind.rb +24 -0
- data/lib/core/facets/proc/bind_to.rb +17 -0
- data/lib/core/facets/proc/compose.rb +42 -0
- data/lib/core/facets/proc/partial.rb +33 -0
- data/lib/core/facets/proc/to_method.rb +38 -0
- data/lib/core/facets/proc/update.rb +9 -0
- data/lib/core/facets/proc/wrap.rb +17 -0
- data/lib/core/facets/proc.rb +7 -0
- data/lib/core/facets/process/daemon.rb +32 -0
- data/lib/core/facets/process.rb +2 -0
- data/lib/core/facets/range/combine.rb +47 -0
- data/lib/core/facets/range/nudge.rb +27 -0
- data/lib/core/facets/range/op_add.rb +15 -0
- data/lib/core/facets/range/op_sub.rb +45 -0
- data/lib/core/facets/range/overlap.rb +12 -0
- data/lib/core/facets/range/quantile.rb +18 -0
- data/lib/core/facets/range/to_rng.rb +26 -0
- data/lib/core/facets/range/umbrella.rb +1 -0
- data/lib/core/facets/range/within.rb +64 -0
- data/lib/core/facets/range.rb +9 -0
- data/lib/core/facets/regexp/arity.rb +17 -0
- data/lib/core/facets/regexp/multiline.rb +13 -0
- data/lib/core/facets/regexp/op_add.rb +18 -0
- data/lib/core/facets/regexp/op_or.rb +15 -0
- data/lib/core/facets/regexp/to_proc.rb +13 -0
- data/lib/core/facets/regexp/to_re.rb +28 -0
- data/lib/core/facets/regexp.rb +6 -0
- data/lib/core/facets/roman.rb +89 -0
- data/lib/core/facets/string/acronym.rb +11 -0
- data/lib/core/facets/string/align.rb +125 -0
- data/lib/core/facets/string/ascii_only.rb +52 -0
- data/lib/core/facets/string/bracket.rb +64 -0
- data/lib/core/facets/string/briefcase.rb +1 -0
- data/lib/core/facets/string/camelcase.rb +73 -0
- data/lib/core/facets/string/capitalized.rb +49 -0
- data/lib/core/facets/string/cleanlines.rb +27 -0
- data/lib/core/facets/string/cleave.rb +36 -0
- data/lib/core/facets/string/cmp.rb +1 -0
- data/lib/core/facets/string/compress_lines.rb +17 -0
- data/lib/core/facets/string/crypt.rb +22 -0
- data/lib/core/facets/string/divide.rb +18 -0
- data/lib/core/facets/string/each_match.rb +1 -0
- data/lib/core/facets/string/each_word.rb +17 -0
- data/lib/core/facets/string/edit_distance.rb +124 -0
- data/lib/core/facets/string/ends_with.rb +1 -0
- data/lib/core/facets/string/exclude.rb +10 -0
- data/lib/core/facets/string/expand_tab.rb +35 -0
- data/lib/core/facets/string/file.rb +21 -0
- data/lib/core/facets/string/fold.rb +39 -0
- data/lib/core/facets/string/indent.rb +76 -0
- data/lib/core/facets/string/index_all.rb +24 -0
- data/lib/core/facets/string/indexable.rb +7 -0
- data/lib/core/facets/string/interpolate.rb +23 -0
- data/lib/core/facets/string/lchomp.rb +33 -0
- data/lib/core/facets/string/line_wrap.rb +18 -0
- data/lib/core/facets/string/linear.rb +19 -0
- data/lib/core/facets/string/lowercase.rb +1 -0
- data/lib/core/facets/string/margin.rb +55 -0
- data/lib/core/facets/string/methodize.rb +26 -0
- data/lib/core/facets/string/modulize.rb +31 -0
- data/lib/core/facets/string/mscan.rb +22 -0
- data/lib/core/facets/string/natcmp.rb +88 -0
- data/lib/core/facets/string/nchar.rb +32 -0
- data/lib/core/facets/string/newlines.rb +32 -0
- data/lib/core/facets/string/number.rb +14 -0
- data/lib/core/facets/string/op_div.rb +14 -0
- data/lib/core/facets/string/op_sub.rb +1 -0
- data/lib/core/facets/string/outdent.rb +1 -0
- data/lib/core/facets/string/pathize.rb +32 -0
- data/lib/core/facets/string/quote.rb +93 -0
- data/lib/core/facets/string/random.rb +44 -0
- data/lib/core/facets/string/range.rb +60 -0
- data/lib/core/facets/string/range_all.rb +1 -0
- data/lib/core/facets/string/range_of_line.rb +1 -0
- data/lib/core/facets/string/remove.rb +30 -0
- data/lib/core/facets/string/rewrite.rb +24 -0
- data/lib/core/facets/string/roman.rb +1 -0
- data/lib/core/facets/string/rotate.rb +24 -0
- data/lib/core/facets/string/shatter.rb +22 -0
- data/lib/core/facets/string/similarity.rb +90 -0
- data/lib/core/facets/string/snakecase.rb +31 -0
- data/lib/core/facets/string/splice.rb +33 -0
- data/lib/core/facets/string/squish.rb +22 -0
- data/lib/core/facets/string/starts_with.rb +5 -0
- data/lib/core/facets/string/store.rb +7 -0
- data/lib/core/facets/string/subtract.rb +4 -0
- data/lib/core/facets/string/titlecase.rb +27 -0
- data/lib/core/facets/string/to_re.rb +26 -0
- data/lib/core/facets/string/to_rx.rb +1 -0
- data/lib/core/facets/string/trim.rb +45 -0
- data/lib/core/facets/string/unbracket.rb +1 -0
- data/lib/core/facets/string/underscore.rb +1 -0
- data/lib/core/facets/string/unfold.rb +32 -0
- data/lib/core/facets/string/unindent.rb +1 -0
- data/lib/core/facets/string/unquote.rb +1 -0
- data/lib/core/facets/string/uppercase.rb +23 -0
- data/lib/core/facets/string/variablize.rb +13 -0
- data/lib/core/facets/string/word_wrap.rb +32 -0
- data/lib/core/facets/string/words.rb +24 -0
- data/lib/core/facets/string/xor.rb +26 -0
- data/lib/core/facets/string.rb +67 -0
- data/lib/core/facets/struct/attributes.rb +15 -0
- data/lib/core/facets/struct/replace.rb +8 -0
- data/lib/core/facets/struct.rb +3 -0
- data/lib/core/facets/symbol/as_s.rb +19 -0
- data/lib/core/facets/symbol/bang.rb +1 -0
- data/lib/core/facets/symbol/call.rb +29 -0
- data/lib/core/facets/symbol/chomp.rb +24 -0
- data/lib/core/facets/symbol/generate.rb +24 -0
- data/lib/core/facets/symbol/not.rb +29 -0
- data/lib/core/facets/symbol/op_div.rb +21 -0
- data/lib/core/facets/symbol/plain.rb +51 -0
- data/lib/core/facets/symbol/query.rb +1 -0
- data/lib/core/facets/symbol/reader.rb +1 -0
- data/lib/core/facets/symbol/setter.rb +1 -0
- data/lib/core/facets/symbol/succ.rb +23 -0
- data/lib/core/facets/symbol/thrown.rb +22 -0
- data/lib/core/facets/symbol/variablize.rb +14 -0
- data/lib/core/facets/symbol/writer.rb +1 -0
- data/lib/core/facets/symbol.rb +14 -0
- data/lib/core/facets/time/ago.rb +1 -0
- data/lib/core/facets/time/change.rb +46 -0
- data/lib/core/facets/time/dst_adjustment.rb +24 -0
- data/lib/core/facets/time/elapse.rb +18 -0
- data/lib/core/facets/time/future.rb +16 -0
- data/lib/core/facets/time/hence.rb +1 -0
- data/lib/core/facets/time/in.rb +1 -0
- data/lib/core/facets/time/less.rb +1 -0
- data/lib/core/facets/time/past.rb +1 -0
- data/lib/core/facets/time/round_to.rb +21 -0
- data/lib/core/facets/time/set.rb +27 -0
- data/lib/core/facets/time/shift.rb +97 -0
- data/lib/core/facets/time/stamp.rb +47 -0
- data/lib/core/facets/time/to_time.rb +21 -0
- data/lib/core/facets/time/trunc.rb +15 -0
- data/lib/core/facets/time.rb +16 -0
- data/lib/core/facets/unboundmethod/arguments.rb +44 -0
- data/lib/core/facets/unboundmethod.rb +2 -0
- data/lib/core/facets/version.rb +18 -0
- data/lib/core/facets.rb +40 -0
- data/lib/core/facets.yml +80 -0
- data/lib/facets-glimmer/ext/kernel.rb +8 -0
- data/lib/facets-glimmer.rb +33 -0
- data/lib/standard/facets/against.rb +53 -0
- data/lib/standard/facets/argvector.rb +343 -0
- data/lib/standard/facets/binding/block_exec.rb +44 -0
- data/lib/standard/facets/cgi/esc.rb +11 -0
- data/lib/standard/facets/cgi/escape_html.rb +63 -0
- data/lib/standard/facets/cgi/marshal.rb +20 -0
- data/lib/standard/facets/cgi.rb +6 -0
- data/lib/standard/facets/cli.rb +54 -0
- data/lib/standard/facets/cloneable.rb +67 -0
- data/lib/standard/facets/continuation.rb +56 -0
- data/lib/standard/facets/date/cmp.rb +32 -0
- data/lib/standard/facets/date.rb +434 -0
- data/lib/standard/facets/digest/base64digest.rb +45 -0
- data/lib/standard/facets/digest/salted_digest.rb +44 -0
- data/lib/standard/facets/digest.rb +2 -0
- data/lib/standard/facets/enumargs.rb +191 -0
- data/lib/standard/facets/equitable.rb +76 -0
- data/lib/standard/facets/erb.rb +66 -0
- data/lib/standard/facets/fileutils/amass.rb +34 -0
- data/lib/standard/facets/fileutils/cp_rx.rb +42 -0
- data/lib/standard/facets/fileutils/head.rb +1 -0
- data/lib/standard/facets/fileutils/ln_r.rb +98 -0
- data/lib/standard/facets/fileutils/outofdate.rb +38 -0
- data/lib/standard/facets/fileutils/safe_ln.rb +27 -0
- data/lib/standard/facets/fileutils/slice.rb +55 -0
- data/lib/standard/facets/fileutils/stage.rb +66 -0
- data/lib/standard/facets/fileutils/tail.rb +1 -0
- data/lib/standard/facets/fileutils/wc.rb +63 -0
- data/lib/standard/facets/fileutils/whereis.rb +66 -0
- data/lib/standard/facets/fileutils/which.rb +60 -0
- data/lib/standard/facets/fileutils.rb +13 -0
- data/lib/standard/facets/find/select.rb +16 -0
- data/lib/standard/facets/find.rb +2 -0
- data/lib/standard/facets/gem/search.rb +18 -0
- data/lib/standard/facets/gem/specification/current_specs.rb +21 -0
- data/lib/standard/facets/gem/specification/find_requireable_file.rb +21 -0
- data/lib/standard/facets/getoptlong.rb +59 -0
- data/lib/standard/facets/hash_builder.rb +46 -0
- data/lib/standard/facets/instantiable.rb +25 -0
- data/lib/standard/facets/interval.rb +277 -0
- data/lib/standard/facets/load_monitor.rb +26 -0
- data/lib/standard/facets/math/abs.rb +8 -0
- data/lib/standard/facets/math/acosec.rb +1 -0
- data/lib/standard/facets/math/acot.rb +8 -0
- data/lib/standard/facets/math/acoth.rb +8 -0
- data/lib/standard/facets/math/acsc.rb +13 -0
- data/lib/standard/facets/math/acsch.rb +8 -0
- data/lib/standard/facets/math/amd.rb +17 -0
- data/lib/standard/facets/math/approx_equal.rb +15 -0
- data/lib/standard/facets/math/asec.rb +8 -0
- data/lib/standard/facets/math/asech.rb +8 -0
- data/lib/standard/facets/math/atkinson_index.rb +16 -0
- data/lib/standard/facets/math/beta.rb +14 -0
- data/lib/standard/facets/math/cdf.rb +10 -0
- data/lib/standard/facets/math/ceil.rb +8 -0
- data/lib/standard/facets/math/cosec.rb +1 -0
- data/lib/standard/facets/math/cosech.rb +1 -0
- data/lib/standard/facets/math/cot.rb +8 -0
- data/lib/standard/facets/math/coth.rb +8 -0
- data/lib/standard/facets/math/csc.rb +13 -0
- data/lib/standard/facets/math/csch.rb +13 -0
- data/lib/standard/facets/math/delta.rb +9 -0
- data/lib/standard/facets/math/distance.rb +19 -0
- data/lib/standard/facets/math/ec.rb +5 -0
- data/lib/standard/facets/math/epsilon.rb +21 -0
- data/lib/standard/facets/math/exp10.rb +8 -0
- data/lib/standard/facets/math/exp2.rb +8 -0
- data/lib/standard/facets/math/factorial.rb +37 -0
- data/lib/standard/facets/math/floor.rb +8 -0
- data/lib/standard/facets/math/gcd.rb +23 -0
- data/lib/standard/facets/math/gini_coefficient.rb +33 -0
- data/lib/standard/facets/math/kldivergence.rb +19 -0
- data/lib/standard/facets/math/lcm.rb +15 -0
- data/lib/standard/facets/math/lgamma.rb +23 -0
- data/lib/standard/facets/math/linsolve.rb +12 -0
- data/lib/standard/facets/math/lngamma.rb +18 -0
- data/lib/standard/facets/math/log2.rb +14 -0
- data/lib/standard/facets/math/max.rb +1 -0
- data/lib/standard/facets/math/mean.rb +16 -0
- data/lib/standard/facets/math/median.rb +30 -0
- data/lib/standard/facets/math/min.rb +35 -0
- data/lib/standard/facets/math/percentile.rb +40 -0
- data/lib/standard/facets/math/pow.rb +13 -0
- data/lib/standard/facets/math/pstd.rb +1 -0
- data/lib/standard/facets/math/pvariance.rb +1 -0
- data/lib/standard/facets/math/rmd.rb +16 -0
- data/lib/standard/facets/math/root.rb +8 -0
- data/lib/standard/facets/math/round.rb +9 -0
- data/lib/standard/facets/math/sec.rb +8 -0
- data/lib/standard/facets/math/sech.rb +8 -0
- data/lib/standard/facets/math/sign.rb +20 -0
- data/lib/standard/facets/math/sinc.rb +8 -0
- data/lib/standard/facets/math/sqr.rb +8 -0
- data/lib/standard/facets/math/sqsolve.rb +55 -0
- data/lib/standard/facets/math/std.rb +27 -0
- data/lib/standard/facets/math/stderr.rb +1 -0
- data/lib/standard/facets/math/sum.rb +16 -0
- data/lib/standard/facets/math/summed_sqdevs.rb +14 -0
- data/lib/standard/facets/math/tau.rb +5 -0
- data/lib/standard/facets/math/tgamma.rb +10 -0
- data/lib/standard/facets/math/theil_index.rb +24 -0
- data/lib/standard/facets/math/variance.rb +31 -0
- data/lib/standard/facets/math.rb +58 -0
- data/lib/standard/facets/memoizable.rb +141 -0
- data/lib/standard/facets/memoizer.rb +63 -0
- data/lib/standard/facets/multipliers.rb +65 -0
- data/lib/standard/facets/multiton.rb +387 -0
- data/lib/standard/facets/net/http.rb +51 -0
- data/lib/standard/facets/nullclass.rb +38 -0
- data/lib/standard/facets/opesc.rb +79 -0
- data/lib/standard/facets/ostruct/each.rb +11 -0
- data/lib/standard/facets/ostruct/initialize.rb +48 -0
- data/lib/standard/facets/ostruct/merge.rb +21 -0
- data/lib/standard/facets/ostruct/op_fetch.rb +29 -0
- data/lib/standard/facets/ostruct/op_store.rb +1 -0
- data/lib/standard/facets/ostruct/to_h.rb +10 -0
- data/lib/standard/facets/ostruct/to_ostruct.rb +65 -0
- data/lib/standard/facets/ostruct.rb +89 -0
- data/lib/standard/facets/pathname/chdir.rb +15 -0
- data/lib/standard/facets/pathname/empty.rb +10 -0
- data/lib/standard/facets/pathname/exists.rb +6 -0
- data/lib/standard/facets/pathname/glob.rb +57 -0
- data/lib/standard/facets/pathname/home.rb +12 -0
- data/lib/standard/facets/pathname/null.rb +20 -0
- data/lib/standard/facets/pathname/op_div.rb +15 -0
- data/lib/standard/facets/pathname/op_fetch.rb +13 -0
- data/lib/standard/facets/pathname/outofdate.rb +13 -0
- data/lib/standard/facets/pathname/readline.rb +13 -0
- data/lib/standard/facets/pathname/root.rb +10 -0
- data/lib/standard/facets/pathname/rootname.rb +10 -0
- data/lib/standard/facets/pathname/safe.rb +15 -0
- data/lib/standard/facets/pathname/split_root.rb +9 -0
- data/lib/standard/facets/pathname/to_path.rb +28 -0
- data/lib/standard/facets/pathname/to_str.rb +8 -0
- data/lib/standard/facets/pathname/uptodate.rb +11 -0
- data/lib/standard/facets/pathname/visit.rb +38 -0
- data/lib/standard/facets/pathname/work.rb +10 -0
- data/lib/standard/facets/pathname.rb +56 -0
- data/lib/standard/facets/platform.rb +377 -0
- data/lib/standard/facets/random.rb +485 -0
- data/lib/standard/facets/rbconfig.rb +78 -0
- data/lib/standard/facets/set.rb +36 -0
- data/lib/standard/facets/shellwords.rb +115 -0
- data/lib/standard/facets/strscan.rb +16 -0
- data/lib/standard/facets/thread.rb +98 -0
- data/lib/standard/facets/timer.rb +217 -0
- data/lib/standard/facets/tuple.rb +280 -0
- data/lib/standard/facets/uri/cgi_escape.rb +46 -0
- data/lib/standard/facets/uri/cgi_parse.rb +1 -0
- data/lib/standard/facets/uri/cgi_unescape.rb +1 -0
- data/lib/standard/facets/uri/decode.rb +32 -0
- data/lib/standard/facets/uri/parameters.rb +63 -0
- data/lib/standard/facets/uri/query.rb +148 -0
- data/lib/standard/facets/uri.rb +40 -0
- data/lib/standard/facets/yaml/file.rb +41 -0
- data/lib/standard/facets/yaml/kernel.rb +29 -0
- data/lib/standard/facets/yaml/read.rb +12 -0
- data/lib/standard/facets/yaml.rb +6 -0
- data/lib/standard/facets/zlib.rb +38 -0
- data/test/core/array/test_arrange.rb +37 -0
- data/test/core/array/test_average.rb +16 -0
- data/test/core/array/test_before.rb +48 -0
- data/test/core/array/test_collapse.rb +23 -0
- data/test/core/array/test_commonality.rb +35 -0
- data/test/core/array/test_conjoin.rb +50 -0
- data/test/core/array/test_contains.rb +14 -0
- data/test/core/array/test_delete.rb +42 -0
- data/test/core/array/test_delete_unless.rb +17 -0
- data/test/core/array/test_delete_values.rb +31 -0
- data/test/core/array/test_divide.rb +24 -0
- data/test/core/array/test_duplicates.rb +29 -0
- data/test/core/array/test_each_overlap.rb +31 -0
- data/test/core/array/test_each_pair.rb +16 -0
- data/test/core/array/test_each_value.rb +16 -0
- data/test/core/array/test_entropy.rb +23 -0
- data/test/core/array/test_extract_options.rb +28 -0
- data/test/core/array/test_first.rb +17 -0
- data/test/core/array/test_from.rb +42 -0
- data/test/core/array/test_intersection.rb +19 -0
- data/test/core/array/test_last.rb +17 -0
- data/test/core/array/test_median.rb +27 -0
- data/test/core/array/test_merge.rb +27 -0
- data/test/core/array/test_missing.rb +12 -0
- data/test/core/array/test_mode.rb +17 -0
- data/test/core/array/test_nonuniq.rb +25 -0
- data/test/core/array/test_not_empty.rb +17 -0
- data/test/core/array/test_occur.rb +52 -0
- data/test/core/array/test_occurrence.rb +20 -0
- data/test/core/array/test_only.rb +17 -0
- data/test/core/array/test_op_pow.rb +13 -0
- data/test/core/array/test_pad.rb +40 -0
- data/test/core/array/test_peek.rb +28 -0
- data/test/core/array/test_poke.rb +21 -0
- data/test/core/array/test_probability.rb +18 -0
- data/test/core/array/test_pull.rb +15 -0
- data/test/core/array/test_recurse.rb +40 -0
- data/test/core/array/test_recursively.rb +33 -0
- data/test/core/array/test_reject_values.rb +17 -0
- data/test/core/array/test_span.rb +18 -0
- data/test/core/array/test_splice.rb +21 -0
- data/test/core/array/test_split.rb +22 -0
- data/test/core/array/test_split_at.rb +26 -0
- data/test/core/array/test_squeeze.rb +22 -0
- data/test/core/array/test_standard_deviation.rb +18 -0
- data/test/core/array/test_step.rb +28 -0
- data/test/core/array/test_store.rb +22 -0
- data/test/core/array/test_to_h.rb +14 -0
- data/test/core/array/test_traverse.rb +26 -0
- data/test/core/array/test_uniq_by.rb +24 -0
- data/test/core/array/test_unique_permutation.rb +23 -0
- data/test/core/array/test_variance.rb +17 -0
- data/test/core/array/test_zip.rb +13 -0
- data/test/core/binding/test_caller.rb +69 -0
- data/test/core/binding/test_defined.rb +18 -0
- data/test/core/binding/test_op.rb +24 -0
- data/test/core/binding/test_self.rb +16 -0
- data/test/core/class/test_descendents.rb +19 -0
- data/test/core/class/test_preallocate.rb +32 -0
- data/test/core/class/test_subclasses.rb +21 -0
- data/test/core/class/test_to_proc.rb +16 -0
- data/test/core/comparable/test_bound.rb +32 -0
- data/test/core/comparable/test_cap.rb +36 -0
- data/test/core/comparable/test_clip.rb +31 -0
- data/test/core/comparable/test_cmp.rb +16 -0
- data/test/core/comparable/test_op_get.rb +61 -0
- data/test/core/denumerable_tc.rb +194 -0
- data/test/core/dir/test_ascend.rb +40 -0
- data/test/core/dir/test_descend.rb +24 -0
- data/test/core/dir/test_each_child.rb +22 -0
- data/test/core/dir/test_multiglob.rb +25 -0
- data/test/core/dir/test_parent.rb +14 -0
- data/test/core/dir/test_recurse.rb +26 -0
- data/test/core/enumerable/test_accumulate.rb +44 -0
- data/test/core/enumerable/test_cluster.rb +36 -0
- data/test/core/enumerable/test_compact_map.rb +32 -0
- data/test/core/enumerable/test_defer.rb +27 -0
- data/test/core/enumerable/test_each_by.rb +49 -0
- data/test/core/enumerable/test_every.rb +33 -0
- data/test/core/enumerable/test_ewise.rb +30 -0
- data/test/core/enumerable/test_exclude.rb +15 -0
- data/test/core/enumerable/test_expand.rb +15 -0
- data/test/core/enumerable/test_filter.rb +19 -0
- data/test/core/enumerable/test_find_yield.rb +96 -0
- data/test/core/enumerable/test_frequency.rb +15 -0
- data/test/core/enumerable/test_graph.rb +42 -0
- data/test/core/enumerable/test_hashify.rb +113 -0
- data/test/core/enumerable/test_key_by.rb +22 -0
- data/test/core/enumerable/test_map_by.rb +27 -0
- data/test/core/enumerable/test_map_send.rb +26 -0
- data/test/core/enumerable/test_map_with_index.rb +23 -0
- data/test/core/enumerable/test_mash.rb +17 -0
- data/test/core/enumerable/test_modulate.rb +17 -0
- data/test/core/enumerable/test_occur.rb +40 -0
- data/test/core/enumerable/test_only.rb +40 -0
- data/test/core/enumerable/test_per.rb +19 -0
- data/test/core/enumerable/test_purge.rb +22 -0
- data/test/core/enumerable/test_recursively.rb +33 -0
- data/test/core/enumerable/test_squeeze.rb +35 -0
- data/test/core/enumerable/test_sum.rb +40 -0
- data/test/core/enumerable/test_uniq_by.rb +25 -0
- data/test/core/enumerable/test_visit.rb +14 -0
- data/test/core/enumerable/test_with_position.rb +42 -0
- data/test/core/enumerator/lazy/test_squeeze.rb +33 -0
- data/test/core/enumerator/test_fx.rb +16 -0
- data/test/core/enumerator/test_new.rb +21 -0
- data/test/core/enumerator_tc.rb +40 -0
- data/test/core/exception/test_detail.rb +15 -0
- data/test/core/exception/test_raised.rb +15 -0
- data/test/core/exception/test_suppress.rb +16 -0
- data/test/core/file/test_append.rb +22 -0
- data/test/core/file/test_create.rb +17 -0
- data/test/core/file/test_ext.rb +31 -0
- data/test/core/file/test_null.rb +14 -0
- data/test/core/file/test_read_binary.rb +19 -0
- data/test/core/file/test_read_list.rb +16 -0
- data/test/core/file/test_rewrite.rb +35 -0
- data/test/core/file/test_rootname.rb +13 -0
- data/test/core/file/test_sanitize.rb +32 -0
- data/test/core/file/test_split_all.rb +14 -0
- data/test/core/file/test_write.rb +22 -0
- data/test/core/file/test_writelines.rb +21 -0
- data/test/core/filetest/test_root.rb +14 -0
- data/test/core/functor_tc.rb +41 -0
- data/test/core/hash/test_alias.rb +25 -0
- data/test/core/hash/test_argumentize.rb +23 -0
- data/test/core/hash/test_at.rb +16 -0
- data/test/core/hash/test_autonew.rb +22 -0
- data/test/core/hash/test_collate.rb +61 -0
- data/test/core/hash/test_count.rb +23 -0
- data/test/core/hash/test_data.rb +35 -0
- data/test/core/hash/test_dearray_values.rb +26 -0
- data/test/core/hash/test_deep_merge.rb +31 -0
- data/test/core/hash/test_deep_rekey.rb +131 -0
- data/test/core/hash/test_delete_at.rb +18 -0
- data/test/core/hash/test_delete_unless.rb +18 -0
- data/test/core/hash/test_delete_values.rb +30 -0
- data/test/core/hash/test_diff.rb +16 -0
- data/test/core/hash/test_each_with_key.rb +16 -0
- data/test/core/hash/test_expect.rb +34 -0
- data/test/core/hash/test_fetch_nested.rb +24 -0
- data/test/core/hash/test_graph.rb +40 -0
- data/test/core/hash/test_insert.rb +20 -0
- data/test/core/hash/test_inverse.rb +20 -0
- data/test/core/hash/test_join.rb +32 -0
- data/test/core/hash/test_keys.rb +41 -0
- data/test/core/hash/test_new_with.rb +17 -0
- data/test/core/hash/test_op_add.rb +17 -0
- data/test/core/hash/test_op_and.rb +31 -0
- data/test/core/hash/test_op_mul.rb +17 -0
- data/test/core/hash/test_op_or.rb +17 -0
- data/test/core/hash/test_op_push.rb +34 -0
- data/test/core/hash/test_op_sub.rb +28 -0
- data/test/core/hash/test_recurse.rb +39 -0
- data/test/core/hash/test_recursively.rb +71 -0
- data/test/core/hash/test_rekey.rb +119 -0
- data/test/core/hash/test_replace_each.rb +17 -0
- data/test/core/hash/test_revalue.rb +98 -0
- data/test/core/hash/test_reverse_merge.rb +39 -0
- data/test/core/hash/test_slice.rb +36 -0
- data/test/core/hash/test_stringify_keys.rb +26 -0
- data/test/core/hash/test_swap.rb +15 -0
- data/test/core/hash/test_symbolize_keys.rb +26 -0
- data/test/core/hash/test_to_mod.rb +24 -0
- data/test/core/hash/test_to_proc.rb +23 -0
- data/test/core/hash/test_to_struct.rb +22 -0
- data/test/core/hash/test_traverse.rb +29 -0
- data/test/core/hash/test_update_each.rb +16 -0
- data/test/core/hash/test_update_keys.rb +21 -0
- data/test/core/hash/test_update_values.rb +15 -0
- data/test/core/hash/test_weave.rb +18 -0
- data/test/core/hash/test_zip.rb +16 -0
- data/test/core/indexable_tc.rb +232 -0
- data/test/core/integer/test_bitmask.rb +73 -0
- data/test/core/integer/test_factorial.rb +30 -0
- data/test/core/integer/test_multiple.rb +16 -0
- data/test/core/integer/test_of.rb +36 -0
- data/test/core/integer/test_ordinal.rb +27 -0
- data/test/core/kernel/test_as.rb +74 -0
- data/test/core/kernel/test_ask.rb +9 -0
- data/test/core/kernel/test_assign.rb +61 -0
- data/test/core/kernel/test_assign_from.rb +48 -0
- data/test/core/kernel/test_attr_singleton.rb +51 -0
- data/test/core/kernel/test_blank.rb +103 -0
- data/test/core/kernel/test_callstack.rb +21 -0
- data/test/core/kernel/test_class.rb +14 -0
- data/test/core/kernel/test_complete.rb +19 -0
- data/test/core/kernel/test_d.rb +10 -0
- data/test/core/kernel/test_deep_clone.rb +31 -0
- data/test/core/kernel/test_deep_copy.rb +15 -0
- data/test/core/kernel/test_dir.rb +24 -0
- data/test/core/kernel/test_disable_warnings.rb +38 -0
- data/test/core/kernel/test_ergo.rb +34 -0
- data/test/core/kernel/test_extension.rb +18 -0
- data/test/core/kernel/test_get.rb +54 -0
- data/test/core/kernel/test_here.rb +13 -0
- data/test/core/kernel/test_hierarchical_send.rb +48 -0
- data/test/core/kernel/test_in.rb +14 -0
- data/test/core/kernel/test_instance_assign.rb +19 -0
- data/test/core/kernel/test_instance_class.rb +15 -0
- data/test/core/kernel/test_instance_extract.rb +28 -0
- data/test/core/kernel/test_instance_replace.rb +47 -0
- data/test/core/kernel/test_instance_send.rb +26 -0
- data/test/core/kernel/test_maybe.rb +13 -0
- data/test/core/kernel/test_meta_alias.rb +18 -0
- data/test/core/kernel/test_meta_class.rb +33 -0
- data/test/core/kernel/test_meta_def.rb +15 -0
- data/test/core/kernel/test_meta_eval.rb +18 -0
- data/test/core/kernel/test_method.rb +20 -0
- data/test/core/kernel/test_not.rb +51 -0
- data/test/core/kernel/test_not_nil.rb +25 -0
- data/test/core/kernel/test_object_class.rb +22 -0
- data/test/core/kernel/test_object_hexid.rb +20 -0
- data/test/core/kernel/test_object_send.rb +25 -0
- data/test/core/kernel/test_presence.rb +37 -0
- data/test/core/kernel/test_qua_class.rb +25 -0
- data/test/core/kernel/test_require_all.rb +11 -0
- data/test/core/kernel/test_respond.rb +38 -0
- data/test/core/kernel/test_returning.rb +17 -0
- data/test/core/kernel/test_silence.rb +24 -0
- data/test/core/kernel/test_singleton_class.rb +15 -0
- data/test/core/kernel/test_super_method.rb +23 -0
- data/test/core/kernel/test_tap.rb +38 -0
- data/test/core/kernel/test_temporarily.rb +25 -0
- data/test/core/kernel/test_true.rb +31 -0
- data/test/core/kernel/test_try.rb +35 -0
- data/test/core/kernel/test_val.rb +30 -0
- data/test/core/kernel/test_with.rb +18 -0
- data/test/core/kernel/test_writers.rb +53 -0
- data/test/core/matchdata/test_match.rb +14 -0
- data/test/core/matchdata/test_matchset.rb +29 -0
- data/test/core/method/test_composition.rb +42 -0
- data/test/core/module/test_abstract.rb +24 -0
- data/test/core/module/test_alias_accessor.rb +27 -0
- data/test/core/module/test_alias_method_chain.rb +34 -0
- data/test/core/module/test_alias_module_function.rb +24 -0
- data/test/core/module/test_all_instance_methods.rb +27 -0
- data/test/core/module/test_ancestor.rb +16 -0
- data/test/core/module/test_anonymous.rb +18 -0
- data/test/core/module/test_attr_setter.rb +28 -0
- data/test/core/module/test_basename.rb +14 -0
- data/test/core/module/test_can.rb +22 -0
- data/test/core/module/test_class.rb +22 -0
- data/test/core/module/test_class_def.rb +22 -0
- data/test/core/module/test_class_extend.rb +73 -0
- data/test/core/module/test_class_inheritor.rb +135 -0
- data/test/core/module/test_copy_inheritor.rb +35 -0
- data/test/core/module/test_enclosure.rb +24 -0
- data/test/core/module/test_instance_function.rb +30 -0
- data/test/core/module/test_instance_method.rb +20 -0
- data/test/core/module/test_instance_method_defined.rb +38 -0
- data/test/core/module/test_integrate.rb +28 -0
- data/test/core/module/test_is.rb +50 -0
- data/test/core/module/test_memoize.rb +33 -0
- data/test/core/module/test_method_clash.rb +59 -0
- data/test/core/module/test_method_space.rb +72 -0
- data/test/core/module/test_methodize.rb +26 -0
- data/test/core/module/test_modname.rb +13 -0
- data/test/core/module/test_module_def.rb +22 -0
- data/test/core/module/test_module_load.rb +23 -0
- data/test/core/module/test_nodef.rb +19 -0
- data/test/core/module/test_op.rb +56 -0
- data/test/core/module/test_pathize.rb +25 -0
- data/test/core/module/test_preextend.rb +26 -0
- data/test/core/module/test_redefine_method.rb +30 -0
- data/test/core/module/test_redirect_method.rb +32 -0
- data/test/core/module/test_remove.rb +18 -0
- data/test/core/module/test_rename_method.rb +34 -0
- data/test/core/module/test_revise.rb +61 -0
- data/test/core/module/test_set.rb +30 -0
- data/test/core/module/test_spacename.rb +15 -0
- data/test/core/module/test_to_obj.rb +20 -0
- data/test/core/module/test_wrap_method.rb +32 -0
- data/test/core/numeric/test_approx.rb +26 -0
- data/test/core/numeric/test_delimit.rb +68 -0
- data/test/core/numeric/test_distance.rb +16 -0
- data/test/core/numeric/test_length.rb +16 -0
- data/test/core/numeric/test_round_to.rb +76 -0
- data/test/core/numeric/test_spacing.rb +17 -0
- data/test/core/object/test_dup.rb +115 -0
- data/test/core/object/test_object_state.rb +75 -0
- data/test/core/object/test_try_dup.rb +59 -0
- data/test/core/proc/test_bind.rb +29 -0
- data/test/core/proc/test_bind_to.rb +17 -0
- data/test/core/proc/test_compose.rb +27 -0
- data/test/core/proc/test_partial.rb +27 -0
- data/test/core/proc/test_to_method.rb +43 -0
- data/test/core/proc/test_update.rb +15 -0
- data/test/core/range/test_combine.rb +32 -0
- data/test/core/range/test_nudge.rb +32 -0
- data/test/core/range/test_op_add.rb +24 -0
- data/test/core/range/test_op_sub.rb +34 -0
- data/test/core/range/test_overlap.rb +15 -0
- data/test/core/range/test_to_rng.rb +20 -0
- data/test/core/range/test_umbrella.rb +32 -0
- data/test/core/range/test_within.rb +25 -0
- data/test/core/regexp/test_arity.rb +30 -0
- data/test/core/regexp/test_multiline.rb +19 -0
- data/test/core/regexp/test_op_add.rb +15 -0
- data/test/core/regexp/test_op_or.rb +16 -0
- data/test/core/regexp/test_to_re.rb +24 -0
- data/test/core/string/test_acronym.rb +14 -0
- data/test/core/string/test_align.rb +32 -0
- data/test/core/string/test_ascii_only.rb +51 -0
- data/test/core/string/test_bracket.rb +37 -0
- data/test/core/string/test_camelcase.rb +59 -0
- data/test/core/string/test_capitalized.rb +36 -0
- data/test/core/string/test_cleanlines.rb +12 -0
- data/test/core/string/test_cleave.rb +27 -0
- data/test/core/string/test_cmp.rb +18 -0
- data/test/core/string/test_compress_lines.rb +27 -0
- data/test/core/string/test_crypt.rb +17 -0
- data/test/core/string/test_divide.rb +17 -0
- data/test/core/string/test_each_word.rb +17 -0
- data/test/core/string/test_edit_distance.rb +20 -0
- data/test/core/string/test_exclude.rb +23 -0
- data/test/core/string/test_expand_tabs.rb +83 -0
- data/test/core/string/test_file.rb +15 -0
- data/test/core/string/test_fold.rb +21 -0
- data/test/core/string/test_indent.rb +90 -0
- data/test/core/string/test_index_all.rb +22 -0
- data/test/core/string/test_interpolate.rb +16 -0
- data/test/core/string/test_lchomp.rb +25 -0
- data/test/core/string/test_line_wrap.rb +15 -0
- data/test/core/string/test_lowercase.rb +18 -0
- data/test/core/string/test_margin.rb +16 -0
- data/test/core/string/test_methodize.rb +28 -0
- data/test/core/string/test_modulize.rb +28 -0
- data/test/core/string/test_mscan.rb +18 -0
- data/test/core/string/test_natcmp.rb +17 -0
- data/test/core/string/test_nchar.rb +17 -0
- data/test/core/string/test_newlines.rb +14 -0
- data/test/core/string/test_number.rb +44 -0
- data/test/core/string/test_op_div.rb +15 -0
- data/test/core/string/test_op_sub.rb +15 -0
- data/test/core/string/test_pathize.rb +31 -0
- data/test/core/string/test_quote.rb +41 -0
- data/test/core/string/test_random.rb +25 -0
- data/test/core/string/test_range.rb +35 -0
- data/test/core/string/test_remove.rb +50 -0
- data/test/core/string/test_rewrite.rb +17 -0
- data/test/core/string/test_rotate.rb +31 -0
- data/test/core/string/test_shatter.rb +17 -0
- data/test/core/string/test_similarity.rb +22 -0
- data/test/core/string/test_snakecase.rb +22 -0
- data/test/core/string/test_splice.rb +37 -0
- data/test/core/string/test_squish.rb +31 -0
- data/test/core/string/test_store.rb +16 -0
- data/test/core/string/test_subtract.rb +16 -0
- data/test/core/string/test_titlecase.rb +16 -0
- data/test/core/string/test_to_re.rb +35 -0
- data/test/core/string/test_trim.rb +116 -0
- data/test/core/string/test_unbracket.rb +38 -0
- data/test/core/string/test_underscore.rb +21 -0
- data/test/core/string/test_unfold.rb +17 -0
- data/test/core/string/test_unindent.rb +105 -0
- data/test/core/string/test_unquote.rb +13 -0
- data/test/core/string/test_uppercase.rb +22 -0
- data/test/core/string/test_variablize.rb +15 -0
- data/test/core/string/test_word_wrap.rb +80 -0
- data/test/core/string/test_words.rb +65 -0
- data/test/core/string/test_xor.rb +16 -0
- data/test/core/struct/test_replace.rb +18 -0
- data/test/core/symbol/test_as_s.rb +15 -0
- data/test/core/symbol/test_bang.rb +15 -0
- data/test/core/symbol/test_chomp.rb +22 -0
- data/test/core/symbol/test_generate.rb +20 -0
- data/test/core/symbol/test_not.rb +19 -0
- data/test/core/symbol/test_op_div.rb +15 -0
- data/test/core/symbol/test_plain.rb +19 -0
- data/test/core/symbol/test_query.rb +19 -0
- data/test/core/symbol/test_setter.rb +17 -0
- data/test/core/symbol/test_succ.rb +16 -0
- data/test/core/symbol/test_thrown.rb +22 -0
- data/test/core/symbol/test_variablize.rb +14 -0
- data/test/core/time/test_ago.rb +18 -0
- data/test/core/time/test_change.rb +17 -0
- data/test/core/time/test_dst_adjustment.rb +19 -0
- data/test/core/time/test_elapse.rb +15 -0
- data/test/core/time/test_future.rb +32 -0
- data/test/core/time/test_hence.rb +18 -0
- data/test/core/time/test_in.rb +18 -0
- data/test/core/time/test_less.rb +139 -0
- data/test/core/time/test_past.rb +32 -0
- data/test/core/time/test_round_to.rb +34 -0
- data/test/core/time/test_set.rb +43 -0
- data/test/core/time/test_shift.rb +135 -0
- data/test/core/time/test_stamp.rb +42 -0
- data/test/core/time/test_to_time.rb +15 -0
- data/test/core/time/test_trunc.rb +34 -0
- data/test/core/unboundmethod/test_arguments.rb +25 -0
- data/test/standard/binding/test_block_exec.rb +21 -0
- data/test/standard/date/test_cmp.rb +38 -0
- data/test/standard/math/test_abs.rb +13 -0
- data/test/standard/math/test_acot.rb +23 -0
- data/test/standard/math/test_acoth.rb +22 -0
- data/test/standard/math/test_beta.rb +19 -0
- data/test/standard/math/test_ceil.rb +22 -0
- data/test/standard/math/test_cosec.rb +19 -0
- data/test/standard/math/test_cosech.rb +19 -0
- data/test/standard/math/test_cot.rb +13 -0
- data/test/standard/math/test_coth.rb +13 -0
- data/test/standard/math/test_distance.rb +16 -0
- data/test/standard/math/test_exp10.rb +14 -0
- data/test/standard/math/test_exp2.rb +14 -0
- data/test/standard/math/test_factorial.rb +13 -0
- data/test/standard/math/test_floor.rb +23 -0
- data/test/standard/math/test_gcd.rb +18 -0
- data/test/standard/math/test_lcm.rb +13 -0
- data/test/standard/math/test_median.rb +17 -0
- data/test/standard/math/test_percentile.rb +13 -0
- data/test/standard/math/test_pow.rb +30 -0
- data/test/standard/math/test_root.rb +15 -0
- data/test/standard/math/test_sec.rb +19 -0
- data/test/standard/math/test_sech.rb +19 -0
- data/test/standard/math/test_sign.rb +20 -0
- data/test/standard/math/test_sinc.rb +15 -0
- data/test/standard/math/test_srq.rb +20 -0
- data/test/standard/pathname/test_chdir.rb +16 -0
- data/test/standard/pathname/test_readline.rb +23 -0
- data/test/standard/test_argvector.rb +64 -0
- data/test/standard/test_cloneable.rb +60 -0
- data/test/standard/test_date.rb +82 -0
- data/test/standard/test_enumargs.rb +105 -0
- data/test/standard/test_equitable.rb +46 -0
- data/test/standard/test_instantiable.rb +40 -0
- data/test/standard/test_math.rb +3 -0
- data/test/standard/test_memoizable.rb +42 -0
- data/test/standard/test_multipliers.rb +141 -0
- data/test/standard/test_ostruct.rb +191 -0
- data/test/standard/test_random.rb +241 -0
- data/test/standard/test_shellwords.rb +74 -0
- data/test/standard/test_thread.rb +24 -0
- data/test/standard/test_timer.rb +62 -0
- data/test/standard/test_tuple.rb +68 -0
- data/test/standard/test_uri.rb +50 -0
- metadata +1932 -0
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'uri'
|
2
|
+
|
3
|
+
module URI
|
4
|
+
|
5
|
+
# Allows for taking a hash and turning it into URI/CGI params
|
6
|
+
# Since 1.8.x does not have ordered hashes the params might not
|
7
|
+
# be ordered.
|
8
|
+
#
|
9
|
+
# @todo URI.parameters needs URI escaping.
|
10
|
+
#
|
11
|
+
# @author Matt Kirk
|
12
|
+
|
13
|
+
def self.parameters(hash)
|
14
|
+
hash.map do |k,v|
|
15
|
+
if v.respond_to?(:join)
|
16
|
+
"#{k}=#{v.join(",")}"
|
17
|
+
else
|
18
|
+
"#{k}=#{v}"
|
19
|
+
end
|
20
|
+
end.join("&")
|
21
|
+
end
|
22
|
+
|
23
|
+
# We cannot send nested hash as a param in HTTP requests. For example,
|
24
|
+
# when we would like to send something like this:
|
25
|
+
#
|
26
|
+
# {:key => "value", :nested => {:nest => "value"}}
|
27
|
+
#
|
28
|
+
# It would be (or should be) mapped like this:
|
29
|
+
#
|
30
|
+
# /url/?key=value&nested=%7B%3Anest%3D%3E%5C%22value%5C%22%7D
|
31
|
+
#
|
32
|
+
# Doesn’t look to good ;) However there is a simple way to convert a nested
|
33
|
+
# hash into a params acceptable form. We can convert it to a form, that can
|
34
|
+
# be mapped into params like this:
|
35
|
+
#
|
36
|
+
# /url/?key=value&nested[nest]=value
|
37
|
+
#
|
38
|
+
# Here is method to convert any nested hash to a “one level” equivalent:
|
39
|
+
#
|
40
|
+
# @author Maciej Mensfeld
|
41
|
+
|
42
|
+
def self.nested_parameters(value, key=nil, hash={})
|
43
|
+
case value
|
44
|
+
when Hash
|
45
|
+
value.each do |k,v|
|
46
|
+
akey = key.nil? ? :"#{k}" : :"#{key}[#{k}]"
|
47
|
+
nested_parameters(v, akey, hash)
|
48
|
+
end
|
49
|
+
out_hash
|
50
|
+
when Array
|
51
|
+
value.each do |v|
|
52
|
+
nested_parameters(v, "#{key}[]", hash)
|
53
|
+
end
|
54
|
+
hash
|
55
|
+
when nil then ''
|
56
|
+
else
|
57
|
+
hash[key] = value
|
58
|
+
hash
|
59
|
+
end
|
60
|
+
parameters(hash)
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# TODO: URI query methods need work and new consideration.
|
2
|
+
|
3
|
+
require 'uri'
|
4
|
+
require 'facets/uri/cgi_escape'
|
5
|
+
require 'facets/module/alias_module_function'
|
6
|
+
|
7
|
+
module URI
|
8
|
+
|
9
|
+
module_function
|
10
|
+
|
11
|
+
#
|
12
|
+
#
|
13
|
+
#
|
14
|
+
KEY_VALUE_SEPARATOR = ";" # "&"
|
15
|
+
|
16
|
+
#
|
17
|
+
# Given a hash with parameter/value pairs construct a
|
18
|
+
# standard query string.
|
19
|
+
#
|
20
|
+
# URI.hash_to_query(:a => 1, :b => 2)
|
21
|
+
# #=> "a=1;b=2"
|
22
|
+
#
|
23
|
+
def query(parameters)
|
24
|
+
return '' unless parameters
|
25
|
+
pairs = []
|
26
|
+
parameters.each do |param, value|
|
27
|
+
pairs << "#{param}=#{cgi_escape(value.to_s)}"
|
28
|
+
end
|
29
|
+
return pairs.join(KEY_VALUE_SEPARATOR)
|
30
|
+
end
|
31
|
+
|
32
|
+
alias_module_function :hash_to_query, :query
|
33
|
+
alias_module_function :hash_to_query_string, :query
|
34
|
+
|
35
|
+
#
|
36
|
+
# Extend the basic query string parser provided by the cgi module.
|
37
|
+
# converts single valued params (the most common case) to
|
38
|
+
# objects instead of arrays
|
39
|
+
#
|
40
|
+
# Returns hash of parameters, contains arrays for multivalued parameters
|
41
|
+
# (multiselect, checkboxes , etc).
|
42
|
+
#
|
43
|
+
# If no query string is provided (nil or "") returns an empty hash.
|
44
|
+
#
|
45
|
+
def query_hash(query_string)
|
46
|
+
return {} unless query_string
|
47
|
+
|
48
|
+
query_parameters = cgi_parse(query_string)
|
49
|
+
|
50
|
+
query_parameters.each { |key, val|
|
51
|
+
## replace the array with an object
|
52
|
+
query_parameters[key] = val[0] if 1 == val.length
|
53
|
+
}
|
54
|
+
|
55
|
+
## set default value to nil! cgi sets this to []
|
56
|
+
query_parameters.default = nil
|
57
|
+
|
58
|
+
return query_parameters
|
59
|
+
end
|
60
|
+
|
61
|
+
alias_module_function :query_to_hash, :query_hash
|
62
|
+
alias_module_function :query_string_to_hash, :query_hash
|
63
|
+
|
64
|
+
#
|
65
|
+
# This method returns the query string of a uri.
|
66
|
+
#
|
67
|
+
# @param [String] uri
|
68
|
+
# The uri string.
|
69
|
+
#
|
70
|
+
# @return [String]
|
71
|
+
# The query string, or `nil` if no query string.
|
72
|
+
#
|
73
|
+
def query_get(uri)
|
74
|
+
return nil unless uri
|
75
|
+
# gmosx: INVESTIGATE ruby's URI seems to differently handle
|
76
|
+
# abs and rel uris.
|
77
|
+
if md = URI::REGEXP::ABS_URI.match(uri)
|
78
|
+
return md[8]
|
79
|
+
elsif md = URI::REGEXP::REL_URI.match(uri)
|
80
|
+
return md[7]
|
81
|
+
end
|
82
|
+
return nil
|
83
|
+
end
|
84
|
+
|
85
|
+
alias_method :get_query_string, :query_get
|
86
|
+
|
87
|
+
#
|
88
|
+
# Removes the query string from a +uri+.
|
89
|
+
#
|
90
|
+
# Returns the chomped uri.
|
91
|
+
#
|
92
|
+
def query_chomp(uri)
|
93
|
+
return nil unless uri
|
94
|
+
query_string = self.get_query_string(uri)
|
95
|
+
return uri.dup.chomp("?#{query_string}")
|
96
|
+
end
|
97
|
+
|
98
|
+
alias_module_function :chomp_query_string, :query_chomp
|
99
|
+
|
100
|
+
#
|
101
|
+
# Get a uri and a hash of parameters. Inject the hash values
|
102
|
+
# as parameters in the query sting path. Returns the full uri.
|
103
|
+
#
|
104
|
+
# uri - the uri to filter (String)
|
105
|
+
# parameter - hash of parameters to update
|
106
|
+
#
|
107
|
+
# Returns the full updated query string.
|
108
|
+
#
|
109
|
+
# @todo Optimize this method.
|
110
|
+
#
|
111
|
+
def query_update(uri, parameters)
|
112
|
+
query_string = self.query_get(uri)
|
113
|
+
rest = uri.dup.gsub(/\?#{query_string}/, "")
|
114
|
+
|
115
|
+
hash = self.query_string_to_hash(query_string)
|
116
|
+
hash.update(parameters)
|
117
|
+
query_string = self.hash_to_query_string(hash)
|
118
|
+
|
119
|
+
unless query_string.strip.empty?
|
120
|
+
return "#{rest}?#{query_string}"
|
121
|
+
else
|
122
|
+
return rest
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
alias_module_function :update_query_string, :query_update
|
127
|
+
|
128
|
+
#
|
129
|
+
# Gets the request uri, injects extra parameters in the query string
|
130
|
+
# and returns a new uri. The request object is not modified.
|
131
|
+
# There is always a qs string so an extra test is skipped.
|
132
|
+
#
|
133
|
+
# TODO: find a better name?
|
134
|
+
#
|
135
|
+
def update_request_uri(request, parameters)
|
136
|
+
hash = request.parameters.dup()
|
137
|
+
hash.update(parameters)
|
138
|
+
|
139
|
+
## use this in hash_to_query
|
140
|
+
query_string = hash.collect { |k, v|
|
141
|
+
"#{k}=#{v}"
|
142
|
+
}.join(";")
|
143
|
+
|
144
|
+
## return "#{request.translated_uri}?#{query_string}"
|
145
|
+
return "#{request.path}?#{query_string}"
|
146
|
+
end
|
147
|
+
|
148
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'uri'
|
2
|
+
|
3
|
+
require 'facets/uri/cgi_escape.rb'
|
4
|
+
require 'facets/uri/cgi_unescape.rb'
|
5
|
+
require 'facets/uri/cgi_parse.rb'
|
6
|
+
require 'facets/uri/decode.rb'
|
7
|
+
require 'facets/uri/parameters.rb'
|
8
|
+
require 'facets/uri/query.rb'
|
9
|
+
|
10
|
+
module URI
|
11
|
+
|
12
|
+
module Kernel
|
13
|
+
#
|
14
|
+
def uri(s, w=%r{[^a-zA-Z_0-9./-]})
|
15
|
+
URI.escape(s, w)
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
def unuri(s)
|
20
|
+
URI.unescape(s)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module Hash
|
25
|
+
#
|
26
|
+
def to_uri
|
27
|
+
URI.hash_to_query(self)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
class Object #:nodoc:
|
34
|
+
include URI::Kernel
|
35
|
+
end
|
36
|
+
|
37
|
+
class Hash #:nodoc:
|
38
|
+
include URI::Hash
|
39
|
+
end
|
40
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module YAML
|
4
|
+
|
5
|
+
# Provides a simplistic way to check if a file is a YAML formatted
|
6
|
+
# file:
|
7
|
+
#
|
8
|
+
# YAML.file?('project.yaml') #=> true
|
9
|
+
# YAML.file?('project.xml') #=> false
|
10
|
+
#
|
11
|
+
# Note this isn't perfect. At present it depends on the use
|
12
|
+
# use of an initial document separator (eg. '---'). With
|
13
|
+
# YAML 1.1 the %YAML delaration is supposed to be manditory,
|
14
|
+
# so in the future this can be adapted to fit that standard.
|
15
|
+
|
16
|
+
def self.file?(file)
|
17
|
+
File.open(file) do |f|
|
18
|
+
until f.eof?
|
19
|
+
line = f.gets
|
20
|
+
break true if line =~ /^---/
|
21
|
+
break false unless line =~ /^(\s*#.*?|\s*)$/
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
class File
|
30
|
+
|
31
|
+
# Same as `YAML.file?(file)`.
|
32
|
+
#
|
33
|
+
# File.yaml?('project.yaml') #=> true
|
34
|
+
# File.yaml?('project.xml') #=> false
|
35
|
+
#
|
36
|
+
def self.yaml?(file)
|
37
|
+
YAML.file?(file)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module Kernel
|
4
|
+
|
5
|
+
# The Kernel method #yaml is a shortcut to YAML::load.
|
6
|
+
#
|
7
|
+
# data = yaml %{
|
8
|
+
# a: 1
|
9
|
+
# b: 2
|
10
|
+
# }
|
11
|
+
# data #=> {"a"=>1, "b"=>2}
|
12
|
+
#
|
13
|
+
def yaml(*args,&blk)
|
14
|
+
YAML.load(*args,&blk)
|
15
|
+
end
|
16
|
+
|
17
|
+
# As with #to_yaml but removes the header line (i.e. '---') to create
|
18
|
+
# a "YAML fragment".
|
19
|
+
#
|
20
|
+
# @author Trans
|
21
|
+
#
|
22
|
+
def to_yamlfrag
|
23
|
+
y = to_yaml
|
24
|
+
y.sub!(/---\ */, '')
|
25
|
+
y
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# A convenient wrapper for the zlib standard library that allows
|
2
|
+
# compression/decompression of strings with gzip.
|
3
|
+
|
4
|
+
module Zlib
|
5
|
+
|
6
|
+
##class Stream < StringIO
|
7
|
+
## def close; rewind; end
|
8
|
+
##end
|
9
|
+
|
10
|
+
# Decompresses a gzipped string.
|
11
|
+
def self.decompress(source)
|
12
|
+
GzipReader.new(StringIO.new(source)).read
|
13
|
+
end
|
14
|
+
|
15
|
+
# Compresses a string using gzip.
|
16
|
+
def self.compress(source)
|
17
|
+
output = StringIO.new
|
18
|
+
class << output
|
19
|
+
def close; rewind; end
|
20
|
+
end
|
21
|
+
gz = GzipWriter.new(output)
|
22
|
+
gz.write(source)
|
23
|
+
gz.close
|
24
|
+
output.string
|
25
|
+
end
|
26
|
+
|
27
|
+
# Inflate a deflated sting.
|
28
|
+
def self.inflate(string)
|
29
|
+
Inflate.inflate(string)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deflate a string.
|
33
|
+
def self.deflate(string, level=DEFAULT_COMPRESSION)
|
34
|
+
Deflate.deflate(string, level)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'facets/array/arrange'
|
2
|
+
|
3
|
+
test_case Array do
|
4
|
+
|
5
|
+
method :rangify do
|
6
|
+
test 'Array of consecutive integers should return an array made up of a single range.' do
|
7
|
+
[1,2,3,4,5].rangify.assert == [1..5]
|
8
|
+
end
|
9
|
+
|
10
|
+
test 'Array of non-consecutive integers should return the original array.' do
|
11
|
+
[1,3,5,7].rangify.assert == [1,3,5,7]
|
12
|
+
end
|
13
|
+
|
14
|
+
test 'Array of ranges should return the correct ranges.' do
|
15
|
+
arr = [40..45, 1..3, 4..10, 20..30, 24..28, 42..50, 1..6, 1..3, 1..1]
|
16
|
+
arr.rangify.assert == [1..10, 20..30, 40..50]
|
17
|
+
end
|
18
|
+
|
19
|
+
test 'Array of ranges and integers should return the correct ranges.' do
|
20
|
+
arr = [99, 100, 1..3, 101, 4..5, 103, 10..19, 99, 20..20, 31, 32..33, 98, 97]
|
21
|
+
arr.rangify.assert == [1..5, 10..20, 31..33, 97..101, 103]
|
22
|
+
end
|
23
|
+
|
24
|
+
test 'Array of non-consecutive integers should return the correct ranges.' do
|
25
|
+
[1,2,3,6,7,8,10,15].rangify.assert == [1..3, 6..8, 10, 15]
|
26
|
+
end
|
27
|
+
|
28
|
+
test 'Element order should not affect the result.' do
|
29
|
+
[8, 1, 15, 2, 6, 3, 7, 10].rangify.assert == [1..3, 6..8, 10, 15]
|
30
|
+
end
|
31
|
+
|
32
|
+
test 'Duplicate elements should not affect the result.' do
|
33
|
+
[8, 1, 15, 2, 6, 3, 7, 10, 8, 15, 2, 3, 1, 2].rangify.assert == [1..3, 6..8, 10, 15]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'facets/array/average'
|
2
|
+
|
3
|
+
test_case Array do
|
4
|
+
method :average do
|
5
|
+
test 'Empty array returns nil' do
|
6
|
+
[].average.assert == nil
|
7
|
+
end
|
8
|
+
|
9
|
+
test 'Calculate average of array of numerical values' do
|
10
|
+
[1, 2, 3].average.assert == 2
|
11
|
+
[96, 35, 72, 30, 75, 33, 68, 13, 49, 71].average.assert == 54.2
|
12
|
+
[36, -67, -17, 85, -46, -64, -23, -13, 89, -47].average.assert == -6.7
|
13
|
+
[60.7829, 31.2622, 20.626, 78.8907, 61.5328].average.assert == 50.61892
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
covers 'facets/array/before'
|
2
|
+
|
3
|
+
test_case Array do
|
4
|
+
|
5
|
+
method :before do
|
6
|
+
|
7
|
+
setup do
|
8
|
+
@sequence = ['a', 'b', 'c']
|
9
|
+
end
|
10
|
+
|
11
|
+
test "returns the previous element" do
|
12
|
+
@sequence.before('b').assert == 'a'
|
13
|
+
@sequence.before('c').assert == 'b'
|
14
|
+
end
|
15
|
+
|
16
|
+
test "loops around from back to front" do
|
17
|
+
@sequence.before('a').assert == 'c'
|
18
|
+
end
|
19
|
+
|
20
|
+
test "non-member elements return nil" do
|
21
|
+
@sequence.before('d').assert == nil
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
method :after do
|
27
|
+
|
28
|
+
setup do
|
29
|
+
@sequence = ['a', 'b', 'c']
|
30
|
+
end
|
31
|
+
|
32
|
+
test "returns the following element" do
|
33
|
+
@sequence.after('a').assert == 'b'
|
34
|
+
@sequence.after('b').assert == 'c'
|
35
|
+
end
|
36
|
+
|
37
|
+
test "loops around from back to front" do
|
38
|
+
@sequence.after('c').assert == 'a'
|
39
|
+
end
|
40
|
+
|
41
|
+
test "non-member elements return nil" do
|
42
|
+
@sequence.after('d').assert == nil
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
covers 'facets/array/collapse'
|
2
|
+
|
3
|
+
test_case Array do
|
4
|
+
|
5
|
+
method :collapse do
|
6
|
+
|
7
|
+
test do
|
8
|
+
[1, nil, [1, 2], nil, [[3]]].collapse.assert == [1, 1, 2, 3]
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
method :collapse! do
|
14
|
+
|
15
|
+
test do
|
16
|
+
a = [1, nil, [1, 2], nil, [[3]]]
|
17
|
+
a.collapse!
|
18
|
+
a.assert == [1, 1, 2, 3]
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
covers 'facets/array/commonality'
|
2
|
+
|
3
|
+
test_case Array do
|
4
|
+
|
5
|
+
method :commonality do
|
6
|
+
|
7
|
+
test do
|
8
|
+
a = [1,2,2,3,3,3]
|
9
|
+
e = { 2 => [2,2], 3 => [3,3,3] }
|
10
|
+
r = a.commonality
|
11
|
+
r.assert == e
|
12
|
+
end
|
13
|
+
|
14
|
+
test "with block" do
|
15
|
+
a = [1,2,2,3,3,3]
|
16
|
+
e = {false=>[1, 2, 2], true=>[3, 3, 3]}
|
17
|
+
r = a.commonality{ |x| x > 2 }
|
18
|
+
r.assert == e
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
method :collisions do
|
24
|
+
|
25
|
+
test "alias for commonality" do
|
26
|
+
a = [1,2,2,3,3,3]
|
27
|
+
e = { 2 => [2,2], 3 => [3,3,3] }
|
28
|
+
r = a.collisions
|
29
|
+
r.assert == e
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
covers 'facets/array/conjoin'
|
2
|
+
|
3
|
+
test_case Array do
|
4
|
+
|
5
|
+
method :conjoin do
|
6
|
+
|
7
|
+
setup "any array" do
|
8
|
+
@a = [1,2,3,4]
|
9
|
+
end
|
10
|
+
|
11
|
+
test "like join but spaced" do
|
12
|
+
@a.conjoin.assert == "1 2 3 4"
|
13
|
+
end
|
14
|
+
|
15
|
+
test "comma+space and 'and' on tail" do
|
16
|
+
@a.conjoin(', ', ' and ').assert = "1, 2, 3 and 4"
|
17
|
+
end
|
18
|
+
|
19
|
+
test "comma+space and 'or' on tail using :last option" do
|
20
|
+
@a.conjoin(', ', :last => ' or ').assert == "1, 2, 3 or 4"
|
21
|
+
end
|
22
|
+
|
23
|
+
test "semicolon+space and ampersand on tail using index" do
|
24
|
+
@a.conjoin('; ', -1 => ' & ').assert == "1; 2; 3 & 4"
|
25
|
+
end
|
26
|
+
|
27
|
+
test "with block to determine separator" do
|
28
|
+
r = @a.conjoin{ |i, a, b| i % 2 == 0 ? '.' : '-' }
|
29
|
+
r.assert == "1.2-3.4"
|
30
|
+
end
|
31
|
+
|
32
|
+
test "very esoteric transformation" do
|
33
|
+
r = @a.conjoin{ |i, x, y| "<#{i} #{x} #{y}>" }
|
34
|
+
r.assert == "1<0 1 2>2<1 2 3>3<2 3 4>4"
|
35
|
+
end
|
36
|
+
|
37
|
+
test "with :space option" do
|
38
|
+
r = @a.conjoin(',', '&', :space=>2)
|
39
|
+
r.assert == "1 , 2 , 3 & 4"
|
40
|
+
end
|
41
|
+
|
42
|
+
test ":spacer option can set an alternate spacing string" do
|
43
|
+
r = @a.conjoin('|', '>', :space=>2, :spacer=>'-')
|
44
|
+
r.assert == "1--|--2--|--3-->--4"
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
covers 'facets/array/delete'
|
2
|
+
|
3
|
+
test_case Array do
|
4
|
+
|
5
|
+
method :delete_unless do
|
6
|
+
|
7
|
+
test do
|
8
|
+
a = [1,2,3]
|
9
|
+
a.delete_unless{ |e| e == 2 }
|
10
|
+
a.assert == [2]
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
method :delete_values do
|
16
|
+
|
17
|
+
test do
|
18
|
+
a = [1,2,3,4]
|
19
|
+
a.delete_values(1,2).assert == [1,2]
|
20
|
+
a.assert == [3,4]
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
method :delete_values_at do
|
26
|
+
|
27
|
+
test do
|
28
|
+
a = [1,2,3,4]
|
29
|
+
a.delete_values_at(1,2).assert == [2,3]
|
30
|
+
a.assert == [1,4]
|
31
|
+
end
|
32
|
+
|
33
|
+
test do
|
34
|
+
a = [1,2,3,4]
|
35
|
+
a.delete_values_at(0..2).assert == [1,2,3]
|
36
|
+
a.assert == [4]
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
covers 'facets/array/delete_unless'
|
2
|
+
|
3
|
+
test_case Array do
|
4
|
+
|
5
|
+
method :delete_unless do
|
6
|
+
|
7
|
+
test 'with an explicit block' do
|
8
|
+
[1,2,3].delete_unless{ |x| x < 2 }.assert == [1]
|
9
|
+
end
|
10
|
+
|
11
|
+
test 'with an implicit block' do
|
12
|
+
[1,2,3].delete_unless(&:even?).assert == [2]
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|