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,193 @@
|
|
1
|
+
# = Infinity
|
2
|
+
#
|
3
|
+
# A full featured Infinity class, supporting signed direction.
|
4
|
+
# Inifinty is a multiton based on direction The constant INFINITY
|
5
|
+
# is provided as the common case with direction=+1 (positive).
|
6
|
+
#
|
7
|
+
# Besides being an class, these four constants are preset:
|
8
|
+
#
|
9
|
+
# NaN
|
10
|
+
# Inf
|
11
|
+
# PosInf
|
12
|
+
# NegInf
|
13
|
+
#
|
14
|
+
# These four constants a built from two other basic constants:
|
15
|
+
#
|
16
|
+
# UNDEFINED
|
17
|
+
# INFINITY
|
18
|
+
#
|
19
|
+
# In physical memory there are actually only three objects, namely
|
20
|
+
# three instances of InfinityClass, one for NaN, PosInf and NegInf,
|
21
|
+
# respectively.
|
22
|
+
#
|
23
|
+
# == Copying
|
24
|
+
#
|
25
|
+
# Copyright (c) 2004 Thomas Sawyer
|
26
|
+
#
|
27
|
+
# Ruby License
|
28
|
+
#
|
29
|
+
# This module is free software. You may use, modify, and/or redistribute this
|
30
|
+
# software under the same terms as Ruby.
|
31
|
+
#
|
32
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
33
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
34
|
+
# FOR A PARTICULAR PURPOSE.
|
35
|
+
#
|
36
|
+
# == Authors
|
37
|
+
#
|
38
|
+
# * Thomas Sawyer
|
39
|
+
#
|
40
|
+
# == Todo
|
41
|
+
#
|
42
|
+
# * Could @direction values greater than 1 support Aleph?
|
43
|
+
|
44
|
+
require 'facets/multiton'
|
45
|
+
|
46
|
+
# = Infinity
|
47
|
+
#
|
48
|
+
# A full featured Infinity class, supporting signed direction.
|
49
|
+
# Inifinty is a multiton based on direction The constant INFINITY
|
50
|
+
# is provided as the common case with direction=+1 (positive).
|
51
|
+
#
|
52
|
+
# Besides being an class, these four constants are preset:
|
53
|
+
#
|
54
|
+
# NaN
|
55
|
+
# Inf
|
56
|
+
# PosInf
|
57
|
+
# NegInf
|
58
|
+
#
|
59
|
+
# These four constants a built from two other basic constants:
|
60
|
+
#
|
61
|
+
# UNDEFINED
|
62
|
+
# INFINITY
|
63
|
+
#
|
64
|
+
# In physical memory there are actually only three objects, namely
|
65
|
+
# three instances of InfinityClass, one for NaN, PosInf and NegInf,
|
66
|
+
# respectively.
|
67
|
+
#
|
68
|
+
class InfinityClass < Numeric
|
69
|
+
include Multiton
|
70
|
+
|
71
|
+
attr_reader :direction
|
72
|
+
|
73
|
+
def initialize(direction=1)
|
74
|
+
@direction = (direction <=> 0)
|
75
|
+
super()
|
76
|
+
end
|
77
|
+
|
78
|
+
# Change direction of infinity.
|
79
|
+
|
80
|
+
def -@
|
81
|
+
case @direction
|
82
|
+
when 0 : self.class.instance(0)
|
83
|
+
when 1 : self.class.instance(-1)
|
84
|
+
when -1 : self.class.instance(1)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# Noop.
|
89
|
+
|
90
|
+
def +@
|
91
|
+
self
|
92
|
+
end
|
93
|
+
|
94
|
+
# Convert to the float version of infinity.
|
95
|
+
|
96
|
+
def to_f
|
97
|
+
(1.0/0) * @direction
|
98
|
+
end
|
99
|
+
|
100
|
+
# Gee, a real infinite loop!
|
101
|
+
|
102
|
+
def times
|
103
|
+
loop do yield end
|
104
|
+
end
|
105
|
+
|
106
|
+
# Coerce allows other numbers to be
|
107
|
+
# compared to infinity.
|
108
|
+
|
109
|
+
def coerce(other)
|
110
|
+
case other
|
111
|
+
when InfinityClass
|
112
|
+
super
|
113
|
+
else
|
114
|
+
return -self, other
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
# Equality. Note that NaN != NaN.
|
119
|
+
|
120
|
+
def ==(other)
|
121
|
+
case other
|
122
|
+
when InfinityClass
|
123
|
+
if @direction == 0 and other.direction == 0
|
124
|
+
false
|
125
|
+
else
|
126
|
+
super
|
127
|
+
end
|
128
|
+
else
|
129
|
+
false
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# Comparision where infinity is alway greatest
|
134
|
+
# and negative infinityalways least.
|
135
|
+
|
136
|
+
def <=>(other)
|
137
|
+
case other
|
138
|
+
when InfinityClass
|
139
|
+
@direction <=> other.direction
|
140
|
+
else
|
141
|
+
@direction
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
#
|
146
|
+
|
147
|
+
def to_s
|
148
|
+
case @direction
|
149
|
+
when 0 : "NaN"
|
150
|
+
when 1 : "PosInf"
|
151
|
+
when -1 : "NegInf"
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
|
157
|
+
#
|
158
|
+
|
159
|
+
class Numeric
|
160
|
+
|
161
|
+
def finite?
|
162
|
+
not InfinityClass === self
|
163
|
+
end
|
164
|
+
|
165
|
+
def infinite?
|
166
|
+
return false if NaN == self
|
167
|
+
InfinityClass === self
|
168
|
+
end
|
169
|
+
alias :inf? :infinite?
|
170
|
+
|
171
|
+
def nan?
|
172
|
+
NaN == self
|
173
|
+
end
|
174
|
+
|
175
|
+
def posinf?
|
176
|
+
PosInf == self
|
177
|
+
end
|
178
|
+
|
179
|
+
def neginf?
|
180
|
+
NegInf == self
|
181
|
+
end
|
182
|
+
|
183
|
+
end
|
184
|
+
|
185
|
+
# Set constant to positive infinity.
|
186
|
+
UNDEFINED = InfinityClass.new(0)
|
187
|
+
INFINITY = InfinityClass.new(1)
|
188
|
+
|
189
|
+
NaN = UNDEFINED
|
190
|
+
Inf = INFINITY
|
191
|
+
PosInf = +INFINITY
|
192
|
+
NegInf = -INFINITY
|
193
|
+
|
@@ -0,0 +1,130 @@
|
|
1
|
+
# = Inheritor
|
2
|
+
#
|
3
|
+
# Inheritor providse a means to store and inherit data via
|
4
|
+
# the class heirarchy. An inheritor creates two methods
|
5
|
+
# one named after the key that provides a reader. And one
|
6
|
+
# named after key! which provides the writer. (Because of
|
7
|
+
# the unique nature of inheritor the reader and writer
|
8
|
+
# can't be the same method.)
|
9
|
+
#
|
10
|
+
# class X
|
11
|
+
# inheritor :foo, [], :+
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# class Y < X
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# X.x! << :a
|
18
|
+
# X.x => [:a]
|
19
|
+
# Y.x => [:a]
|
20
|
+
#
|
21
|
+
# Y.x! << :b
|
22
|
+
# X.x => [:a]
|
23
|
+
# Y.x => [:a, :b]
|
24
|
+
#
|
25
|
+
# It is interesting to note that the only reason inheritor is needed at all
|
26
|
+
# is becuase Ruby does not allow modules to be inherited at the class-level, or
|
27
|
+
# conversely that the "class-levels" of classes are not modules instead.
|
28
|
+
#
|
29
|
+
# == Authors
|
30
|
+
#
|
31
|
+
# * Thomas Sawyer
|
32
|
+
#
|
33
|
+
# == Copying
|
34
|
+
#
|
35
|
+
# Copyright (c) 2005 Thomas Sawyer
|
36
|
+
#
|
37
|
+
# Ruby License
|
38
|
+
#
|
39
|
+
# This module is free software. You may use, modify, and/or redistribute this
|
40
|
+
# software under the same terms as Ruby.
|
41
|
+
#
|
42
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
43
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
44
|
+
# FOR A PARTICULAR PURPOSE.
|
45
|
+
|
46
|
+
#require 'facets/module/class_extension'
|
47
|
+
require 'facets/class_extension'
|
48
|
+
|
49
|
+
# = Inheritor
|
50
|
+
#
|
51
|
+
# Inheritor providse a means to store and inherit data via
|
52
|
+
# the class heirarchy. An inheritor creates two methods
|
53
|
+
# one named after the key that provides a reader. And one
|
54
|
+
# named after key! which provides the writer. (Because of
|
55
|
+
# the unique nature of inheritor the reader and writer
|
56
|
+
# can't be the same method.)
|
57
|
+
#
|
58
|
+
# class X
|
59
|
+
# inheritor :foo, [], :+
|
60
|
+
# end
|
61
|
+
#
|
62
|
+
# class Y < X
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# X.x! << :a
|
66
|
+
# X.x => [:a]
|
67
|
+
# Y.x => [:a]
|
68
|
+
#
|
69
|
+
# Y.x! << :b
|
70
|
+
# X.x => [:a]
|
71
|
+
# Y.x => [:a, :b]
|
72
|
+
#
|
73
|
+
# It is interesting to note that the only reason inheritor is needed at all
|
74
|
+
# is becuase Ruby does not allow modules to be inherited at the class-level, or
|
75
|
+
# conversely that the "class-levels" of classes are not modules instead.
|
76
|
+
|
77
|
+
class Object
|
78
|
+
|
79
|
+
# Create an inheritor "class attribute".
|
80
|
+
def inheritor( key, obj, op=nil )
|
81
|
+
|
82
|
+
# inhertiance operator
|
83
|
+
op = op ? op.to_sym : :add
|
84
|
+
|
85
|
+
# inheritor store a this level
|
86
|
+
instance_variable_set("@#{key}", obj)
|
87
|
+
|
88
|
+
#base = self
|
89
|
+
deflambda = lambda do
|
90
|
+
|
91
|
+
define_method( key ) do
|
92
|
+
defined?(super) ? super.__send__(op,obj) : obj.dup
|
93
|
+
end
|
94
|
+
|
95
|
+
define_method( "#{key}!" ) do
|
96
|
+
if instance_variable_defined?("@#{key}")
|
97
|
+
instance_variable_get("@#{key}")
|
98
|
+
else
|
99
|
+
inheritor(key, obj.class.new, op)
|
100
|
+
end
|
101
|
+
#if instance_variables.include?("@#{key}")
|
102
|
+
# instance_variable_get("@#{key}")
|
103
|
+
#else
|
104
|
+
# if self != base
|
105
|
+
# inheritor( key, obj.class.new, op )
|
106
|
+
# end
|
107
|
+
#end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
# TODO This is an issue if you try to include a module
|
112
|
+
# into Module or Class itself. How to fix?
|
113
|
+
|
114
|
+
# if the object is a module (not a class or other object)
|
115
|
+
if self == Class or self == Module
|
116
|
+
class_eval(&deflambda)
|
117
|
+
elsif is_a?(Class)
|
118
|
+
(class << self; self; end).class_eval(&deflambda)
|
119
|
+
elsif is_a?(Module)
|
120
|
+
#class_inherit &deflambda
|
121
|
+
extend class_extension(&deflambda)
|
122
|
+
else # other Object
|
123
|
+
(class << self; self; end).class_eval(&deflambda)
|
124
|
+
end
|
125
|
+
|
126
|
+
obj
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
@@ -0,0 +1,264 @@
|
|
1
|
+
#
|
2
|
+
# ini.rb - read and write ini files
|
3
|
+
#
|
4
|
+
# Copyright (C) 2007 Jeena Paradies
|
5
|
+
# License: GPL
|
6
|
+
# Author: Jeena Paradies (info@jeenaparadies.net)
|
7
|
+
#
|
8
|
+
# == Overview
|
9
|
+
#
|
10
|
+
# This file provides a read-wite handling for ini files.
|
11
|
+
# The data of a ini file is represented by a object which
|
12
|
+
# is populated with strings.
|
13
|
+
|
14
|
+
class Ini
|
15
|
+
|
16
|
+
# Class with methods to read from and write into ini files.
|
17
|
+
#
|
18
|
+
# A ini file is a text file in a specific format,
|
19
|
+
# it may include several fields which are sparated by
|
20
|
+
# field headlines which are enclosured by "[]".
|
21
|
+
# Each field may include several key-value pairs.
|
22
|
+
#
|
23
|
+
# Each key-value pair is represented by one line and
|
24
|
+
# the value is sparated from the key by a "=".
|
25
|
+
#
|
26
|
+
# == Examples
|
27
|
+
#
|
28
|
+
# === Example ini file
|
29
|
+
#
|
30
|
+
# # this is the first comment which will be saved in the comment attribute
|
31
|
+
# mail=info@example.com
|
32
|
+
# domain=example.com # this is a comment which will not be saved
|
33
|
+
# [database]
|
34
|
+
# db=example
|
35
|
+
# user=john
|
36
|
+
# passwd=very-secure
|
37
|
+
# host=localhost
|
38
|
+
# # this is another comment
|
39
|
+
# [filepaths]
|
40
|
+
# tmp=/tmp/example
|
41
|
+
# lib=/home/john/projects/example/lib
|
42
|
+
# htdocs=/home/john/projects/example/htdocs
|
43
|
+
# [ texts ]
|
44
|
+
# wellcome=Wellcome on my new website!
|
45
|
+
# Website description = This is only a example. # and another comment
|
46
|
+
#
|
47
|
+
# === Example object
|
48
|
+
#
|
49
|
+
# A Ini#comment stores:
|
50
|
+
# "this is the first comment which will be saved in the comment attribute"
|
51
|
+
#
|
52
|
+
# A Ini object stores:
|
53
|
+
#
|
54
|
+
# {
|
55
|
+
# "mail" => "info@example.com",
|
56
|
+
# "domain" => "example.com",
|
57
|
+
# "database" => {
|
58
|
+
# "db" => "example",
|
59
|
+
# "user" => "john",
|
60
|
+
# "passwd" => "very-secure",
|
61
|
+
# "host" => "localhost"
|
62
|
+
# },
|
63
|
+
# "filepaths" => {
|
64
|
+
# "tmp" => "/tmp/example",
|
65
|
+
# "lib" => "/home/john/projects/example/lib",
|
66
|
+
# "htdocs" => "/home/john/projects/example/htdocs"
|
67
|
+
# }
|
68
|
+
# "texts" => {
|
69
|
+
# "wellcome" => "Wellcome on my new website!",
|
70
|
+
# "Website description" => "This is only a example."
|
71
|
+
# }
|
72
|
+
# }
|
73
|
+
#
|
74
|
+
# As you can see this module gets rid of all comments, linebreaks
|
75
|
+
# and unnecessary spaces at the beginning and the end of each
|
76
|
+
# field headline, key or value.
|
77
|
+
#
|
78
|
+
# === Using the object
|
79
|
+
#
|
80
|
+
# Using the object is stright forward:
|
81
|
+
#
|
82
|
+
# ini = Ini.new("path/settings.ini")
|
83
|
+
# ini["mail"] = "info@example.com"
|
84
|
+
# ini["filepaths"] = { "tmp" => "/tmp/example" }
|
85
|
+
# ini.comment = "This is\na comment"
|
86
|
+
# puts ini["filepaths"]["tmp"]
|
87
|
+
# # => /tmp/example
|
88
|
+
# ini.write()
|
89
|
+
#
|
90
|
+
|
91
|
+
#
|
92
|
+
# :inihash is a hash which holds all ini data
|
93
|
+
# :comment is a string which holds the comments on the top of the file
|
94
|
+
#
|
95
|
+
attr_accessor :inihash, :comment
|
96
|
+
|
97
|
+
#
|
98
|
+
# Creating a new Ini object
|
99
|
+
#
|
100
|
+
# +path+ is a path to the ini file
|
101
|
+
# +load+ if nil restores the data if possible
|
102
|
+
# if true restores the data, if not possible raises an error
|
103
|
+
# if false does not resotre the data
|
104
|
+
#
|
105
|
+
def initialize(path, load=nil)
|
106
|
+
@path = path
|
107
|
+
@inihash = {}
|
108
|
+
|
109
|
+
if load or ( load.nil? and FileTest.readable_real? @path )
|
110
|
+
restore()
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
#
|
115
|
+
# Retrive the ini data for the key +key+
|
116
|
+
#
|
117
|
+
def [](key)
|
118
|
+
@inihash[key]
|
119
|
+
end
|
120
|
+
|
121
|
+
#
|
122
|
+
# Set the ini data for the key +key+
|
123
|
+
#
|
124
|
+
def []=(key, value)
|
125
|
+
raise TypeError, "String expected" unless key.is_a? String
|
126
|
+
raise TypeError, "String or Hash expected" unless value.is_a? String or value.is_a? Hash
|
127
|
+
|
128
|
+
@inihash[key] = value
|
129
|
+
end
|
130
|
+
|
131
|
+
#
|
132
|
+
# Restores the data from file into the object
|
133
|
+
#
|
134
|
+
def restore()
|
135
|
+
@inihash = Ini.read_from_file(@path)
|
136
|
+
@comment = Ini.read_comment_from_file(@path)
|
137
|
+
end
|
138
|
+
|
139
|
+
#
|
140
|
+
# Store data from the object in the file
|
141
|
+
#
|
142
|
+
def update()
|
143
|
+
Ini.write_to_file(@path, @inihash, @comment)
|
144
|
+
end
|
145
|
+
|
146
|
+
#
|
147
|
+
# Reading data from file
|
148
|
+
#
|
149
|
+
# +path+ is a path to the ini file
|
150
|
+
#
|
151
|
+
# returns a hash which represents the data from the file
|
152
|
+
#
|
153
|
+
def Ini.read_from_file(path)
|
154
|
+
|
155
|
+
inihash = {}
|
156
|
+
headline = nil
|
157
|
+
|
158
|
+
IO.foreach(path) do |line|
|
159
|
+
|
160
|
+
line = line.strip.split(/#/)[0]
|
161
|
+
|
162
|
+
# read it only if the line doesn't begin with a "=" and is long enough
|
163
|
+
unless line.length < 2 and line[0,1] == "="
|
164
|
+
|
165
|
+
# it's a headline if the line begins with a "[" and ends with a "]"
|
166
|
+
if line[0,1] == "[" and line[line.length - 1, line.length] == "]"
|
167
|
+
|
168
|
+
# get rid of the [] and unnecessary spaces
|
169
|
+
headline = line[1, line.length - 2 ].strip
|
170
|
+
inihash[headline] = {}
|
171
|
+
else
|
172
|
+
|
173
|
+
key, value = line.split(/=/, 2)
|
174
|
+
|
175
|
+
key = key.strip unless key.nil?
|
176
|
+
value = value.strip unless value.nil?
|
177
|
+
|
178
|
+
unless headline.nil?
|
179
|
+
inihash[headline][key] = value
|
180
|
+
else
|
181
|
+
inihash[key] = value unless key.nil?
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
inihash
|
188
|
+
end
|
189
|
+
|
190
|
+
#
|
191
|
+
# Reading comments from file
|
192
|
+
#
|
193
|
+
# +path+ is a path to the ini file
|
194
|
+
#
|
195
|
+
# Returns a string with comments from the beginning of the
|
196
|
+
# ini file.
|
197
|
+
#
|
198
|
+
def Ini.read_comment_from_file(path)
|
199
|
+
comment = ""
|
200
|
+
|
201
|
+
IO.foreach(path) do |line|
|
202
|
+
line.strip!
|
203
|
+
break unless line[0,1] == "#" or line == ""
|
204
|
+
|
205
|
+
comment << "#{line[1, line.length ].strip}\n"
|
206
|
+
end
|
207
|
+
|
208
|
+
comment
|
209
|
+
end
|
210
|
+
|
211
|
+
#
|
212
|
+
# Writing a ini hash into a file
|
213
|
+
#
|
214
|
+
# +path+ is a path to the ini file
|
215
|
+
# +inihash+ is a hash representing the ini File. Default is a empty hash.
|
216
|
+
# +comment+ is a string with comments which appear on the
|
217
|
+
# top of the file. Each line will get a "#" before.
|
218
|
+
# Default is no comment.
|
219
|
+
#
|
220
|
+
def Ini.write_to_file(path, inihash={}, comment=nil)
|
221
|
+
raise TypeError, "String expected" unless comment.is_a? String or comment.nil?
|
222
|
+
|
223
|
+
raise TypeError, "Hash expected" unless inihash.is_a? Hash
|
224
|
+
File.open(path, "w") { |file|
|
225
|
+
|
226
|
+
unless comment.nil?
|
227
|
+
comment.each do |line|
|
228
|
+
file << "# #{line}"
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
file << Ini.to_s(inihash)
|
233
|
+
}
|
234
|
+
end
|
235
|
+
|
236
|
+
#
|
237
|
+
# Turn a hash (up to 2 levels deepness) into a ini string
|
238
|
+
#
|
239
|
+
# +inihash+ is a hash representing the ini File. Default is a empty hash.
|
240
|
+
#
|
241
|
+
# Returns a string in the ini file format.
|
242
|
+
#
|
243
|
+
def Ini.to_s(inihash={})
|
244
|
+
str = ""
|
245
|
+
|
246
|
+
inihash.each do |key, value|
|
247
|
+
|
248
|
+
if value.is_a? Hash
|
249
|
+
str << "[#{key.to_s}]\n"
|
250
|
+
|
251
|
+
value.each do |under_key, under_value|
|
252
|
+
str << "#{under_key.to_s}=#{under_value.to_s unless under_value.nil?}\n"
|
253
|
+
end
|
254
|
+
|
255
|
+
else
|
256
|
+
str << "#{key.to_s}=#{value.to_s unless value2.nil?}\n"
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
str
|
261
|
+
end
|
262
|
+
|
263
|
+
end
|
264
|
+
|