mack-facets 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gems.rb +25 -0
- data/lib/gems/english-0.3.1/VERSION +1 -0
- data/lib/gems/english-0.3.1/lib/english/array.rb +48 -0
- data/lib/gems/english-0.3.1/lib/english/censor.rb +76 -0
- data/lib/gems/english-0.3.1/lib/english/double_metaphone.rb +353 -0
- data/lib/gems/english-0.3.1/lib/english/dresner.rb +47 -0
- data/lib/gems/english-0.3.1/lib/english/inflect.rb +299 -0
- data/lib/gems/english-0.3.1/lib/english/jumble.rb +37 -0
- data/lib/gems/english-0.3.1/lib/english/levenshtein.rb +78 -0
- data/lib/gems/english-0.3.1/lib/english/metaphone.rb +110 -0
- data/lib/gems/english-0.3.1/lib/english/numerals.rb +71 -0
- data/lib/gems/english-0.3.1/lib/english/patterns.rb +49 -0
- data/lib/gems/english-0.3.1/lib/english/porter_stemming.rb +188 -0
- data/lib/gems/english-0.3.1/lib/english/roman.rb +174 -0
- data/lib/gems/english-0.3.1/lib/english/similarity.rb +103 -0
- data/lib/gems/english-0.3.1/lib/english/soundex.rb +70 -0
- data/lib/gems/english-0.3.1/lib/english/string.rb +210 -0
- data/lib/gems/english-0.3.1/lib/english/style.rb +294 -0
- data/lib/gems/english-0.3.1/lib/english/style_orm.rb +143 -0
- data/lib/gems/english-0.3.1/lib/english/textfilter.rb +91 -0
- data/lib/gems/extlib-0.9.8/lib/extlib.rb +56 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/assertions.rb +8 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/blank.rb +59 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/boolean.rb +11 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/class.rb +175 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/datetime.rb +9 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/dictionary.rb +433 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/hash.rb +419 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/hook.rb +366 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/inflection.rb +435 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/lazy_array.rb +106 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/logger.rb +202 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/mash.rb +148 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/module.rb +41 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/nil.rb +5 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/numeric.rb +5 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/object.rb +175 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/object_space.rb +13 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/pathname.rb +5 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/pooling.rb +239 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/rubygems.rb +38 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/simple_set.rb +39 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/string.rb +132 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/struct.rb +8 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/symbol.rb +17 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/tasks/release.rb +15 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/time.rb +19 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/version.rb +3 -0
- data/lib/gems/extlib-0.9.8/lib/extlib/virtual_file.rb +10 -0
- data/lib/gems/facets-2.4.5/VERSION +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets-live.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets-load.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets.rb +11 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/combination.rb +59 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/conjoin.rb +58 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/delete.rb +61 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/index.rb +48 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/indexable.rb +73 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/merge.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/not_empty.rb +13 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/only.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/pad.rb +41 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/permutation.rb +30 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/product.rb +57 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/recursively.rb +30 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/rotate.rb +42 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/select.rb +16 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/splice.rb +30 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/stackable.rb +33 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/array/traverse.rb +22 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/binding.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/binding/caller.rb +54 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/binding/defined.rb +13 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/binding/eval.rb +18 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/binding/local_variables.rb +15 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/binding/self.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/bitmask.rb +104 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/blank.rb +60 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/boolean.rb +156 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/callstack.rb +52 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/cattr.rb +2 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class/cattr.rb +115 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class/cattr_accessor.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class/cattr_reader.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class/cattr_writer.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class/descendents.rb +36 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class/methodize.rb +14 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class/pathize.rb +14 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class/prepend.rb +50 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class/subclasses.rb +2 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/class/to_proc.rb +42 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/comparable.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/comparable/bound.rb +65 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/comparable/cmp.rb +38 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/comparable/comparable.rb +42 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/dir.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/dir/ascend.rb +59 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/dir/descend.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/dir/multiglob.rb +92 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/dir/parent.rb +13 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/dir/recurse.rb +29 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/accumulate.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/cluster_by.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/collect.rb +54 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/commonality.rb +33 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/count.rb +26 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/divide.rb +33 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/duplicates.rb +38 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/each_by.rb +33 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/entropy.rb +37 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/frequency.rb +18 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/group_by.rb +27 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/inject.rb +31 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/map_send.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/mash.rb +32 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/mode.rb +16 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/modulate.rb +22 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/none.rb +31 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/occur.rb +38 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/one.rb +38 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/probability.rb +36 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/split.rb +27 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/sum.rb +16 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/enumerable/uniq_by.rb +18 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/exception.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/exception/detail.rb +19 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/exception/suppress.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/file.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/file/append.rb +14 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/file/create.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/file/null.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/file/read.rb +41 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/file/rewrite.rb +88 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/file/rootname.rb +33 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/file/split_root.rb +10 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/file/write.rb +22 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/file/writelines.rb +24 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/filetest.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/filetest/root.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/float.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/float/round.rb +2 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/functor.rb +77 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/alias.rb +31 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/argumentize.rb +22 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/at.rb +8 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/autonew.rb +42 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/collate.rb +45 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/delete.rb +47 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/diff.rb +11 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/except.rb +27 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/insert.rb +19 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/inverse.rb +27 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/join.rb +14 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/keys.rb +45 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/mash.rb +18 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/merge.rb +30 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/op.rb +7 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/op_add.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/op_and.rb +33 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/op_mul.rb +18 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/op_or.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/op_push.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/op_sub.rb +26 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/recursive_merge.rb +33 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/recursively.rb +29 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/rekey.rb +59 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/select.rb +14 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/slice.rb +33 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/swap.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/to_h.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/to_proc.rb +41 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/to_struct.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/traverse.rb +41 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/update.rb +81 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/weave.rb +81 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/hash/zipnew.rb +2 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/indexable.rb +251 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/integer.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/integer/even.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/integer/factorial.rb +30 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/integer/multiple.rb +15 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/integer/odd.rb +35 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/integer/of.rb +18 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/integer/ordinal.rb +24 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/__callee__.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/__class__.rb +9 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/__dir__.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/__get__.rb +10 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/__method__.rb +36 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/__set__.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/as.rb +100 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/ask.rb +27 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/attr_singleton.rb +62 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/complete.rb +18 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/constant.rb +24 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/d.rb +26 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/deep_copy.rb +13 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/demo.rb +23 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/ergo.rb +42 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/here.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/in.rb +13 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/instance.rb +19 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/instance_assign.rb +41 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/instance_class.rb +24 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/instance_exec.rb +40 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/instance_send.rb +7 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/instance_variables.rb +99 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/maybe.rb +18 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/not_nil.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/object_class.rb +10 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/object_hexid.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/object_send.rb +32 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/p.rb +24 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/populate.rb +73 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/qua_class.rb +19 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/require_all.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/require_local.rb +24 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/resc.rb +16 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/respond.rb +23 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/returning.rb +23 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/silence.rb +75 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/singleton_class.rb +19 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/tap.rb +32 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/try.rb +23 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/val.rb +19 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/kernel/with.rb +20 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/lazy.rb +238 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/matchdata.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/matchdata/match.rb +15 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/matchdata/matchset.rb +44 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/metaid.rb +94 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/abstract.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/alias_accessor.rb +45 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/alias_method_chain.rb +50 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/alias_module_function.rb +30 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/ancestor.rb +16 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/basename.rb +31 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/can.rb +14 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/class.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/conflict.rb +63 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/include_function_module.rb +25 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/instance_methods.rb +40 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/integrate.rb +2 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/is.rb +57 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/methodize.rb +14 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/modspace.rb +22 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/module_load.rb +56 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/nesting.rb +18 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/op.rb +95 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/pathize.rb +22 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/prepend.rb +26 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/redefine_method.rb +35 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/redirect_method.rb +45 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/rename_method.rb +20 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/revise.rb +62 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/spacename.rb +25 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/module/wrap_method.rb +28 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/nilclass.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/nilclass/ergo.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/nilclass/to_f.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/numeric.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/numeric/approx.rb +15 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/numeric/distance.rb +14 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/numeric/round.rb +72 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/proc.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/proc/bind.rb +22 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/proc/compose.rb +42 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/proc/curry.rb +31 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/proc/to_method.rb +33 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/proc/update.rb +9 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/range.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/range/combine.rb +47 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/range/overlap.rb +13 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/range/to_r.rb +26 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/range/umbrella.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/range/within.rb +66 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/regexp.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/regexp/arity.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/regexp/to_re.rb +28 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/stackable.rb +86 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/align.rb +106 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/bracket.rb +105 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/bytes.rb +15 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/camelcase.rb +26 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/capitalized.rb +46 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/chars.rb +16 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/chomp.rb +33 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/cleave.rb +36 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/divide.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/each_char.rb +29 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/each_word.rb +13 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/end_with.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/fold.rb +39 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/interpolate.rb +20 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/line_wrap.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/lines.rb +16 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/methodize.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/modulize.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/mscan.rb +19 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/natcmp.rb +88 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/nchar.rb +28 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/op_sub.rb +14 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/pathize.rb +16 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/range.rb +77 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/rewrite.rb +28 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/shatter.rb +22 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/snakecase.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/splice.rb +37 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/start_with.rb +32 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/subtract.rb +4 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/tab.rb +103 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/titlecase.rb +15 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/to_re.rb +26 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/variablize.rb +13 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/word_wrap.rb +34 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/words.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/string/xor.rb +22 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol/chomp.rb +24 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol/generate.rb +24 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol/not.rb +29 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol/plain.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol/query.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol/re_s.rb +18 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol/setter.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol/succ.rb +19 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol/to_proc.rb +38 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/symbol/variablize.rb +12 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time/advance.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time/ago.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time/change.rb +41 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time/elapse.rb +16 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time/hence.rb +94 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time/round.rb +17 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time/set.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time/stamp.rb +44 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time/to_time.rb +21 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/time/trunc.rb +15 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/to_hash.rb +87 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/unboundmethod.rb +6 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/unboundmethod/arguments.rb +44 -0
- data/lib/gems/facets-2.4.5/lib/core/facets/unboundmethod/name.rb +25 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/basicobject.rb +14 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/cgi.rb +50 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/continuation.rb +57 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/date.rb +396 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/fileutils.rb +27 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/fileutils/head.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/fileutils/safe_ln.rb +28 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/fileutils/slice.rb +141 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/fileutils/tail.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/fileutils/wc.rb +114 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/fileutils/whereis.rb +64 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/fileutils/which.rb +101 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/getoptlong.rb +71 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/logger.rb +291 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/ostruct.rb +238 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/pathname.rb +172 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/rbconfig.rb +45 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/set.rb +27 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/shellwords.rb +89 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/uri.rb +249 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/yaml.rb +75 -0
- data/lib/gems/facets-2.4.5/lib/lore/facets/zlib.rb +38 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/1stclassmethod.rb +140 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/advisable.rb +162 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/annotations.rb +302 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/ansicode.rb +315 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/arguments.rb +365 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/argvector.rb +353 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/association.rb +194 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/attr.rb +208 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/autoarray.rb +62 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/autoreload.rb +150 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/basex.rb +37 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/bbcode.rb +397 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/bicrypt.rb +265 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/binding/opvars.rb +24 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/binreadable.rb +221 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/blankslate.rb +66 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/buildable.rb +344 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/bytes.rb +175 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/cachedecorator.rb +117 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/capsule.rb +258 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/chain.rb +58 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/class_extension.rb +114 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/classmethods.rb +199 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/cloneable.rb +76 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/command.rb +439 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/consoleutils.rb +113 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/coroutine.rb +159 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/crypt.rb +166 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/cssfilter.rb +254 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/daemonize.rb +44 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/dependency.rb +151 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/dictionary.rb +478 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/dictionarymatcher.rb +136 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/downloader.rb +281 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/duplicable.rb +43 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/duration.rb +540 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/elementor.rb +133 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/elementwise.rb +61 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/enumerablepass.rb +217 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/equatable.rb +120 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/eventhook.rb +132 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/expirable.rb +82 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/fileable.rb +162 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/filelist.rb +497 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/fileshell.rb +202 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/hash/stringify_keys.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/hash/symbolize_keys.rb +94 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/heap.rb +22 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/htmlfilter.rb +595 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/infinity.rb +193 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/inheritor.rb +130 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/ini.rb +264 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/instantiable.rb +47 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/instantise.rb +1 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/instantize.rb +95 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/interval.rb +282 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/ioredirect.rb +130 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/iteration.rb +65 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/kernel/meta.rb +32 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/linkedlist.rb +222 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/lrucache.rb +157 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/main.rb +70 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/memoize.rb +116 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/methodspace.rb +141 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/minitar.rb +1063 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/multipliers.rb +109 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/multiton.rb +386 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/nackclass.rb +41 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/net/smtp_tls.rb +131 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/nilstatus.rb +47 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/nullclass.rb +74 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/opencascade.rb +94 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/opencollection.rb +43 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/openhash.rb +39 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/openobject.rb +267 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/opesc.rb +60 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/orderedhash.rb +37 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/overload.rb +94 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/paramix.rb +202 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/partial.rb +37 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/pathlist.rb +112 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/platform.rb +192 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/pool.rb +91 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/pqueue.rb +449 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/progressbar.rb +253 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/prototype.rb +88 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/random.rb +451 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/rbsystem.rb +222 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/recorder.rb +109 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/reference.rb +99 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/reflection.rb +145 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/registerable.rb +35 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/rwdelegator.rb +74 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/semaphore.rb +92 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/settings.rb +248 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/snapshot.rb +209 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/string/mask.rb +278 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/string/words.rb +173 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/succ.rb +44 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/syncarray.rb +114 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/synchash.rb +157 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/tagiter.rb +366 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/thread.rb +51 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/timer.rb +274 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/times.rb +431 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/tracepoint.rb +209 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/tuple.rb +325 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/typecast.rb +261 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/uninheritable.rb +50 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/uploadutils.rb +464 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/version.rb +136 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/xmlhash.rb +112 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/xoxo.rb +259 -0
- data/lib/gems/facets-2.4.5/lib/more/facets/ziputils.rb +349 -0
- data/lib/mack-facets.rb +4 -2
- data/lib/mack-facets/english_extensions/inflect.rb +50 -50
- data/lib/mack-facets/extensions/string.rb +10 -1
- data/lib/mack-facets/utils/inflections.rb +50 -47
- data/lib/mack-facets/utils/inflector.rb +19 -19
- metadata +547 -36
@@ -0,0 +1,222 @@
|
|
1
|
+
# = System
|
2
|
+
#
|
3
|
+
# The System module provides Platform and Ruby system information.
|
4
|
+
# The module should also be able to stand in for rbconfig.
|
5
|
+
# It is intended for use as a service module although it
|
6
|
+
# can be mixed-in too.
|
7
|
+
#
|
8
|
+
# Note: This library is still being worked on a good bit.
|
9
|
+
#
|
10
|
+
# == History
|
11
|
+
#
|
12
|
+
# Adapted from RubyParams module by Minero Aoki
|
13
|
+
# Copyright (c) 1999-2002 Minero Aoki <aamine@loveruby.net>
|
14
|
+
#
|
15
|
+
# == Authors
|
16
|
+
#
|
17
|
+
# * Thomas Sawyer
|
18
|
+
# * Minero Aoki
|
19
|
+
#
|
20
|
+
# == Todo
|
21
|
+
#
|
22
|
+
# * Consider renaming module to "Ruby" ?
|
23
|
+
#
|
24
|
+
# == Copying
|
25
|
+
#
|
26
|
+
# Copyright (c) 2005 Thomas Sawyer, Minero Aoki
|
27
|
+
#
|
28
|
+
# Ruby License
|
29
|
+
#
|
30
|
+
# This module is free software. You may use, modify, and/or redistribute this
|
31
|
+
# software under the same terms as Ruby.
|
32
|
+
#
|
33
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
34
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
35
|
+
# FOR A PARTICULAR PURPOSE.
|
36
|
+
|
37
|
+
require 'rbconfig'
|
38
|
+
|
39
|
+
# = System
|
40
|
+
#
|
41
|
+
# The System module provides Platform and Ruby system information.
|
42
|
+
# The module should also be able to stand in for rbconfig.
|
43
|
+
# It is intended for use as a service module although it
|
44
|
+
# can be mixed-in too.
|
45
|
+
|
46
|
+
module System
|
47
|
+
|
48
|
+
extend self # or module_function ?
|
49
|
+
|
50
|
+
# Execution Environment -------------------------------------
|
51
|
+
|
52
|
+
def program_name; $0 ; end
|
53
|
+
def program_name=(x); $0=x ; end
|
54
|
+
|
55
|
+
def argv; $* ; end
|
56
|
+
alias options argv
|
57
|
+
|
58
|
+
# these won't work here
|
59
|
+
#def file; __FILE__ ; end
|
60
|
+
#def filepath; File.expand_path(__FILE__) ; end
|
61
|
+
#def lineno; __LINE__ ; end
|
62
|
+
|
63
|
+
def process_id; $$ ; end
|
64
|
+
alias_method :pid, :process_id
|
65
|
+
|
66
|
+
def child_status; $? ; end
|
67
|
+
alias exit_status child_status
|
68
|
+
|
69
|
+
def error_info; $! ; end
|
70
|
+
def error_position; $@ ; end
|
71
|
+
|
72
|
+
def debug; $DEBUG; end
|
73
|
+
|
74
|
+
def safe; $SAFE; end
|
75
|
+
|
76
|
+
def verbose; $VERBOSE; end
|
77
|
+
def verbose=(x); $VERBOSE=x; end
|
78
|
+
|
79
|
+
def coding; $-K ; end
|
80
|
+
def coding=(x); $-K=x ; end
|
81
|
+
|
82
|
+
def line_end_processing; $-l ; end
|
83
|
+
|
84
|
+
def program_loop; $-p ; end
|
85
|
+
|
86
|
+
def environment; ENV ; end
|
87
|
+
def env; ENV ; end
|
88
|
+
|
89
|
+
# Input/Ouput Variables -------------------------------------
|
90
|
+
|
91
|
+
def stdin; $stdin ; end
|
92
|
+
def stdin=(x); $stdin=x ; end
|
93
|
+
|
94
|
+
def stdout ; $stdout ; end
|
95
|
+
def stdout=(x); $stdout=x ; end
|
96
|
+
|
97
|
+
def stderr ; $stderr ; end
|
98
|
+
def stderr=(x); $stderr=x ; end
|
99
|
+
|
100
|
+
def default_input ; $< ; end
|
101
|
+
alias_method :defin, :default_input
|
102
|
+
alias_method :argf, :default_input
|
103
|
+
|
104
|
+
def default_output ; $> ; end
|
105
|
+
def default_output=(x); $defout=x ; end
|
106
|
+
alias_method :defout, :default_output
|
107
|
+
alias_method :defout=, :default_output=
|
108
|
+
|
109
|
+
def output_record_separator ; $\ ; end
|
110
|
+
def output_record_separator=(x) ; $\=x ; end
|
111
|
+
alias_method :ors, :output_record_separator
|
112
|
+
alias_method :ors=, :output_record_separator=
|
113
|
+
|
114
|
+
def output_field_separator ; $-F ; end
|
115
|
+
def output_field_separator=(x) ; $-F=x ; end
|
116
|
+
alias_method :ofs, :output_field_separator
|
117
|
+
alias_method :ofs=, :output_field_separator=
|
118
|
+
|
119
|
+
def input_record_separator ; $/ ; end
|
120
|
+
def input_record_separator=(x) ; $/=x ; end
|
121
|
+
alias_method :rs, :input_record_separator
|
122
|
+
alias_method :rs=, :input_record_separator=
|
123
|
+
|
124
|
+
def input_field_separator ; $/ ; end
|
125
|
+
def input_field_separator=(x) ; $/=x ; end
|
126
|
+
alias_method :fs, :input_field_separator
|
127
|
+
alias_method :fs=, :input_field_separator=
|
128
|
+
|
129
|
+
def input_line_number ; $. ; end
|
130
|
+
alias_method :input_lineno, :input_line_number
|
131
|
+
|
132
|
+
# Miscellaneous ---------------------------------------------
|
133
|
+
|
134
|
+
def data; DATA ; end
|
135
|
+
|
136
|
+
# Ruby Config -----------------------------------------------
|
137
|
+
|
138
|
+
::Config::CONFIG.each do |k,v|
|
139
|
+
define_method( k.downcase ) { v }
|
140
|
+
end
|
141
|
+
|
142
|
+
alias_method :ruby, :ruby_install_name
|
143
|
+
|
144
|
+
def rubypath
|
145
|
+
File.join( bindir, ruby_install_name )
|
146
|
+
end
|
147
|
+
|
148
|
+
def platform
|
149
|
+
RUBY_PLATFORM
|
150
|
+
end
|
151
|
+
|
152
|
+
def version
|
153
|
+
RUBY_VERSION
|
154
|
+
end
|
155
|
+
|
156
|
+
def release
|
157
|
+
RUBY_RELEASE_DATE
|
158
|
+
end
|
159
|
+
|
160
|
+
def extentions
|
161
|
+
[ 'rb', DLEXT ]
|
162
|
+
end
|
163
|
+
|
164
|
+
def rubylibdir
|
165
|
+
File.join( libdir, 'ruby' )
|
166
|
+
end
|
167
|
+
|
168
|
+
#def sitelibdir
|
169
|
+
# File.join( rubylibdir, 'site_ruby', version )
|
170
|
+
#end
|
171
|
+
#
|
172
|
+
#STDLIBDIR = File.join( LIBDIR, VERSION )
|
173
|
+
#RBDIR = File.join( STDLIBDIR )
|
174
|
+
#SODIR = File.join( STDLIBDIR, ARCH )
|
175
|
+
#
|
176
|
+
#SITE_RB = File.join( SITELIBDIR )
|
177
|
+
#SITE_SO = File.join( SITELIBDIR, ARCH )
|
178
|
+
|
179
|
+
# load path ----------------------------------------------------
|
180
|
+
|
181
|
+
def load_path; $: ; end
|
182
|
+
|
183
|
+
def loaded_features; $" ; end
|
184
|
+
alias_method :required, :loaded_features
|
185
|
+
|
186
|
+
# platform -----------------------------------------------------
|
187
|
+
|
188
|
+
def current_platform
|
189
|
+
arch = Config::CONFIG['arch']
|
190
|
+
#cpu, os = arch.split '-', 2
|
191
|
+
return match_platform(arch)
|
192
|
+
end
|
193
|
+
|
194
|
+
#
|
195
|
+
|
196
|
+
def match_platform(arch)
|
197
|
+
cpu, os = arch.split '-', 2
|
198
|
+
cpu, os = nil, cpu if os.nil? # java
|
199
|
+
|
200
|
+
cpu = case cpu
|
201
|
+
when /i\d86/ then 'x86'
|
202
|
+
else cpu
|
203
|
+
end
|
204
|
+
|
205
|
+
os = case os
|
206
|
+
when /cygwin/ then [ 'cygwin', nil ]
|
207
|
+
when /darwin(\d+)?/ then [ 'darwin', $1 ]
|
208
|
+
when /freebsd(\d+)/ then [ 'freebsd', $1 ]
|
209
|
+
when /^java$/ then [ 'java', nil ]
|
210
|
+
when /^java([\d.]*)/ then [ 'java', $1 ]
|
211
|
+
when /linux/ then [ 'linux', $1 ]
|
212
|
+
when /mingw32/ then [ 'mingw32', nil ]
|
213
|
+
when /mswin32/ then [ 'mswin32', nil ]
|
214
|
+
when /openbsd(\d+\.\d+)/ then [ 'openbsd', $1 ]
|
215
|
+
when /solaris(\d+\.\d+)/ then [ 'solaris', $1 ]
|
216
|
+
else [ 'unknown', nil ]
|
217
|
+
end
|
218
|
+
|
219
|
+
[cpu, os].flatten.compact.join("-")
|
220
|
+
end
|
221
|
+
|
222
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# = Recorder
|
2
|
+
#
|
3
|
+
# == Synopsis
|
4
|
+
#
|
5
|
+
# Recorder is similar essentially a method probe. It records everthing
|
6
|
+
# that happens to it, building an internal parse tree. You can then
|
7
|
+
# pass a substitute object and apply the recoding to it. Or you can
|
8
|
+
# utilize the parse tree.
|
9
|
+
#
|
10
|
+
# The only limitation of Recorder is with special operators, like if, &&, ||, etc.
|
11
|
+
# Since they are not true methods they can't be recorded. (Too bad for Ruby.)
|
12
|
+
#
|
13
|
+
# == Usage
|
14
|
+
#
|
15
|
+
# class Z
|
16
|
+
# def name ; 'George' ; end
|
17
|
+
# def age ; 12 ; end
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
# z = Z.new
|
21
|
+
#
|
22
|
+
# r = Recorder.new
|
23
|
+
# q = proc { |x| (x.name == 'George') & (x.age > 10) }
|
24
|
+
# x = q[r]
|
25
|
+
# x.__call__(z)
|
26
|
+
#
|
27
|
+
# produces
|
28
|
+
#
|
29
|
+
# true
|
30
|
+
#
|
31
|
+
# == Authors
|
32
|
+
#
|
33
|
+
# * Thomas Sawyer
|
34
|
+
#
|
35
|
+
# == Copying
|
36
|
+
#
|
37
|
+
# Copyright (c) 2006 Thomas Sawyer
|
38
|
+
#
|
39
|
+
# Ruby License
|
40
|
+
#
|
41
|
+
# This module is free software. You may use, modify, and/or redistribute this
|
42
|
+
# software under the same terms as Ruby.
|
43
|
+
#
|
44
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
45
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
46
|
+
# FOR A PARTICULAR PURPOSE.
|
47
|
+
|
48
|
+
require 'facets/kernel/object_class'
|
49
|
+
|
50
|
+
# = Recorder
|
51
|
+
#
|
52
|
+
# Recorder is similar essentially a method probe. It records everthing
|
53
|
+
# that happens to it, building an internal parse tree. You can then
|
54
|
+
# pass a substitute object and apply the recoding to it. Or you can
|
55
|
+
# utilize the parse tree.
|
56
|
+
#
|
57
|
+
# The only limitation of Recorder is with special operators, like if, &&, ||, etc.
|
58
|
+
# Since they are not true methods they can't be recorded. (Too bad for Ruby.)
|
59
|
+
#
|
60
|
+
# class Z
|
61
|
+
# def name ; 'George' ; end
|
62
|
+
# def age ; 12 ; end
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# z = Z.new
|
66
|
+
#
|
67
|
+
# r = Recorder.new
|
68
|
+
# q = proc { |x| (x.name == 'George') & (x.age > 10) }
|
69
|
+
# x = q[r]
|
70
|
+
# x.__call__(z)
|
71
|
+
#
|
72
|
+
# produces
|
73
|
+
#
|
74
|
+
# true
|
75
|
+
#
|
76
|
+
class Recorder
|
77
|
+
|
78
|
+
# Privatize all kernel methods.
|
79
|
+
|
80
|
+
private(*instance_methods)
|
81
|
+
|
82
|
+
#
|
83
|
+
|
84
|
+
def initialize( msg=nil )
|
85
|
+
@msg = msg
|
86
|
+
end
|
87
|
+
|
88
|
+
def inspect
|
89
|
+
"<Recorder #{@msg.inspect}>"
|
90
|
+
end
|
91
|
+
|
92
|
+
def __call__( orig )
|
93
|
+
return orig unless @msg
|
94
|
+
|
95
|
+
sym = @msg[0]
|
96
|
+
args = @msg[1..-1].collect do |a|
|
97
|
+
Recorder === a ? a.__call__(orig) : a
|
98
|
+
end
|
99
|
+
obj = args.shift
|
100
|
+
|
101
|
+
obj.__send__( sym, *args )
|
102
|
+
end
|
103
|
+
|
104
|
+
def method_missing( sym, *args, &blk )
|
105
|
+
object_class.new( [ sym, self, *args ] )
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# = Reference
|
2
|
+
#
|
3
|
+
# Reference provides a way to access object indirectly.
|
4
|
+
# This allows for the object itself to be changed on the fly.
|
5
|
+
#
|
6
|
+
# == Synopsis
|
7
|
+
#
|
8
|
+
# a = "HELLO"
|
9
|
+
# b = ref(a)
|
10
|
+
# puts b #=> "HELLO"
|
11
|
+
# c = 10
|
12
|
+
# b.become(c)
|
13
|
+
# puts b #=> "10"
|
14
|
+
#
|
15
|
+
# == Authors
|
16
|
+
#
|
17
|
+
# * Thomas Sawyer
|
18
|
+
#
|
19
|
+
# == Copying
|
20
|
+
#
|
21
|
+
# Copyright (c) 2005 Thomas Sawyer
|
22
|
+
#
|
23
|
+
# Ruby License
|
24
|
+
#
|
25
|
+
# This module is free software. You may use, modify, and/or redistribute this
|
26
|
+
# software under the same terms as Ruby.
|
27
|
+
#
|
28
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
29
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
30
|
+
# FOR A PARTICULAR PURPOSE.
|
31
|
+
|
32
|
+
# = Reference
|
33
|
+
#
|
34
|
+
# Reference provides a way to access object indirectly.
|
35
|
+
# This allows for the object itself to be changed on the fly.
|
36
|
+
#
|
37
|
+
# a = "HELLO"
|
38
|
+
# b = ref(a)
|
39
|
+
# puts b #=> "HELLO"
|
40
|
+
# c = 10
|
41
|
+
# b.become(c)
|
42
|
+
# puts b #=> "10"
|
43
|
+
#
|
44
|
+
class Reference
|
45
|
+
|
46
|
+
# Privatize most Kernel methods.
|
47
|
+
|
48
|
+
private *instance_methods
|
49
|
+
|
50
|
+
def self.new(obj)
|
51
|
+
ref = allocate
|
52
|
+
ref.become obj
|
53
|
+
ref
|
54
|
+
end
|
55
|
+
|
56
|
+
def method_missing(*args, &block)
|
57
|
+
@ref.__send__(*args, &block)
|
58
|
+
end
|
59
|
+
|
60
|
+
def become(obj)
|
61
|
+
old = @ref
|
62
|
+
@ref = obj
|
63
|
+
old
|
64
|
+
end
|
65
|
+
|
66
|
+
def __value__
|
67
|
+
@ref
|
68
|
+
end
|
69
|
+
|
70
|
+
alias_method :instance_delegate, :__value__
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
module Kernel
|
75
|
+
|
76
|
+
# Shortcut reference constructor.
|
77
|
+
|
78
|
+
def ref(x)
|
79
|
+
Reference.new(x)
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
# _____ _
|
87
|
+
# |_ _|__ ___| |_
|
88
|
+
# | |/ _ \/ __| __|
|
89
|
+
# | | __/\__ \ |_
|
90
|
+
# |_|\___||___/\__|
|
91
|
+
#
|
92
|
+
|
93
|
+
=begin #test
|
94
|
+
|
95
|
+
require 'test/unit'
|
96
|
+
|
97
|
+
# TODO
|
98
|
+
|
99
|
+
=end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
# = Reflection
|
2
|
+
#
|
3
|
+
# Provides externailzed, safe access to an object's meta-information.
|
4
|
+
#
|
5
|
+
# == Authors
|
6
|
+
#
|
7
|
+
# * Thomas Sawyer
|
8
|
+
#
|
9
|
+
# == Copying
|
10
|
+
#
|
11
|
+
# Copyright (c) 2006 Thomas Sawyer
|
12
|
+
#
|
13
|
+
# Ruby License
|
14
|
+
#
|
15
|
+
# This module is free software. You may use, modify, and/or redistribute this
|
16
|
+
# software under the same terms as Ruby.
|
17
|
+
#
|
18
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
19
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
20
|
+
# FOR A PARTICULAR PURPOSE.
|
21
|
+
#
|
22
|
+
# == NOTES
|
23
|
+
#
|
24
|
+
# This is expirmental. Maybe it should be moved to the Trinkets project.
|
25
|
+
# The idea is to be able to access a object as a pure object, by binding
|
26
|
+
# methods called to Object/Kernel first. Thus bypassing any overriden
|
27
|
+
# methods.
|
28
|
+
#
|
29
|
+
# But you can use #at to do this already.
|
30
|
+
#
|
31
|
+
# obj.at(Object).object_id
|
32
|
+
#
|
33
|
+
# For metaprogramming this can be important.
|
34
|
+
|
35
|
+
#
|
36
|
+
class << ObjectSpace
|
37
|
+
alias_method :[], :_id2ref
|
38
|
+
end
|
39
|
+
|
40
|
+
# = ObjectReflection
|
41
|
+
#
|
42
|
+
# obj.__object__.id
|
43
|
+
# obj.__object__.class
|
44
|
+
#
|
45
|
+
# NOTE: This is still an expirmental library.
|
46
|
+
|
47
|
+
class ObjectReflection
|
48
|
+
|
49
|
+
instance_methods.each{|m| private(m) unless m.to_s =~ /^__/ }
|
50
|
+
|
51
|
+
#
|
52
|
+
def initialize(object)
|
53
|
+
@self = object
|
54
|
+
@meth = {}
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
def id
|
59
|
+
_bind_method(:object_id).call
|
60
|
+
end
|
61
|
+
|
62
|
+
#Kernel.instance_methods.select{ |m| m =~ /^instance_/ }.each do |m|
|
63
|
+
# meth = m.to_s.sub(/^instance_/, '')
|
64
|
+
# module_eval %{
|
65
|
+
# def #{meth}(*a, &b)
|
66
|
+
# _bind_method(:#{m}).call(*a,&b)
|
67
|
+
# end
|
68
|
+
# }
|
69
|
+
#end
|
70
|
+
|
71
|
+
def method_missing(s, *a, &b)
|
72
|
+
_bind_method(s).call(*a, &b)
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
76
|
+
|
77
|
+
def _bind_method(meth)
|
78
|
+
@meth[meth.to_sym] ||= Kernel.instance_method(meth).bind(@self)
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
module Kernel
|
84
|
+
|
85
|
+
# Binds a method to Object/Kernel before calling it.
|
86
|
+
#
|
87
|
+
# obj.__object__.id
|
88
|
+
# obj.__object__.class
|
89
|
+
#
|
90
|
+
# For metaprogramming this can be important.
|
91
|
+
|
92
|
+
def __object__
|
93
|
+
@_object_reflection ||= ObjectReflection.new(self)
|
94
|
+
end
|
95
|
+
|
96
|
+
#def __instance__
|
97
|
+
# @_instance_reflection ||= InstanceReflection.new(self)
|
98
|
+
#end
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
=begin
|
105
|
+
# = InstanceReflection
|
106
|
+
#
|
107
|
+
# obj.__instance__.id
|
108
|
+
# obj.__instance__.class
|
109
|
+
#
|
110
|
+
#
|
111
|
+
class InstanceReflection < ObjectReflection
|
112
|
+
|
113
|
+
REFLECTION_METHODS = (
|
114
|
+
meths = Kernel.instance_methods.select{ |m| m =~ /^instance_/ }
|
115
|
+
meths += [:send]
|
116
|
+
meths.collect!{|m| m.to_sym}
|
117
|
+
meths.uniq!
|
118
|
+
p meths
|
119
|
+
meths
|
120
|
+
)
|
121
|
+
|
122
|
+
def initialize(object)
|
123
|
+
@self = object
|
124
|
+
@proc = {}
|
125
|
+
#@meta = REFLECTION_METHODS.inject({}) do |rproc, meth|
|
126
|
+
# name = meth.to_s.sub(/^instance_/, '').to_sym
|
127
|
+
# rproc[name] = Kernel.instance_method(meth).bind(@self)
|
128
|
+
# rproc
|
129
|
+
#end
|
130
|
+
end
|
131
|
+
|
132
|
+
REFLECTION_METHODS.each do |meth|
|
133
|
+
name = meth.to_s.sub(/^instance_/, '')
|
134
|
+
|
135
|
+
module_eval %{
|
136
|
+
def #{name}(*a,&b)
|
137
|
+
@proc[:#{meth}] ||= Kernel.instance_method(:#{meth}).bind(@self)
|
138
|
+
@proc[:#{meth}].call(*a,&b)
|
139
|
+
end
|
140
|
+
}, __FILE__, __LINE__
|
141
|
+
end
|
142
|
+
|
143
|
+
end
|
144
|
+
=end
|
145
|
+
|