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,172 @@
|
|
1
|
+
# = Pathname
|
2
|
+
#
|
3
|
+
# Ruby's standard Pathname class with extensions.
|
4
|
+
#
|
5
|
+
# == Authors:
|
6
|
+
#
|
7
|
+
# * Daniel Burger
|
8
|
+
# * Thomas Sawyer
|
9
|
+
#
|
10
|
+
# == Copying
|
11
|
+
#
|
12
|
+
# Copyright (c) 2006 Thomas Sawyer, Daniel Burger
|
13
|
+
#
|
14
|
+
# Ruby License
|
15
|
+
#
|
16
|
+
# This module is free software. You may use, modify, and/or redistribute this
|
17
|
+
# software under the same terms as Ruby.
|
18
|
+
#
|
19
|
+
# This program is distributed in the hope that it will be useful, but WITHOUT
|
20
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
21
|
+
# FOR A PARTICULAR PURPOSE.
|
22
|
+
|
23
|
+
require 'pathname'
|
24
|
+
require 'facets/file/rootname'
|
25
|
+
|
26
|
+
class Pathname
|
27
|
+
|
28
|
+
# Alternate to Pathname#new.
|
29
|
+
#
|
30
|
+
# Pathname['/usr/share']
|
31
|
+
#
|
32
|
+
def self.[](path)
|
33
|
+
new(path)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Active path separator.
|
37
|
+
#
|
38
|
+
# p1 = Pathname.new('/')
|
39
|
+
# p2 = p1 / 'usr' / 'share' #=> Pathname:/usr/share
|
40
|
+
#
|
41
|
+
def self./(path)
|
42
|
+
new(path)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Root constant for building paths from root directory onward.
|
46
|
+
def self.root
|
47
|
+
Pathname.new('/')
|
48
|
+
end
|
49
|
+
|
50
|
+
# Home constant for building paths from root directory onward.
|
51
|
+
#
|
52
|
+
# TODO: Pathname#home needs to be more robust.
|
53
|
+
#
|
54
|
+
def self.home
|
55
|
+
Pathname.new('~')
|
56
|
+
end
|
57
|
+
|
58
|
+
# Work constant for building paths from root directory onward.
|
59
|
+
#
|
60
|
+
def self.work
|
61
|
+
Pathname.new('.')
|
62
|
+
end
|
63
|
+
|
64
|
+
# Try to get this into standard Pathname class.
|
65
|
+
alias_method :/, :+
|
66
|
+
|
67
|
+
# CREDIT Daniel Burger
|
68
|
+
|
69
|
+
# Platform dependent null device.
|
70
|
+
#
|
71
|
+
def self.null
|
72
|
+
case RUBY_PLATFORM
|
73
|
+
when /mswin/i
|
74
|
+
'NUL'
|
75
|
+
when /amiga/i
|
76
|
+
'NIL:'
|
77
|
+
when /openvms/i
|
78
|
+
'NL:'
|
79
|
+
else
|
80
|
+
'/dev/null'
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
#
|
85
|
+
def rootname
|
86
|
+
self.class.new(File.rootname(to_s))
|
87
|
+
end
|
88
|
+
|
89
|
+
# # Already included in 1.8.4+ version of Ruby (except for inclusion flag)
|
90
|
+
# if not instance_methods.include?(:ascend)
|
91
|
+
#
|
92
|
+
# # Calls the _block_ for every successive parent directory of the
|
93
|
+
# # directory path until the root (absolute path) or +.+ (relative path)
|
94
|
+
# # is reached.
|
95
|
+
# def ascend(inclusive=false,&block) # :yield:
|
96
|
+
# cur_dir = self
|
97
|
+
# yield( cur_dir.cleanpath ) if inclusive
|
98
|
+
# until cur_dir.root? or cur_dir == Pathname.new(".")
|
99
|
+
# cur_dir = cur_dir.parent
|
100
|
+
# yield cur_dir
|
101
|
+
# end
|
102
|
+
# end
|
103
|
+
#
|
104
|
+
# end
|
105
|
+
#
|
106
|
+
# # Already included in 1.8.4+ version of Ruby
|
107
|
+
# if ! instance_methods.include?(:descend)
|
108
|
+
#
|
109
|
+
# # Calls the _block_ for every successive subdirectory of the
|
110
|
+
# # directory path from the root (absolute path) until +.+
|
111
|
+
# # (relative path) is reached.
|
112
|
+
# def descend()
|
113
|
+
# @path.scan(%r{[^/]*/?})[0...-1].inject('') do |path, dir|
|
114
|
+
# yield Pathname.new(path << dir)
|
115
|
+
# path
|
116
|
+
# end
|
117
|
+
# end
|
118
|
+
#
|
119
|
+
# end
|
120
|
+
|
121
|
+
#
|
122
|
+
def split_root
|
123
|
+
head, tail = *::File.split_root(to_s)
|
124
|
+
[self.class.new(head), self.class.new(tail)]
|
125
|
+
end
|
126
|
+
|
127
|
+
#
|
128
|
+
def glob(match, *opts)
|
129
|
+
flags = 0
|
130
|
+
opts.each do |opt|
|
131
|
+
case opt when Symbol, String
|
132
|
+
flags += File.const_get("FNM_#{opt}".upcase)
|
133
|
+
else
|
134
|
+
flags += opt
|
135
|
+
end
|
136
|
+
end
|
137
|
+
Dir.glob(::File.join(self.to_s, match), flags).collect{ |m| self.class.new(m) }
|
138
|
+
end
|
139
|
+
|
140
|
+
#
|
141
|
+
def glob_first(match, *opts)
|
142
|
+
flags = 0
|
143
|
+
opts.each do |opt|
|
144
|
+
case opt when Symbol, String
|
145
|
+
flags += ::File.const_get("FNM_#{opt}".upcase)
|
146
|
+
else
|
147
|
+
flags += opt
|
148
|
+
end
|
149
|
+
end
|
150
|
+
file = ::Dir.glob(::File.join(self.to_s, match), flags).first
|
151
|
+
file ? self.class.new(file) : nil
|
152
|
+
end
|
153
|
+
|
154
|
+
#
|
155
|
+
def empty?
|
156
|
+
Dir.glob(::File.join(self.to_s, '*')).empty?
|
157
|
+
end
|
158
|
+
|
159
|
+
end
|
160
|
+
|
161
|
+
# Constant alias of Pathname (short is better!)
|
162
|
+
Path = Pathname
|
163
|
+
|
164
|
+
class NilClass
|
165
|
+
# Provide platform dependent null path.
|
166
|
+
#
|
167
|
+
# CREDIT Daniel Burger
|
168
|
+
def to_path
|
169
|
+
Pathname.null
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# = Ruby Configuration Extensions
|
2
|
+
#
|
3
|
+
# An extended rendition of the Ruby's standard Config module.
|
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
|
+
require 'rbconfig'
|
23
|
+
|
24
|
+
module Config
|
25
|
+
|
26
|
+
def self.inspect
|
27
|
+
CONFIG.inspect
|
28
|
+
end
|
29
|
+
|
30
|
+
# In case rubygems has already defined it.
|
31
|
+
unless self.respond_to?(:datadir)
|
32
|
+
# Return the path to the data directory associated with the
|
33
|
+
# given library/package name. Normally this is just
|
34
|
+
#
|
35
|
+
# "#{Config::CONFIG['datadir']}/#{name}"
|
36
|
+
#
|
37
|
+
# but may be modified by tools like RubyGems to handle
|
38
|
+
# versioned data directories.
|
39
|
+
|
40
|
+
def self.datadir(package_name)
|
41
|
+
File.join(CONFIG['datadir'], package_name)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'set'
|
2
|
+
|
3
|
+
class Set
|
4
|
+
def power_set
|
5
|
+
if empty?
|
6
|
+
Set[ self ]
|
7
|
+
else
|
8
|
+
any_value = [to_a.first]
|
9
|
+
subsubs = (self - any_value).power_set
|
10
|
+
subsubs + subsubs.map{ |subset| subset + any_value }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Array
|
16
|
+
def power_set
|
17
|
+
if empty?
|
18
|
+
[self]
|
19
|
+
else
|
20
|
+
subset = dup
|
21
|
+
value = [ subset.pop ]
|
22
|
+
subsubs = subset.power_set
|
23
|
+
subsubs.concat( subsubs.map{ |subset| subset + value } )
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# = Shellwords Extended
|
2
|
+
#
|
3
|
+
# Adds extensions to Shellwords, namely #escape.
|
4
|
+
#
|
5
|
+
# == Authors
|
6
|
+
#
|
7
|
+
# * Thomas Sawuer
|
8
|
+
#
|
9
|
+
# == Copying
|
10
|
+
#
|
11
|
+
# Copyright (c) 2007 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
|
+
require 'shellwords'
|
23
|
+
|
24
|
+
module Shellwords
|
25
|
+
|
26
|
+
module_function
|
27
|
+
|
28
|
+
# Escape special characters used in most
|
29
|
+
# unix shells to use it, eg. with system().
|
30
|
+
|
31
|
+
def escape(cmdline)
|
32
|
+
cmdline.gsub(/([\\\t\| &`<>)('"])/) { |s| '\\' << s }
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
class Array
|
39
|
+
|
40
|
+
# Convert an array into command line parameters.
|
41
|
+
# The array is accepted in the format of Ruby
|
42
|
+
# method arguments --ie. [arg1, arg2, ..., hash]
|
43
|
+
|
44
|
+
def to_shellwords
|
45
|
+
flags = (Hash===last ? pop : {})
|
46
|
+
flags = flags.to_shellwords
|
47
|
+
flags + ' ' + self #join(" ")
|
48
|
+
end
|
49
|
+
|
50
|
+
def to_shell
|
51
|
+
to_shellwords.join(' ')
|
52
|
+
end
|
53
|
+
|
54
|
+
# Original name.
|
55
|
+
alias_method :to_console, :to_shell
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
class Hash
|
60
|
+
|
61
|
+
# Convert an array into command line parameters.
|
62
|
+
# The array is accepted in the format of Ruby
|
63
|
+
# method arguments --ie. [arg1, arg2, ..., hash]
|
64
|
+
|
65
|
+
def to_shellwords
|
66
|
+
flags = collect do |f,v|
|
67
|
+
m = f.to_s.size == 1 ? '-' : '--'
|
68
|
+
case v
|
69
|
+
when Array
|
70
|
+
v.collect{ |e| "#{m}#{f}='#{e}'" }.join(' ')
|
71
|
+
when true
|
72
|
+
"#{m}#{f}"
|
73
|
+
when false, nil
|
74
|
+
''
|
75
|
+
else
|
76
|
+
"#{m}#{f}='#{v}'"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
flags #.join(" ")
|
80
|
+
end
|
81
|
+
|
82
|
+
def to_shell
|
83
|
+
to_shellwords.join(' ')
|
84
|
+
end
|
85
|
+
|
86
|
+
# Original name.
|
87
|
+
alias_method :to_console, :to_shell
|
88
|
+
end
|
89
|
+
|
@@ -0,0 +1,249 @@
|
|
1
|
+
# = URI Extensions
|
2
|
+
#
|
3
|
+
# Convenience extensions to URI module.
|
4
|
+
#
|
5
|
+
# == Authors
|
6
|
+
#
|
7
|
+
# * Thomas Sawyer (7rans)
|
8
|
+
#
|
9
|
+
# == Copyright
|
10
|
+
#
|
11
|
+
# Copyright (c) 2005 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
|
+
require 'uri'
|
23
|
+
#require 'cgi'
|
24
|
+
|
25
|
+
require 'facets/blank'
|
26
|
+
|
27
|
+
module URI
|
28
|
+
|
29
|
+
module_function
|
30
|
+
|
31
|
+
# Decode the uri components.
|
32
|
+
|
33
|
+
def decode(uri)
|
34
|
+
# gmosx: hmm is this needed?
|
35
|
+
# guard against invalid filenames for example pictures with
|
36
|
+
# spaces uploaded by users
|
37
|
+
escaped_uri = uri.gsub(/ /, "+")
|
38
|
+
|
39
|
+
if md = URI::REGEXP::REL_URI.match(escaped_uri)
|
40
|
+
|
41
|
+
path = "#{md[5]}#{md[6]}"
|
42
|
+
type = File.extname(path)
|
43
|
+
query_string = md[7]
|
44
|
+
|
45
|
+
# real_path = "#{$root_dir}/#{path}"
|
46
|
+
|
47
|
+
parameters = URI.query_to_hash(query_string)
|
48
|
+
path.gsub!(/\+/, " ")
|
49
|
+
|
50
|
+
return [path, type, parameters, query_string]
|
51
|
+
|
52
|
+
end # match
|
53
|
+
|
54
|
+
# this is usefull for uncovering bugs!
|
55
|
+
raise ArgumentError.new("the parameter '#{uri}' is not a valid uri")
|
56
|
+
end
|
57
|
+
|
58
|
+
# Extend the basic query string parser provided by the cgi module.
|
59
|
+
# converts single valued params (the most common case) to
|
60
|
+
# objects instead of arrays
|
61
|
+
#
|
62
|
+
# Input:
|
63
|
+
# the query string
|
64
|
+
#
|
65
|
+
# Output:
|
66
|
+
# hash of parameters, contains arrays for multivalued parameters
|
67
|
+
# (multiselect, checkboxes , etc)
|
68
|
+
# If no query string is provided (nil or "") returns an empty hash.
|
69
|
+
|
70
|
+
def query_to_hash(query_string)
|
71
|
+
return {} unless query_string
|
72
|
+
|
73
|
+
query_parameters = cgi_parse(query_string)
|
74
|
+
|
75
|
+
query_parameters.each { |key, val|
|
76
|
+
# replace the array with an object
|
77
|
+
query_parameters[key] = val[0] if 1 == val.length
|
78
|
+
}
|
79
|
+
|
80
|
+
# set default value to nil! cgi sets this to []
|
81
|
+
query_parameters.default = nil
|
82
|
+
|
83
|
+
return query_parameters
|
84
|
+
end
|
85
|
+
|
86
|
+
alias_method :query_string_to_hash, :query_to_hash
|
87
|
+
|
88
|
+
# Given a hash with parameter/value pairs construct a
|
89
|
+
# standard query string.
|
90
|
+
#
|
91
|
+
# URI.hash_to_query(:a => 1, :b => 2)
|
92
|
+
# => "a=1&b=2"
|
93
|
+
|
94
|
+
def hash_to_query(parameters)
|
95
|
+
return '' unless parameters
|
96
|
+
pairs = []
|
97
|
+
parameters.each do |param, value|
|
98
|
+
pairs << "#{param}=#{cgi_escape(value.to_s)}"
|
99
|
+
end
|
100
|
+
#return pairs.join('&')
|
101
|
+
return pairs.join(";")
|
102
|
+
end
|
103
|
+
|
104
|
+
alias_method :hash_to_query_string, :hash_to_query
|
105
|
+
|
106
|
+
#
|
107
|
+
# TODO: How does this compare to URI.escape?
|
108
|
+
|
109
|
+
def cgi_escape(string)
|
110
|
+
string.gsub(/([^ a-zA-Z0-9_.-]+)/n) do
|
111
|
+
'%' + $1.unpack('H2' * $1.size).join('%').upcase
|
112
|
+
end.tr(' ', '+')
|
113
|
+
end
|
114
|
+
|
115
|
+
#
|
116
|
+
|
117
|
+
def cgi_unescape(string)
|
118
|
+
string.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n) do
|
119
|
+
[$1.delete('%')].pack('H*')
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
#
|
124
|
+
|
125
|
+
def cgi_parse(query)
|
126
|
+
params = Hash.new([].freeze)
|
127
|
+
|
128
|
+
query.split(/[&;]/n).each do |pairs|
|
129
|
+
key, value = pairs.split('=',2).collect{|v| cgi_unescape(v) }
|
130
|
+
if params.has_key?(key)
|
131
|
+
params[key].push(value)
|
132
|
+
else
|
133
|
+
params[key] = [value]
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
params
|
138
|
+
end
|
139
|
+
|
140
|
+
# This method returns the query string of a uri
|
141
|
+
#
|
142
|
+
# Input:
|
143
|
+
# the uri
|
144
|
+
#
|
145
|
+
# Output:
|
146
|
+
# the query string.
|
147
|
+
# returns nil if no query string
|
148
|
+
|
149
|
+
def get_query_string(uri)
|
150
|
+
return nil unless uri
|
151
|
+
# gmosx: INVESTIGATE ruby's URI seems to differently handle
|
152
|
+
# abs and rel uris.
|
153
|
+
if md = URI::REGEXP::ABS_URI.match(uri)
|
154
|
+
return md[8]
|
155
|
+
elsif md = URI::REGEXP::REL_URI.match(uri)
|
156
|
+
return md[7]
|
157
|
+
end
|
158
|
+
return nil
|
159
|
+
end
|
160
|
+
|
161
|
+
# Removes the query string from a uri
|
162
|
+
#
|
163
|
+
# Input:
|
164
|
+
# the uri
|
165
|
+
#
|
166
|
+
# Output:
|
167
|
+
# the chomped uri.
|
168
|
+
|
169
|
+
def chomp_query_string(uri)
|
170
|
+
return nil unless uri
|
171
|
+
query_string = self.get_query_string(uri)
|
172
|
+
return uri.dup.chomp("?#{query_string}")
|
173
|
+
end
|
174
|
+
|
175
|
+
# Get a uri and a hash of parameters. Inject the hash values
|
176
|
+
# as parameters in the query sting path. Returns the full
|
177
|
+
# uri.
|
178
|
+
#
|
179
|
+
# Input:
|
180
|
+
# the uri to filter (String)
|
181
|
+
# hash of parameters to update
|
182
|
+
#
|
183
|
+
# Output:
|
184
|
+
# the full updated query string
|
185
|
+
#
|
186
|
+
# TODO: optimize
|
187
|
+
|
188
|
+
def update_query_string(uri, parameters)
|
189
|
+
query_string = self.get_query_string(uri)
|
190
|
+
rest = uri.dup.gsub(/\?#{query_string}/, "")
|
191
|
+
|
192
|
+
hash = self.query_string_to_hash(query_string)
|
193
|
+
hash.update(parameters)
|
194
|
+
query_string = self.hash_to_query_string(hash)
|
195
|
+
|
196
|
+
unless query_string.blank?
|
197
|
+
return "#{rest}?#{query_string}"
|
198
|
+
else
|
199
|
+
return rest
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
# TODO: find a better name.
|
204
|
+
# Gets the request uri, injects extra parameters in the query string
|
205
|
+
# and returns a new uri. The request object is not modified.
|
206
|
+
# There is always a qs string so an extra test is skipped.
|
207
|
+
|
208
|
+
def update_request_uri(request, parameters)
|
209
|
+
hash = request.parameters.dup()
|
210
|
+
hash.update(parameters)
|
211
|
+
|
212
|
+
# use this in hash_to_querystring.
|
213
|
+
query_string = hash.collect { |k, v|
|
214
|
+
"#{k}=#{v}"
|
215
|
+
}.join(";")
|
216
|
+
|
217
|
+
#return "#{request.translated_uri}?#{query_string}"
|
218
|
+
return "#{request.path}?#{query_string}"
|
219
|
+
end
|
220
|
+
|
221
|
+
module Kernel
|
222
|
+
#
|
223
|
+
def uri(s, w=%r{[^a-zA-Z_0-9./-]})
|
224
|
+
URI.escape(s, w)
|
225
|
+
end
|
226
|
+
|
227
|
+
#
|
228
|
+
def unuri(s)
|
229
|
+
URI.unescape(s)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
module Hash
|
234
|
+
#
|
235
|
+
def to_uri
|
236
|
+
URI.hash_to_query(self)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
241
|
+
|
242
|
+
class Object #:nodoc:
|
243
|
+
include URI::Kernel
|
244
|
+
end
|
245
|
+
|
246
|
+
class Hash #:nodoc:
|
247
|
+
include URI::Hash
|
248
|
+
end
|
249
|
+
|