facets 2.9.3 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.index +76 -0
- data/CONTRIBUTE.md +78 -0
- data/HISTORY.md +2459 -0
- data/{RUBY.txt → LICENSE.txt} +0 -0
- data/README.rdoc +29 -7
- data/demo/applique/assertion_framework.rb +1 -0
- data/{qed → demo}/applique/file_helpers.rb +0 -0
- data/{qed → demo}/core/array/combination.rdoc +0 -0
- data/{qed → demo}/core/array/delete.rdoc +0 -0
- data/{qed → demo}/core/array/index.rdoc +0 -0
- data/{qed → demo}/core/array/merge.rdoc +0 -0
- data/{qed → demo}/core/array/only.rdoc +0 -0
- data/{qed → demo}/core/array/pad.rdoc +0 -0
- data/{qed → demo}/core/array/permutation.rdoc +0 -0
- data/{qed → demo}/core/array/product.rdoc +0 -0
- data/{qed → demo}/core/array/recursively.rdoc +0 -0
- data/{qed → demo}/core/array/rotate.rdoc +0 -0
- data/{qed → demo}/core/array/select.rdoc +0 -0
- data/{qed → demo}/core/array/uniq_by.rdoc +0 -0
- data/{qed → demo}/core/binding/caller.rdoc +0 -0
- data/{qed → demo}/core/binding/defined.rdoc +0 -0
- data/{qed → demo}/core/binding/eval.rdoc +0 -0
- data/{qed → demo}/core/binding/local_variables.rdoc +0 -0
- data/{qed → demo}/core/binding/opvars.rdoc +0 -0
- data/{qed → demo}/core/binding/self.rdoc +0 -0
- data/{qed → demo}/core/class/descendants.rdoc +0 -0
- data/{qed → demo}/core/class/to_proc.rdoc +0 -0
- data/{qed → demo}/core/comparable/cap.rdoc +0 -0
- data/{qed → demo}/core/comparable/clip.rdoc +0 -0
- data/{qed → demo}/core/comparable/cmp.rdoc +0 -0
- data/{qed → demo}/core/comparable/op_get.rdoc +0 -0
- data/{qed → demo}/core/dir/ascend.rdoc +0 -0
- data/{qed → demo}/core/dir/descend.rdoc +0 -0
- data/{qed → demo}/core/dir/multiglob.rdoc +0 -0
- data/{qed → demo}/core/dir/parent.rdoc +0 -0
- data/{qed → demo}/core/dir/recurse.rdoc +0 -0
- data/{qed → demo}/core/exception/detail.rdoc +0 -0
- data/{qed → demo}/core/facets.rdoc +0 -0
- data/{qed → demo}/core/filetest/root.rdoc +0 -0
- data/{qed → demo}/core/hash/recursively.rdoc +0 -0
- data/{qed → demo}/core/indexable.rdoc +0 -0
- data/{qed → demo}/core/integer/bitmask.rdoc +0 -0
- data/{qed → demo}/core/integer/even.rdoc +0 -0
- data/{qed → demo}/core/integer/factorial.rdoc +0 -0
- data/{qed → demo}/core/integer/length.rdoc +0 -0
- data/{qed → demo}/core/integer/multiple.rdoc +0 -0
- data/{qed → demo}/core/integer/odd.rdoc +0 -0
- data/{qed → demo}/core/integer/of.rdoc +0 -0
- data/{qed → demo}/core/integer/ordinal.rdoc +0 -0
- data/{qed → demo}/core/matchdata/match.rdoc +0 -0
- data/{qed → demo}/core/matchdata/matchset.rdoc +0 -0
- data/{qed → demo}/core/module/cattr.rdoc +0 -0
- data/{qed → demo}/core/module/class_extend.rdoc +0 -0
- data/{qed → demo}/core/module/class_inheritor.rdoc +0 -0
- data/{qed → demo}/core/module/copy_inheritor.rdoc +0 -0
- data/{qed → demo}/core/module/method_space.rdoc +0 -0
- data/{qed → demo}/core/string/align.rdoc +0 -0
- data/{qed → demo}/core/string/bracket.rdoc +0 -0
- data/{qed → demo}/core/string/bytes.rdoc +0 -0
- data/{qed → demo}/core/string/camelcase.rdoc +0 -0
- data/{qed → demo}/core/string/capitalized.rdoc +0 -0
- data/{qed → demo}/core/string/characters.rdoc +0 -0
- data/{qed → demo}/core/string/cleanlines.rdoc +0 -0
- data/{qed → demo}/core/string/cleave.rdoc +0 -0
- data/{qed → demo}/core/string/divide.rdoc +0 -0
- data/{qed → demo}/core/string/each_char.rdoc +0 -0
- data/{qed → demo}/core/string/each_word.rdoc +0 -0
- data/{qed → demo}/core/string/end_with.rdoc +0 -0
- data/{qed → demo}/core/string/expand_tabs.rdoc +0 -0
- data/{qed → demo}/core/string/fold.rdoc +0 -0
- data/{qed → demo}/core/string/indent.rdoc +0 -0
- data/{qed → demo}/core/string/interpolate.rdoc +0 -0
- data/{qed → demo}/core/string/lchomp.rdoc +0 -0
- data/{qed → demo}/core/string/line_wrap.rdoc +0 -0
- data/{qed → demo}/core/string/lines.rdoc +0 -0
- data/{qed → demo}/core/string/margin.rdoc +0 -0
- data/{qed → demo}/core/string/methodize.rdoc +0 -0
- data/{qed → demo}/core/string/modulize.rdoc +0 -0
- data/{qed → demo}/core/string/mscan.rdoc +0 -0
- data/{qed → demo}/core/string/natcmp.rdoc +0 -0
- data/{qed → demo}/core/string/nchar.rdoc +0 -0
- data/{qed → demo}/core/string/newlines.rdoc +0 -0
- data/{qed → demo}/core/string/op_sub.rdoc +0 -0
- data/{qed → demo}/core/string/pathize.rdoc +0 -0
- data/{qed → demo}/core/string/quote.rdoc +0 -0
- data/{qed → demo}/core/string/range.rdoc +0 -0
- data/{qed → demo}/core/string/rewrite.rdoc +0 -0
- data/{qed → demo}/core/string/shatter.rdoc +0 -0
- data/{qed → demo}/core/string/snakecase.rdoc +0 -0
- data/{qed → demo}/core/string/splice.rdoc +0 -0
- data/{qed → demo}/core/string/start_with.rdoc +0 -0
- data/{qed → demo}/core/string/subtract.rdoc +0 -0
- data/{qed → demo}/core/string/tab.rdoc +0 -0
- data/{qed → demo}/core/string/tabto.rdoc +0 -0
- data/{qed → demo}/core/string/titlecase.rdoc +0 -0
- data/{qed → demo}/core/string/to_re.rdoc +0 -0
- data/{qed → demo}/core/string/unfold.rdoc +0 -0
- data/{qed → demo}/core/string/unindent.rdoc +0 -0
- data/{qed → demo}/core/string/unquote.rdoc +0 -0
- data/{qed → demo}/core/string/variablize.rdoc +0 -0
- data/{qed → demo}/core/string/word_wrap.rdoc +0 -0
- data/{qed → demo}/core/string/words.rdoc +0 -0
- data/{qed → demo}/core/string/xor.rdoc +0 -0
- data/{qed → demo}/standard/02_cloneable.rdoc +0 -0
- data/{qed → demo}/standard/03_enumargs.rdoc +0 -0
- data/{qed → demo}/standard/04_equitable.rdoc +0 -0
- data/{qed → demo}/standard/05_instantiable.rdoc +0 -0
- data/{qed → demo}/standard/basic_object.rdoc +0 -0
- data/{qed → demo}/standard/memoizable.rdoc +0 -0
- data/{qed → demo}/standard/mulititon.rdoc +0 -0
- data/lib/core/facets.rb +1 -2
- data/lib/core/facets.yml +61 -42
- data/lib/core/facets/array.rb +8 -28
- data/lib/core/facets/array/arrange.rb +42 -0
- data/lib/core/facets/array/before.rb +2 -0
- data/lib/core/facets/array/collapse.rb +2 -0
- data/lib/core/facets/array/commonality.rb +24 -12
- data/lib/core/facets/array/duplicates.rb +22 -1
- data/lib/core/facets/array/each_overlap.rb +25 -0
- data/lib/core/facets/array/intersection.rb +25 -0
- data/lib/core/facets/array/missing.rb +29 -0
- data/lib/core/facets/array/nonuniq.rb +7 -53
- data/lib/core/facets/array/occur.rb +38 -0
- data/lib/core/facets/array/occurrence.rb +28 -0
- data/lib/core/facets/array/only.rb +12 -1
- data/lib/core/facets/array/recursively.rb +11 -5
- data/lib/core/facets/array/reject_values.rb +21 -0
- data/lib/core/facets/array/splice.rb +5 -1
- data/lib/core/facets/array/split.rb +5 -2
- data/lib/core/facets/array/squeeze.rb +23 -0
- data/lib/core/facets/array/step.rb +31 -0
- data/lib/core/facets/array/store.rb +4 -0
- data/lib/core/facets/array/to_h.rb +22 -0
- data/lib/core/facets/array/traverse.rb +11 -5
- data/lib/core/facets/array/uniq_by.rb +5 -1
- data/lib/core/facets/array/unique_permutation.rb +29 -0
- data/lib/core/facets/array/zip.rb +21 -0
- data/lib/core/facets/binding.rb +0 -3
- data/lib/core/facets/binding/call_stack.rb +1 -1
- data/lib/core/facets/binding/caller.rb +1 -3
- data/lib/core/facets/binding/callstack.rb +1 -1
- data/lib/core/facets/binding/defined.rb +0 -2
- data/lib/core/facets/binding/local_variables.rb +0 -2
- data/lib/core/facets/binding/op_get.rb +0 -2
- data/lib/core/facets/binding/self.rb +1 -3
- data/lib/core/facets/cattr.rb +1 -0
- data/lib/core/facets/class.rb +0 -2
- data/lib/core/facets/class/cattr.rb +1 -0
- data/lib/core/facets/class/singleton.rb +1 -13
- data/lib/core/facets/class/singleton_class.rb +16 -0
- data/lib/core/facets/comparable.rb +0 -2
- data/lib/core/facets/dir.rb +0 -2
- data/lib/core/facets/dir/ascend.rb +2 -2
- data/lib/core/facets/dir/lookup.rb +20 -0
- data/lib/core/facets/enumerable.rb +10 -9
- data/lib/core/facets/enumerable/accumulate.rb +18 -16
- 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 +24 -0
- data/lib/core/facets/enumerable/every.rb +1 -1
- data/lib/core/facets/enumerable/ewise.rb +2 -0
- data/lib/core/facets/enumerable/graph.rb +0 -3
- data/lib/core/facets/enumerable/hashify.rb +222 -19
- data/lib/core/facets/enumerable/hinge.rb +18 -0
- data/lib/core/facets/enumerable/key_by.rb +27 -0
- data/lib/core/facets/enumerable/map_to.rb +13 -0
- data/lib/core/facets/enumerable/mash.rb +34 -1
- data/lib/core/facets/enumerable/occur.rb +12 -9
- data/lib/core/facets/enumerable/only.rb +56 -0
- data/lib/core/facets/enumerable/{cluster_by.rb → organize_by.rb} +5 -4
- data/lib/core/facets/enumerable/pair.rb +20 -0
- data/lib/core/facets/enumerable/per.rb +27 -35
- data/lib/core/facets/enumerable/recursively.rb +3 -3
- data/lib/core/facets/enumerable/squeeze.rb +36 -0
- data/lib/core/facets/enumerable/sum.rb +18 -6
- data/lib/core/facets/enumerable/unassociate.rb +23 -0
- data/lib/core/facets/enumerable/value_by.rb +25 -0
- data/lib/core/facets/enumerator/fx.rb +16 -25
- data/lib/core/facets/enumerator/lazy/squeeze.rb +33 -0
- data/lib/core/facets/essentials.rb +65 -0
- data/lib/core/facets/exception.rb +0 -2
- data/lib/core/facets/exception/set_message.rb +10 -0
- data/lib/core/facets/file.rb +1 -2
- data/lib/core/facets/file/common_path.rb +17 -0
- data/lib/core/facets/file/rootname.rb +1 -1
- data/lib/core/facets/filetest.rb +0 -2
- data/lib/core/facets/filetest/relative.rb +1 -1
- data/lib/core/facets/filetest/safe.rb +14 -10
- data/lib/core/facets/float.rb +1 -3
- data/lib/core/facets/float/round_to.rb +1 -0
- data/lib/core/facets/functor.rb +8 -10
- data/lib/core/facets/hash.rb +2 -5
- data/lib/core/facets/hash/collate.rb +22 -8
- data/lib/core/facets/hash/count.rb +8 -4
- data/lib/core/facets/hash/data.rb +5 -2
- data/lib/core/facets/hash/dearray_values.rb +1 -1
- data/lib/core/facets/hash/deep_rekey.rb +54 -0
- data/lib/core/facets/hash/each_with_key.rb +12 -0
- data/lib/core/facets/hash/fetch_nested.rb +20 -0
- data/lib/core/facets/hash/keys.rb +4 -13
- data/lib/core/facets/hash/only_keys.rb +1 -0
- data/lib/core/facets/hash/op_push.rb +9 -1
- data/lib/core/facets/hash/op_sub.rb +1 -1
- data/lib/core/facets/hash/recursively.rb +6 -6
- data/lib/core/facets/hash/rekey.rb +26 -34
- data/lib/core/facets/hash/revalue.rb +61 -0
- data/lib/core/facets/hash/slice.rb +16 -3
- data/lib/core/facets/hash/subset.rb +11 -8
- data/lib/core/facets/hash/update_each.rb +1 -1
- data/lib/core/facets/hash/weave.rb +1 -1
- data/lib/core/facets/indexable.rb +6 -6
- data/lib/core/facets/integer.rb +0 -4
- data/lib/core/facets/kernel.rb +4 -7
- data/lib/core/facets/kernel/__dir__.rb +2 -0
- data/lib/core/facets/kernel/as.rb +2 -1
- data/lib/core/facets/kernel/call_stack.rb +1 -56
- data/lib/core/facets/kernel/callstack.rb +56 -1
- data/lib/core/facets/kernel/constant.rb +2 -0
- data/lib/core/facets/kernel/deep_clone.rb +27 -1
- data/lib/core/facets/kernel/deep_copy.rb +0 -24
- data/lib/core/facets/kernel/eigen.rb +2 -33
- data/lib/core/facets/kernel/eigenclass.rb +1 -1
- data/lib/core/facets/kernel/ergo.rb +1 -1
- data/lib/core/facets/kernel/extend.rb +4 -6
- data/lib/core/facets/kernel/instance_assign.rb +8 -6
- 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/{equate.rb → like.rb} +7 -4
- data/lib/core/facets/kernel/load_relative.rb +25 -1
- data/lib/core/facets/kernel/meta.rb +35 -0
- data/lib/core/facets/kernel/meta_def.rb +4 -0
- data/lib/core/facets/kernel/object_send.rb +11 -14
- data/lib/core/facets/kernel/respond.rb +3 -13
- data/lib/core/facets/kernel/tap.rb +27 -39
- data/lib/core/facets/load_path.rb +1 -0
- data/lib/core/facets/load_path/search.rb +16 -0
- data/lib/core/facets/matchdata.rb +0 -2
- data/lib/core/facets/method.rb +0 -2
- data/lib/core/facets/method/composition.rb +32 -16
- data/lib/core/facets/method/curry.rb +13 -0
- data/lib/core/facets/method/partial.rb +10 -0
- data/lib/core/facets/method/public.rb +33 -0
- data/lib/core/facets/module.rb +0 -2
- data/lib/core/facets/module/alias_class_method.rb +11 -0
- data/lib/core/facets/module/basename.rb +1 -31
- data/lib/core/facets/module/cattr.rb +1 -0
- data/lib/core/facets/module/lastname.rb +30 -0
- data/lib/core/facets/module/mattr.rb +4 -4
- data/lib/core/facets/nilclass.rb +0 -3
- data/lib/core/facets/numeric.rb +0 -4
- data/lib/core/facets/numeric/approx.rb +3 -2
- data/lib/core/facets/numeric/range.rb +12 -0
- data/lib/core/facets/numeric/round_to.rb +32 -1
- data/lib/core/facets/object.rb +2 -3
- data/lib/core/facets/object/itself.rb +16 -0
- data/lib/core/facets/objectspace.rb +0 -3
- data/lib/core/facets/proc.rb +0 -3
- data/lib/core/facets/proc/bind_to.rb +3 -3
- data/lib/core/facets/proc/wrap.rb +17 -0
- data/lib/core/facets/process.rb +0 -2
- data/lib/core/facets/range.rb +4 -4
- 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/{to_r.rb → to_rng.rb} +1 -1
- data/lib/core/facets/regexp.rb +0 -2
- data/lib/core/facets/regexp/to_proc.rb +13 -0
- data/lib/core/facets/string.rb +8 -9
- data/lib/core/facets/string/ascii_only.rb +52 -0
- data/lib/core/facets/string/each_match.rb +1 -0
- data/lib/core/facets/string/ends_with.rb +1 -0
- data/lib/core/facets/string/file.rb +6 -20
- data/lib/core/facets/string/fold.rb +5 -5
- data/lib/core/facets/string/indent.rb +37 -20
- data/lib/core/facets/string/indexable.rb +7 -0
- data/lib/core/facets/string/interpolate.rb +6 -2
- data/lib/core/facets/string/linear.rb +19 -0
- data/lib/core/facets/string/margin.rb +47 -19
- data/lib/core/facets/string/mscan.rb +3 -0
- data/lib/core/facets/string/number.rb +14 -0
- data/lib/core/facets/string/op_sub.rb +1 -14
- data/lib/core/facets/string/random.rb +34 -0
- data/lib/core/facets/string/remove.rb +30 -0
- data/lib/core/facets/string/rotate.rb +24 -0
- data/lib/core/facets/string/similarity.rb +2 -2
- data/lib/core/facets/string/starts_with.rb +5 -0
- data/lib/core/facets/string/tab.rb +2 -17
- data/lib/core/facets/string/tabto.rb +2 -19
- data/lib/core/facets/string/to_rx.rb +1 -0
- data/lib/core/facets/string/trim.rb +45 -0
- data/lib/core/facets/string/unfold.rb +7 -2
- data/lib/core/facets/struct.rb +1 -2
- data/lib/core/facets/struct/replace.rb +8 -0
- data/lib/core/facets/symbol.rb +1 -3
- data/lib/core/facets/symbol/as_s.rb +3 -1
- data/lib/core/facets/symbol/call.rb +29 -0
- data/lib/core/facets/symbol/thrown.rb +9 -5
- data/lib/core/facets/time.rb +0 -2
- data/lib/core/facets/time/future.rb +6 -4
- data/lib/core/facets/unboundmethod.rb +0 -3
- data/lib/core/facets/version.rb +5 -5
- data/lib/standard/facets/against.rb +53 -0
- data/lib/standard/facets/binding/block_exec.rb +44 -0
- data/lib/standard/facets/cgi.rb +2 -40
- 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/cli.rb +54 -0
- data/lib/standard/facets/cloneable.rb +12 -9
- data/lib/standard/facets/enumargs.rb +159 -168
- data/lib/standard/facets/find.rb +1 -15
- data/lib/standard/facets/find/select.rb +16 -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/hash_builder.rb +46 -0
- data/lib/standard/facets/load_monitor.rb +26 -0
- data/lib/standard/facets/math.rb +57 -57
- data/lib/standard/facets/math/acosec.rb +1 -0
- data/lib/standard/facets/math/acsc.rb +6 -1
- data/lib/standard/facets/math/beta.rb +8 -3
- data/lib/standard/facets/math/cosec.rb +1 -0
- data/lib/standard/facets/math/cosech.rb +1 -0
- data/lib/standard/facets/math/csc.rb +6 -1
- data/lib/standard/facets/math/csch.rb +6 -1
- data/lib/standard/facets/math/distance.rb +19 -0
- data/lib/standard/facets/math/ec.rb +5 -0
- data/lib/standard/facets/math/lgamma.rb +21 -21
- data/lib/standard/facets/math/lngamma.rb +18 -0
- data/lib/standard/facets/math/pow.rb +6 -1
- data/lib/standard/facets/math/root.rb +1 -1
- data/lib/standard/facets/math/sign.rb +15 -4
- data/lib/standard/facets/math/tau.rb +5 -0
- data/lib/standard/facets/math/tgamma.rb +1 -1
- data/lib/standard/facets/memoizer.rb +63 -0
- data/lib/standard/facets/ostruct.rb +37 -156
- 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/pathname.rb +18 -215
- 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/platform.rb +2 -2
- data/lib/standard/facets/random.rb +32 -2
- data/lib/standard/facets/shellwords.rb +5 -2
- data/lib/standard/facets/thread.rb +2 -2
- data/lib/standard/facets/uri.rb +7 -178
- 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/yaml.rb +3 -56
- 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/test/core/array/test_arrange.rb +37 -0
- data/test/core/array/test_each_overlap.rb +31 -0
- data/test/core/array/test_intersection.rb +19 -0
- data/test/core/array/test_missing.rb +12 -0
- data/test/core/array/test_occur.rb +52 -0
- data/test/core/array/test_occurrence.rb +20 -0
- data/test/core/array/test_reject_values.rb +17 -0
- data/test/core/array/test_squeeze.rb +22 -0
- data/test/core/array/test_step.rb +28 -0
- data/test/core/array/test_unique_permutation.rb +23 -0
- data/test/core/enumerable/test_key_by.rb +22 -0
- data/test/core/enumerable/test_occur.rb +18 -5
- data/test/core/enumerable/test_only.rb +40 -0
- data/test/core/enumerable/test_squeeze.rb +35 -0
- data/test/core/enumerable/test_sum.rb +8 -3
- data/test/core/enumerator/lazy/test_squeeze.rb +33 -0
- data/test/core/hash/test_count.rb +10 -1
- data/test/core/hash/test_deep_rekey.rb +131 -0
- data/test/core/hash/test_each_with_key.rb +16 -0
- data/test/core/hash/test_fetch_nested.rb +24 -0
- data/test/core/hash/test_keys.rb +0 -11
- data/test/core/hash/test_rekey.rb +41 -1
- data/test/core/hash/test_revalue.rb +98 -0
- data/test/core/hash/test_slice.rb +12 -1
- data/test/core/kernel/test_deep_clone.rb +31 -0
- data/test/core/kernel/test_deep_copy.rb +2 -28
- data/test/core/kernel/test_instance_extract.rb +28 -0
- data/test/core/method/test_composition.rb +42 -0
- data/test/core/range/test_op_add.rb +24 -0
- data/test/core/range/test_op_sub.rb +34 -0
- data/test/core/string/test_ascii_only.rb +30 -0
- data/test/core/string/test_margin.rb +4 -104
- data/test/core/string/test_number.rb +44 -0
- data/test/core/string/test_remove.rb +36 -0
- data/test/core/string/test_rotate.rb +31 -0
- data/test/core/string/test_trim.rb +116 -0
- data/test/core/symbol/test_thrown.rb +22 -0
- data/test/standard/binding/test_block_exec.rb +21 -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_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 +6 -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_enumargs.rb +1 -1
- data/test/standard/test_math.rb +3 -0
- data/test/standard/test_ostruct.rb +26 -21
- data/test/standard/test_uri.rb +9 -0
- metadata +802 -183
- data/.ruby +0 -54
- data/HISTORY.rdoc +0 -2386
- data/lib/core/facets/array/combination.rb +0 -43
- data/lib/core/facets/array/index.rb +0 -23
- data/lib/core/facets/array/occurent.rb +0 -1
- data/lib/core/facets/array/permutation.rb +0 -32
- data/lib/core/facets/array/product.rb +0 -30
- data/lib/core/facets/array/rotate.rb +0 -48
- data/lib/core/facets/array/select.rb +0 -20
- data/lib/core/facets/binding/eval.rb +0 -14
- data/lib/core/facets/enumerable/count.rb +0 -53
- data/lib/core/facets/enumerable/each_with_object.rb +0 -38
- data/lib/core/facets/enumerable/group_by.rb +0 -33
- data/lib/core/facets/enumerable/none.rb +0 -32
- data/lib/core/facets/enumerable/one.rb +0 -39
- data/lib/core/facets/enumerable/take.rb +0 -16
- data/lib/core/facets/float/round.rb +0 -2
- data/lib/core/facets/hash/select.rb +0 -17
- data/lib/core/facets/hash/to_h.rb +0 -1
- data/lib/core/facets/hash/url_params.rb +0 -21
- data/lib/core/facets/instance.rb +0 -157
- data/lib/core/facets/integer/even.rb +0 -1
- data/lib/core/facets/integer/odd.rb +0 -37
- data/lib/core/facets/kernel/__callee__.rb +0 -1
- data/lib/core/facets/kernel/__method__.rb +0 -48
- data/lib/core/facets/kernel/require_relative.rb +0 -52
- data/lib/core/facets/kernel/source_location.rb +0 -13
- data/lib/core/facets/nilclass/to_f.rb +0 -17
- data/lib/core/facets/numeric/round.rb +0 -69
- data/lib/core/facets/numeric/round_at.rb +0 -1
- data/lib/core/facets/object/replace.rb +0 -43
- data/lib/core/facets/objectspace/reflect.rb +0 -62
- data/lib/core/facets/proc/curry.rb +0 -32
- data/lib/core/facets/string/bytes.rb +0 -21
- data/lib/core/facets/string/each_char.rb +0 -31
- data/lib/core/facets/string/end_with.rb +0 -1
- data/lib/core/facets/string/lines.rb +0 -19
- data/lib/core/facets/string/random_binary.rb +0 -10
- data/lib/core/facets/string/start_with.rb +0 -60
- data/lib/core/facets/symbol/to_proc.rb +0 -33
- data/lib/core/facets/to_hash.rb +0 -336
- data/lib/core/facets/unboundmethod/name.rb +0 -28
- data/lib/standard/facets/math/gamma.rb +0 -12
- data/test/core/array/test_occurent.rb +0 -33
- data/test/core/kernel/test_source_location.rb +0 -25
- data/test/core/string/test_tabto.rb +0 -16
@@ -0,0 +1,20 @@
|
|
1
|
+
class Hash
|
2
|
+
|
3
|
+
# Similar to Hash#fetch but supports nested lookup and is `nil` safe.
|
4
|
+
#
|
5
|
+
# {}.fetch_nested('anything','at','all') #=> nil
|
6
|
+
#
|
7
|
+
# h = {'hello'=>{'world'=>42}}
|
8
|
+
# h.fetch_nested(*['hello','world']) #=> 42
|
9
|
+
#
|
10
|
+
# CREDIT: T. Yamada and Sean Mackesey
|
11
|
+
|
12
|
+
def fetch_nested(*keys)
|
13
|
+
begin
|
14
|
+
keys.reduce(self){|accum, k| accum.fetch(k)}
|
15
|
+
rescue (RUBY_VERSION<'1.9' ? IndexError : KeyError)
|
16
|
+
block_given? ? yield(*keys) : nil
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -9,12 +9,12 @@ class Hash
|
|
9
9
|
#
|
10
10
|
# CREDIT: Trans
|
11
11
|
|
12
|
-
def
|
12
|
+
def keys?(*check_keys)
|
13
13
|
unknown_keys = check_keys - self.keys
|
14
14
|
return unknown_keys.empty?
|
15
15
|
end
|
16
16
|
|
17
|
-
alias_method :
|
17
|
+
alias_method :has_keys?, :keys?
|
18
18
|
|
19
19
|
# Returns true if the hash contains
|
20
20
|
# _only_ the given keys, otherwise false.
|
@@ -25,21 +25,12 @@ class Hash
|
|
25
25
|
#
|
26
26
|
# CREDIT: Trans
|
27
27
|
|
28
|
-
def
|
28
|
+
def only_keys?(*check_keys)
|
29
29
|
unknown_keys = self.keys - check_keys
|
30
30
|
return unknown_keys.empty?
|
31
31
|
end
|
32
32
|
|
33
|
-
alias_method :
|
34
|
-
|
35
|
-
# Each with key is like each_pair but reverses the order
|
36
|
-
# the parameters to [value,key] instead of [key,value].
|
37
|
-
#
|
38
|
-
# CREDIT: Trans
|
39
|
-
|
40
|
-
def each_with_key( &yld )
|
41
|
-
each_pair{ |k,v| yld.call(v,k) }
|
42
|
-
end
|
33
|
+
alias_method :has_only_keys?, :only_keys?
|
43
34
|
|
44
35
|
end
|
45
36
|
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'facets/hash/keys'
|
@@ -7,11 +7,19 @@ class Hash
|
|
7
7
|
|
8
8
|
def <<(other)
|
9
9
|
if other.respond_to?(:to_ary)
|
10
|
-
|
10
|
+
store(*other)
|
11
11
|
else
|
12
12
|
update(other)
|
13
13
|
end
|
14
14
|
self
|
15
15
|
end
|
16
16
|
|
17
|
+
#def <<(pairs)
|
18
|
+
# if Array === pairs
|
19
|
+
# merge! Hash[*pairs]
|
20
|
+
# else
|
21
|
+
# merge! pairs
|
22
|
+
# end
|
23
|
+
#end
|
24
|
+
|
17
25
|
end
|
@@ -6,16 +6,16 @@ class Hash
|
|
6
6
|
# Apply a block to a hash, and recursively apply that block
|
7
7
|
# to each sub-hash:
|
8
8
|
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
9
|
+
# h = {:a=>1, :b=>{:x=>1, :y=>2}}
|
10
|
+
# h.recursively.map{ |k,v| [k.to_s, v] }
|
11
|
+
# #=> [["a", 1], ["b", [["y", 2], ["x", 1]]]]
|
12
12
|
#
|
13
13
|
# The recursive iteration can be treated separately from the non-recursive
|
14
14
|
# iteration by passing a block to the #recursive method:
|
15
15
|
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
16
|
+
# h = {:a=>1, :b=>{:x=>1, :y=>2}}
|
17
|
+
# h.recursively{ |k,v| [k.to_s, v] }.map{ |k,v| [k.to_s, v.to_s] }
|
18
|
+
# #=> [["a", "1"], ["b", [["y", "2"], ["x", "1"]]]]
|
19
19
|
#
|
20
20
|
def recursively(*types, &block)
|
21
21
|
Recursor.new(self, *types, &block)
|
@@ -1,15 +1,11 @@
|
|
1
|
-
require 'facets/symbol/to_proc'
|
2
|
-
require 'facets/na'
|
3
|
-
|
4
1
|
class Hash
|
5
2
|
|
6
|
-
# TODO: Improve Hash#rekey code!!!
|
7
|
-
|
8
3
|
# Rekey a hash:
|
9
4
|
#
|
10
5
|
# rekey()
|
11
6
|
# rekey(from_key => to_key, ...)
|
12
7
|
# rekey{|from_key| to_key}
|
8
|
+
# rekey{|from_key, value| to_key}
|
13
9
|
#
|
14
10
|
# If a key map is given, then the first key is changed to the second key.
|
15
11
|
#
|
@@ -19,8 +15,7 @@ class Hash
|
|
19
15
|
# foo.rekey('foo'=>'bar') #=> { :a =>1, :b=>2 }
|
20
16
|
#
|
21
17
|
# If a block is given, converts all keys in the Hash accroding to the
|
22
|
-
# given block procedure.
|
23
|
-
# then that key will be left intact.
|
18
|
+
# given block procedure.
|
24
19
|
#
|
25
20
|
# foo = { :name=>'Gavin', :wife=>:Lisa }
|
26
21
|
# foo.rekey{ |k| k.to_s } #=> { "name"=>"Gavin", "wife"=>:Lisa }
|
@@ -29,49 +24,46 @@ class Hash
|
|
29
24
|
# If no key map or block is given, then all keys are converted
|
30
25
|
# to Symbols.
|
31
26
|
#
|
32
|
-
#
|
33
|
-
#
|
27
|
+
# Raises an ArgumentError if both a +key_map+ and a block are given.
|
28
|
+
# If both are needed just call #rekey twice.
|
29
|
+
#
|
30
|
+
# TODO: If `nil` is returned by block should the key be set to `nil` or the orignal key?
|
34
31
|
#
|
35
32
|
# CREDIT: Trans, Gavin Kistner
|
36
33
|
|
37
34
|
def rekey(key_map=nil, &block)
|
35
|
+
raise ArgumentError, "argument or block" if key_map && block
|
36
|
+
|
38
37
|
if !(key_map or block)
|
39
38
|
block = lambda{|k| k.to_sym}
|
40
39
|
end
|
41
40
|
|
42
|
-
key_map ||= {}
|
43
|
-
|
44
|
-
hash = dup.replace({}) # to keep default_proc
|
45
|
-
|
46
|
-
(keys - key_map.keys).each do |key|
|
47
|
-
hash[key] = self[key]
|
48
|
-
end
|
49
|
-
|
50
|
-
key_map.each do |from, to|
|
51
|
-
hash[to] = self[from] if key?(from)
|
52
|
-
end
|
53
|
-
|
54
41
|
if block
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
nk = block.call(k,v)
|
60
|
-
nk = (NA == nk ? k : nk)
|
61
|
-
hash2[nk] = v
|
42
|
+
hash = dup.clear
|
43
|
+
if block.arity.abs == 1
|
44
|
+
each_pair do |k, v|
|
45
|
+
hash[block[k]] = v #hash[block[k] || k] = v
|
62
46
|
end
|
63
47
|
else
|
64
|
-
|
65
|
-
|
66
|
-
nk = (NA == nk ? k : nk)
|
67
|
-
hash2[nk] = v
|
48
|
+
each_pair do |k, v|
|
49
|
+
hash[block[k,v]] = v #hash[block[k,v] || k] = v
|
68
50
|
end
|
69
51
|
end
|
70
52
|
else
|
71
|
-
|
53
|
+
#hash = dup.clear # to keep default_proc
|
54
|
+
#(keys - key_map.keys).each do |key|
|
55
|
+
# hash[key] = self[key]
|
56
|
+
#end
|
57
|
+
#key_map.each do |from, to|
|
58
|
+
# hash[to] = self[from] if key?(from)
|
59
|
+
#end
|
60
|
+
hash = dup # to keep default_proc
|
61
|
+
key_map.each_pair do |from, to|
|
62
|
+
hash[to] = hash.delete(from) if hash.key?(from)
|
63
|
+
end
|
72
64
|
end
|
73
65
|
|
74
|
-
|
66
|
+
hash
|
75
67
|
end
|
76
68
|
|
77
69
|
# Synonym for Hash#rekey, but modifies the receiver in place (and returns it).
|
@@ -0,0 +1,61 @@
|
|
1
|
+
class Hash
|
2
|
+
|
3
|
+
# Generates a new hash where the values are the result of the passed in
|
4
|
+
# block. The block takes both the key and value of the current entry as
|
5
|
+
# arguments.
|
6
|
+
#
|
7
|
+
# hash = { a: 1, b: 2 }
|
8
|
+
# hash.revalue { |v| v + 1 } # => { a: 2, b: 3 }
|
9
|
+
#
|
10
|
+
# Returns [Hash].
|
11
|
+
#
|
12
|
+
# Credit: Sean Mackesey
|
13
|
+
|
14
|
+
def revalue(val_map=nil, &block)
|
15
|
+
raise ArgumentError, "argument or block, not both" if val_map && block
|
16
|
+
|
17
|
+
if !(val_map or block)
|
18
|
+
raise ArgumentError, "must provide Hash arguments or a block"
|
19
|
+
#block = lambda{|v| v.to_s}
|
20
|
+
end
|
21
|
+
|
22
|
+
if block
|
23
|
+
hash = dup.clear # to keep default_proc
|
24
|
+
if block.arity.abs == 1
|
25
|
+
each_pair do |k, v|
|
26
|
+
hash[k] = block[v] #hash[k] = block[v] || v
|
27
|
+
end
|
28
|
+
else
|
29
|
+
each_pair do |k, v|
|
30
|
+
hash[k] = block[k,v] #hash[k] = block[k,v] || v
|
31
|
+
end
|
32
|
+
end
|
33
|
+
else
|
34
|
+
hash = dup.clear # to keep default_proc
|
35
|
+
each do |k,v|
|
36
|
+
if val_map.key?(v)
|
37
|
+
hash[k] = val_map[v]
|
38
|
+
else
|
39
|
+
hash[k] = v
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
hash
|
45
|
+
end
|
46
|
+
|
47
|
+
# The in-place version of Hash#revalue.
|
48
|
+
#
|
49
|
+
# hash = { a: 1, b: 2 }
|
50
|
+
# hash.revalue! { |v| v + 1 }
|
51
|
+
# hash # => { a: 2, b: 3 }
|
52
|
+
#
|
53
|
+
# Returns [Hash].
|
54
|
+
#
|
55
|
+
# Credit: Sean Mackesey
|
56
|
+
|
57
|
+
def revalue!(val_map=nil, &block)
|
58
|
+
replace(revalue(val_map, &block))
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -2,13 +2,20 @@ class Hash
|
|
2
2
|
|
3
3
|
# Returns a new hash with only the given keys.
|
4
4
|
#
|
5
|
-
# h = {:a=>1, :b=>2}
|
6
|
-
# h.slice(:a) #=> {:a=>1}
|
5
|
+
# h = {:a=>1, :b=>2, :c=>3}
|
6
|
+
# h.slice(:a, :c) #=> {:a=>1, :c=>3}
|
7
|
+
# h.slice(:a, :d) #=> {:a=>1}
|
7
8
|
#
|
8
9
|
def slice(*keep_keys)
|
10
|
+
if block_given?
|
11
|
+
each do |k, v|
|
12
|
+
keep_keys << k if yield(k, v)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
9
16
|
hash = {}
|
10
17
|
keep_keys.each do |key|
|
11
|
-
hash[key] = fetch(key)
|
18
|
+
hash[key] = fetch(key) if key?(key)
|
12
19
|
end
|
13
20
|
hash
|
14
21
|
end
|
@@ -22,6 +29,12 @@ class Hash
|
|
22
29
|
#
|
23
30
|
# Returns a Hash of the removed pairs.
|
24
31
|
def slice!(*keep_keys)
|
32
|
+
if block_given?
|
33
|
+
each do |k, v|
|
34
|
+
keep_keys << k if yield(k, v)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
25
38
|
rejected = keys - keep_keys
|
26
39
|
removed = {}
|
27
40
|
rejected.each{ |k| removed[k] = delete(k) }
|
@@ -4,21 +4,24 @@ class Hash
|
|
4
4
|
# that evaluates to true for each hash key.
|
5
5
|
#
|
6
6
|
# {'a'=>1, 'b'=>2}.subset('a') #=> {'a'=>1}
|
7
|
-
# {'a'=>1, 'b'=>2}.subset{|k| k == 'a'
|
7
|
+
# {'a'=>1, 'b'=>2}.subset{|k| k == 'a'} #=> {'a'=>1}
|
8
8
|
#
|
9
9
|
# CREDIT: Alexey Petrushin
|
10
|
-
def subset(keys
|
10
|
+
def subset(*keys, &block)
|
11
11
|
h = {}
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
|
13
|
+
if block
|
14
|
+
raise ArgumentError, "subset arguments and block are exclusive parameters" unless keys.empty?
|
15
|
+
each do |k, v|
|
16
|
+
h[k] = v if block.call(k)
|
15
17
|
end
|
16
18
|
else
|
17
|
-
|
18
|
-
h[k] = v if
|
19
|
+
each do |k, v|
|
20
|
+
h[k] = v if keys.include?(k)
|
19
21
|
end
|
20
22
|
end
|
21
|
-
|
23
|
+
|
24
|
+
return h
|
22
25
|
end
|
23
26
|
|
24
27
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class Hash
|
2
2
|
|
3
|
-
# Iterates through each pair and updates
|
3
|
+
# Iterates through each pair and updates the hash
|
4
4
|
# in place. This is formally equivalent to #mash!
|
5
5
|
# But does not use #mash to accomplish the task.
|
6
6
|
# Hence #update_each is probably a touch faster.
|
@@ -1,16 +1,16 @@
|
|
1
1
|
# Indexable is a mixin that provides index based methods,
|
2
|
-
# working
|
2
|
+
# working solely with four methods: #index, #slice, #splice
|
3
3
|
# and #size.
|
4
4
|
#
|
5
5
|
# These methods work in harmony. Where #index returns a
|
6
6
|
# position of a given element, #slice returns elements
|
7
7
|
# for given positions. #splice is like #slice but replaces
|
8
|
-
# the given position with new values. This
|
8
|
+
# the given position with new values. This method is not
|
9
9
|
# part of ruby core, but it generally just an alias for #[]=,
|
10
10
|
# just as #slice is an alias of #[]. #size of course simply
|
11
11
|
# returns the total length of the indexable object.
|
12
12
|
#
|
13
|
-
# NOTE: To test the
|
13
|
+
# NOTE: To test the following methods Indexable needs to be
|
14
14
|
# included into Array and array must have #splice defined.
|
15
15
|
#
|
16
16
|
# require 'facets/array/splice'
|
@@ -49,7 +49,7 @@ module Indexable
|
|
49
49
|
slice(-1,1)
|
50
50
|
end
|
51
51
|
|
52
|
-
# Returns an array of the first element
|
52
|
+
# Returns an array of the first element up to,
|
53
53
|
# but not including, the last element.
|
54
54
|
#
|
55
55
|
# [1,2,3].body #=> [1,2]
|
@@ -74,7 +74,7 @@ module Indexable
|
|
74
74
|
#
|
75
75
|
# In other words, If there are an even number of elements the
|
76
76
|
# higher-indexed of the two center elements is indexed as
|
77
|
-
#
|
77
|
+
# origin (0).
|
78
78
|
#
|
79
79
|
def mid(offset=0)
|
80
80
|
slice((size / 2) + offset)
|
@@ -103,7 +103,7 @@ module Indexable
|
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
106
|
-
# Fetch values from a start index
|
106
|
+
# Fetch values from a start index through an end index.
|
107
107
|
#
|
108
108
|
# [1,2,3,4,5].thru(0,2) #=> [1,2,3]
|
109
109
|
# [1,2,3,4,5].thru(2,4) #=> [3,4,5]
|
data/lib/core/facets/integer.rb
CHANGED
@@ -1,11 +1,7 @@
|
|
1
|
-
require 'facets/kernel/require_relative'
|
2
|
-
|
3
1
|
require_relative 'integer/bit.rb'
|
4
2
|
require_relative 'integer/bitmask.rb'
|
5
|
-
require_relative 'integer/even.rb'
|
6
3
|
require_relative 'integer/factorial.rb'
|
7
4
|
require_relative 'integer/multiple.rb'
|
8
|
-
require_relative 'integer/odd.rb'
|
9
5
|
require_relative 'integer/of.rb'
|
10
6
|
require_relative 'integer/ordinal.rb'
|
11
7
|
#require_relative 'integer/roman.rb' # uncommon
|
data/lib/core/facets/kernel.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'facets/kernel/require_relative'
|
2
|
-
|
3
1
|
require_relative 'kernel/as.rb'
|
4
2
|
require_relative 'kernel/ask.rb'
|
5
3
|
require_relative 'kernel/assign.rb'
|
@@ -19,7 +17,7 @@ require_relative 'kernel/disable_warnings.rb'
|
|
19
17
|
require_relative 'kernel/eigen.rb'
|
20
18
|
#require_relative 'kernel/eigenclass.rb' # uncommon
|
21
19
|
require_relative 'kernel/enable_warnings.rb'
|
22
|
-
require_relative 'kernel/equate.rb'
|
20
|
+
#require_relative 'kernel/equate.rb'
|
23
21
|
require_relative 'kernel/ergo.rb'
|
24
22
|
require_relative 'kernel/extend.rb'
|
25
23
|
require_relative 'kernel/extension.rb'
|
@@ -31,7 +29,10 @@ require_relative 'kernel/in.rb'
|
|
31
29
|
require_relative 'kernel/instance_assign.rb'
|
32
30
|
require_relative 'kernel/instance_class.rb'
|
33
31
|
#require_relative 'kernel/instance_exec.rb' # uncommon
|
32
|
+
require_relative 'kernel/instance_extract.rb'
|
33
|
+
require_relative 'kernel/instance_replace.rb'
|
34
34
|
require_relative 'kernel/instance_send.rb'
|
35
|
+
require_relative 'kernel/like.rb'
|
35
36
|
require_relative 'kernel/load_all.rb'
|
36
37
|
require_relative 'kernel/load_relative.rb'
|
37
38
|
require_relative 'kernel/maybe.rb'
|
@@ -52,13 +53,11 @@ require_relative 'kernel/presence.rb'
|
|
52
53
|
require_relative 'kernel/present.rb'
|
53
54
|
require_relative 'kernel/qua_class.rb'
|
54
55
|
require_relative 'kernel/require_all.rb'
|
55
|
-
require_relative 'kernel/require_relative.rb'
|
56
56
|
require_relative 'kernel/respond.rb'
|
57
57
|
require_relative 'kernel/returning.rb'
|
58
58
|
require_relative 'kernel/silence.rb'
|
59
59
|
require_relative 'kernel/silence_warnings.rb'
|
60
60
|
require_relative 'kernel/singleton_class.rb'
|
61
|
-
require_relative 'kernel/source_location.rb'
|
62
61
|
require_relative 'kernel/super_method.rb'
|
63
62
|
require_relative 'kernel/tap.rb'
|
64
63
|
require_relative 'kernel/temporarily.rb'
|
@@ -70,10 +69,8 @@ require_relative 'kernel/with.rb'
|
|
70
69
|
require_relative 'kernel/writers.rb'
|
71
70
|
#require_relative 'kernel/y.rb' # uncommon
|
72
71
|
require_relative 'kernel/yes.rb'
|
73
|
-
require_relative 'kernel/__callee__.rb'
|
74
72
|
require_relative 'kernel/__class__.rb'
|
75
73
|
require_relative 'kernel/__dir__.rb'
|
76
74
|
require_relative 'kernel/__get__.rb'
|
77
|
-
require_relative 'kernel/__method__.rb'
|
78
75
|
require_relative 'kernel/__set__.rb'
|
79
76
|
|