facets 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ProjectInfo +22 -34
- metadata +37 -895
- data/CHANGELOG +0 -254
- data/Rakefile +0 -173
- data/TODO +0 -46
- data/conf/facets/noauto +0 -48
- data/data/facets/index.yml +0 -446
- data/lib/facet/array.rb +0 -33
- data/lib/facet/array/at_rand.rb +0 -52
- data/lib/facet/array/body.rb +0 -2
- data/lib/facet/array/delete_unless.rb +0 -35
- data/lib/facet/array/delete_values.rb +0 -38
- data/lib/facet/array/delete_values_at.rb +0 -57
- data/lib/facet/array/each_with_key.rb +0 -9
- data/lib/facet/array/first.rb +0 -84
- data/lib/facet/array/foot.rb +0 -2
- data/lib/facet/array/head.rb +0 -80
- data/lib/facet/array/last.rb +0 -2
- data/lib/facet/array/last_index.rb +0 -35
- data/lib/facet/array/merge.rb +0 -40
- data/lib/facet/array/mid.rb +0 -50
- data/lib/facet/array/middle.rb +0 -45
- data/lib/facet/array/op_fetch.rb +0 -40
- data/lib/facet/array/op_store.rb +0 -47
- data/lib/facet/array/pick.rb +0 -68
- data/lib/facet/array/pos.rb +0 -39
- data/lib/facet/array/pull.rb +0 -37
- data/lib/facet/array/rand_index.rb +0 -30
- data/lib/facet/array/rand_subset.rb +0 -56
- data/lib/facet/array/range.rb +0 -47
- data/lib/facet/array/rotate.rb +0 -67
- data/lib/facet/array/select.rb +0 -37
- data/lib/facet/array/shuffle.rb +0 -66
- data/lib/facet/array/slap.rb +0 -37
- data/lib/facet/array/store.rb +0 -7
- data/lib/facet/array/tail.rb +0 -2
- data/lib/facet/array/thru.rb +0 -38
- data/lib/facet/array/to_b.rb +0 -31
- data/lib/facet/array/to_h.rb +0 -57
- data/lib/facet/array/to_hash.rb +0 -46
- data/lib/facet/array/unzip.rb +0 -20
- data/lib/facet/binding.rb +0 -14
- data/lib/facet/binding/__DIR__.rb +0 -2
- data/lib/facet/binding/__FILE__.rb +0 -2
- data/lib/facet/binding/__LINE__.rb +0 -58
- data/lib/facet/binding/call_stack.rb +0 -42
- data/lib/facet/binding/called.rb +0 -41
- data/lib/facet/binding/caller.rb +0 -42
- data/lib/facet/binding/defined.rb +0 -41
- data/lib/facet/binding/eval.rb +0 -42
- data/lib/facet/binding/local_variables.rb +0 -45
- data/lib/facet/binding/method_name.rb +0 -48
- data/lib/facet/binding/op_fetch.rb +0 -45
- data/lib/facet/binding/op_store.rb +0 -46
- data/lib/facet/binding/self.rb +0 -41
- data/lib/facet/binding/self/of_caller.rb +0 -122
- data/lib/facet/class.rb +0 -5
- data/lib/facet/class/by_name.rb +0 -1
- data/lib/facet/class/descendents.rb +0 -44
- data/lib/facet/class/remove_descendents.rb +0 -46
- data/lib/facet/class/remove_subclasses.rb +0 -2
- data/lib/facet/class/subclasses.rb +0 -2
- data/lib/facet/comparable.rb +0 -5
- data/lib/facet/comparable/at_least.rb +0 -53
- data/lib/facet/comparable/at_most.rb +0 -2
- data/lib/facet/comparable/cap.rb +0 -2
- data/lib/facet/comparable/clip.rb +0 -72
- data/lib/facet/comparable/cmp.rb +0 -38
- data/lib/facet/continuation.rb +0 -1
- data/lib/facet/continuation/self/create.rb +0 -71
- data/lib/facet/date.rb +0 -0
- data/lib/facet/date/days_in_month.rb +0 -42
- data/lib/facet/date/days_of_month.rb +0 -34
- data/lib/facet/date/stamp.rb +0 -52
- data/lib/facet/date/to_date.rb +0 -36
- data/lib/facet/date/to_s.rb +0 -33
- data/lib/facet/date/to_time.rb +0 -36
- data/lib/facet/dir.rb +0 -4
- data/lib/facet/dir/self/ancestor.rb +0 -33
- data/lib/facet/dir/self/ascend.rb +0 -56
- data/lib/facet/dir/self/ls_r.rb +0 -76
- data/lib/facet/dir/self/recurse.rb +0 -2
- data/lib/facet/enumerable.rb +0 -38
- data/lib/facet/enumerable/collect_with_counter.rb +0 -2
- data/lib/facet/enumerable/collect_with_index.rb +0 -51
- data/lib/facet/enumerable/commonality.rb +0 -63
- data/lib/facet/enumerable/compact_collect.rb +0 -50
- data/lib/facet/enumerable/compact_map.rb +0 -2
- data/lib/facet/enumerable/cross.rb +0 -44
- data/lib/facet/enumerable/each_by.rb +0 -2
- data/lib/facet/enumerable/each_combination.rb +0 -59
- data/lib/facet/enumerable/each_pair.rb +0 -50
- data/lib/facet/enumerable/each_permutation.rb +0 -2
- data/lib/facet/enumerable/each_slice.rb +0 -131
- data/lib/facet/enumerable/each_unique_pair.rb +0 -66
- data/lib/facet/enumerable/each_with_counter.rb +0 -8
- data/lib/facet/enumerable/elementwise.rb +0 -2
- data/lib/facet/enumerable/entropy.rb +0 -52
- data/lib/facet/enumerable/every.rb +0 -65
- data/lib/facet/enumerable/ew.rb +0 -64
- data/lib/facet/enumerable/filter_collect.rb +0 -58
- data/lib/facet/enumerable/filter_map.rb +0 -2
- data/lib/facet/enumerable/find_collisions.rb +0 -41
- data/lib/facet/enumerable/frequency.rb +0 -39
- data/lib/facet/enumerable/graph.rb +0 -59
- data/lib/facet/enumerable/ideal_entropy.rb +0 -49
- data/lib/facet/enumerable/map_with_counter.rb +0 -2
- data/lib/facet/enumerable/map_with_index.rb +0 -2
- data/lib/facet/enumerable/none.rb +0 -56
- data/lib/facet/enumerable/nonuniq.rb +0 -39
- data/lib/facet/enumerable/occur.rb +0 -62
- data/lib/facet/enumerable/one.rb +0 -65
- data/lib/facet/enumerable/op_pow.rb +0 -38
- data/lib/facet/enumerable/partition_by.rb +0 -55
- data/lib/facet/enumerable/permute.rb +0 -135
- data/lib/facet/enumerable/probability.rb +0 -59
- data/lib/facet/enumerable/project.rb +0 -11
- data/lib/facet/enumerable/self/combinations.rb +0 -68
- data/lib/facet/enumerable/self/cross.rb +0 -79
- data/lib/facet/enumerable/to_h.rb +0 -50
- data/lib/facet/enumerable/uniq_by.rb +0 -39
- data/lib/facet/enumerable/where.rb +0 -12
- data/lib/facet/file.rb +0 -5
- data/lib/facet/file/self/create.rb +0 -52
- data/lib/facet/file/self/open_as_string.rb +0 -81
- data/lib/facet/file/self/read_list.rb +0 -47
- data/lib/facet/file/self/sanitize.rb +0 -50
- data/lib/facet/file/self/split_all.rb +0 -36
- data/lib/facet/fileutils.rb +0 -0
- data/lib/facet/fileutils/head.rb +0 -2
- data/lib/facet/fileutils/safe_ln.rb +0 -38
- data/lib/facet/fileutils/slice.rb +0 -152
- data/lib/facet/fileutils/split_all.rb +0 -29
- data/lib/facet/fileutils/tail.rb +0 -2
- data/lib/facet/fileutils/wc.rb +0 -128
- data/lib/facet/fileutils/whereis.rb +0 -76
- data/lib/facet/fileutils/which.rb +0 -117
- data/lib/facet/float.rb +0 -3
- data/lib/facet/float/approx.rb +0 -42
- data/lib/facet/float/round_at.rb +0 -72
- data/lib/facet/float/round_to.rb +0 -73
- data/lib/facet/hash.rb +0 -40
- data/lib/facet/hash/alias.rb +0 -54
- data/lib/facet/hash/assert_has_keys.rb +0 -38
- data/lib/facet/hash/assert_has_only_keys.rb +0 -38
- data/lib/facet/hash/at.rb +0 -26
- data/lib/facet/hash/collate.rb +0 -53
- data/lib/facet/hash/delete_unless.rb +0 -15
- data/lib/facet/hash/each.rb +0 -61
- data/lib/facet/hash/each_with_index.rb +0 -35
- data/lib/facet/hash/each_with_key.rb +0 -32
- data/lib/facet/hash/graph.rb +0 -31
- data/lib/facet/hash/has_keys.rb +0 -37
- data/lib/facet/hash/has_only_keys.rb +0 -37
- data/lib/facet/hash/inverse.rb +0 -51
- data/lib/facet/hash/join.rb +0 -19
- data/lib/facet/hash/keys_to_iv.rb +0 -60
- data/lib/facet/hash/keys_to_s.rb +0 -80
- data/lib/facet/hash/keys_to_sym.rb +0 -91
- data/lib/facet/hash/op_fetch.rb +0 -146
- data/lib/facet/hash/op_lshift.rb +0 -28
- data/lib/facet/hash/op_store.rb +0 -2
- data/lib/facet/hash/rand_key.rb +0 -47
- data/lib/facet/hash/rand_pair.rb +0 -50
- data/lib/facet/hash/rand_value.rb +0 -60
- data/lib/facet/hash/replace_each.rb +0 -33
- data/lib/facet/hash/self/zipnew.rb +0 -37
- data/lib/facet/hash/shuffle.rb +0 -53
- data/lib/facet/hash/slice.rb +0 -33
- data/lib/facet/hash/stringify_keys.rb +0 -2
- data/lib/facet/hash/swap.rb +0 -36
- data/lib/facet/hash/swapkey.rb +0 -44
- data/lib/facet/hash/symoblize_keys.rb +0 -2
- data/lib/facet/hash/to_h.rb +0 -35
- data/lib/facet/hash/to_ostruct.rb +0 -40
- data/lib/facet/hash/to_ostruct_recurse.rb +0 -45
- data/lib/facet/hash/traverse.rb +0 -63
- data/lib/facet/hash/update_each.rb +0 -43
- data/lib/facet/hash/update_keys.rb +0 -31
- data/lib/facet/hash/update_values.rb +0 -32
- data/lib/facet/hash/variablize_keys.rb +0 -2
- data/lib/facet/hash/weave.rb +0 -88
- data/lib/facet/integer.rb +0 -8
- data/lib/facet/integer/even.rb +0 -2
- data/lib/facet/integer/fac.rb +0 -2
- data/lib/facet/integer/fact.rb +0 -2
- data/lib/facet/integer/factorial.rb +0 -61
- data/lib/facet/integer/multiple.rb +0 -69
- data/lib/facet/integer/odd.rb +0 -2
- data/lib/facet/integer/ordinal.rb +0 -41
- data/lib/facet/integer/times_collect.rb +0 -39
- data/lib/facet/integer/times_map.rb +0 -2
- data/lib/facet/kernel.rb +0 -65
- data/lib/facet/kernel/__DIR__.rb +0 -11
- data/lib/facet/kernel/__class__.rb +0 -31
- data/lib/facet/kernel/__meta__.rb +0 -28
- data/lib/facet/kernel/adhoc.rb +0 -11
- data/lib/facet/kernel/as.rb +0 -91
- data/lib/facet/kernel/assign_from.rb +0 -82
- data/lib/facet/kernel/assign_with.rb +0 -75
- data/lib/facet/kernel/autoreload.rb +0 -46
- data/lib/facet/kernel/autoreload_glob.rb +0 -36
- data/lib/facet/kernel/bool.rb +0 -77
- data/lib/facet/kernel/bug.rb +0 -39
- data/lib/facet/kernel/call_stack.rb +0 -59
- data/lib/facet/kernel/called.rb +0 -40
- data/lib/facet/kernel/complete.rb +0 -6
- data/lib/facet/kernel/constant.rb +0 -52
- data/lib/facet/kernel/copy.rb +0 -48
- data/lib/facet/kernel/deep_copy.rb +0 -49
- data/lib/facet/kernel/demo.rb +0 -46
- data/lib/facet/kernel/eigenclass.rb +0 -17
- data/lib/facet/kernel/false.rb +0 -2
- data/lib/facet/kernel/fn.rb +0 -33
- data/lib/facet/kernel/generate_method_name.rb +0 -39
- data/lib/facet/kernel/get_by_id.rb +0 -33
- data/lib/facet/kernel/here.rb +0 -34
- data/lib/facet/kernel/in.rb +0 -35
- data/lib/facet/kernel/instance_assign.rb +0 -25
- data/lib/facet/kernel/instvar.rb +0 -13
- data/lib/facet/kernel/is.rb +0 -5
- data/lib/facet/kernel/maybe.rb +0 -41
- data/lib/facet/kernel/me.rb +0 -17
- data/lib/facet/kernel/meta.rb +0 -2
- data/lib/facet/kernel/metaclass.rb +0 -42
- data/lib/facet/kernel/method.rb +0 -76
- data/lib/facet/kernel/method_name.rb +0 -49
- data/lib/facet/kernel/methods.rb +0 -79
- data/lib/facet/kernel/nack.rb +0 -12
- data/lib/facet/kernel/new.rb +0 -40
- data/lib/facet/kernel/object_class.rb +0 -31
- data/lib/facet/kernel/object_hexid.rb +0 -35
- data/lib/facet/kernel/op_esc.rb +0 -37
- data/lib/facet/kernel/own.rb +0 -17
- data/lib/facet/kernel/p.rb +0 -12
- data/lib/facet/kernel/require_all.rb +0 -44
- data/lib/facet/kernel/require_esc.rb +0 -42
- data/lib/facet/kernel/require_facet.rb +0 -41
- data/lib/facet/kernel/require_local.rb +0 -25
- data/lib/facet/kernel/resc.rb +0 -32
- data/lib/facet/kernel/returning.rb +0 -49
- data/lib/facet/kernel/send_as.rb +0 -34
- data/lib/facet/kernel/set_from.rb +0 -69
- data/lib/facet/kernel/set_with.rb +0 -74
- data/lib/facet/kernel/silence_warnings.rb +0 -2
- data/lib/facet/kernel/silently.rb +0 -41
- data/lib/facet/kernel/singleton.rb +0 -47
- data/lib/facet/kernel/superior.rb +0 -53
- data/lib/facet/kernel/supermethod.rb +0 -44
- data/lib/facet/kernel/this.rb +0 -33
- data/lib/facet/kernel/to_b.rb +0 -41
- data/lib/facet/kernel/to_bool.rb +0 -47
- data/lib/facet/kernel/true.rb +0 -2
- data/lib/facet/kernel/unuri.rb +0 -2
- data/lib/facet/kernel/uri.rb +0 -38
- data/lib/facet/kernel/val.rb +0 -52
- data/lib/facet/kernel/warn_with_line.rb +0 -30
- data/lib/facet/kernel/with_accessor.rb +0 -94
- data/lib/facet/kernel/with_reader.rb +0 -2
- data/lib/facet/kernel/with_writer.rb +0 -2
- data/lib/facet/logger.rb +0 -0
- data/lib/facet/logger/format.rb +0 -28
- data/lib/facet/logger/format_message.rb +0 -1
- data/lib/facet/matchdata.rb +0 -3
- data/lib/facet/matchdata/match.rb +0 -37
- data/lib/facet/matchdata/matchset.rb +0 -2
- data/lib/facet/matchdata/matchtree.rb +0 -62
- data/lib/facet/module.rb +0 -40
- data/lib/facet/module/abstract.rb +0 -50
- data/lib/facet/module/alias_module_function.rb +0 -57
- data/lib/facet/module/ancestor.rb +0 -38
- data/lib/facet/module/attr.rb +0 -23
- data/lib/facet/module/attr_setter.rb +0 -48
- data/lib/facet/module/attr_tester.rb +0 -56
- data/lib/facet/module/basename.rb +0 -39
- data/lib/facet/module/by_name.rb +0 -68
- data/lib/facet/module/cattr_accessor.rb +0 -141
- data/lib/facet/module/cattr_reader.rb +0 -2
- data/lib/facet/module/cattr_writer.rb +0 -2
- data/lib/facet/module/clone_removing.rb +0 -2
- data/lib/facet/module/clone_renaming.rb +0 -2
- data/lib/facet/module/clone_using.rb +0 -87
- data/lib/facet/module/dirname.rb +0 -42
- data/lib/facet/module/equate_on.rb +0 -70
- data/lib/facet/module/generate_instance_method_name.rb +0 -47
- data/lib/facet/module/include_as.rb +0 -102
- data/lib/facet/module/initializer.rb +0 -65
- data/lib/facet/module/instance_methods.rb +0 -186
- data/lib/facet/module/integrate.rb +0 -51
- data/lib/facet/module/is.rb +0 -34
- data/lib/facet/module/memoize.rb +0 -95
- data/lib/facet/module/modspace.rb +0 -43
- data/lib/facet/module/namespace.rb +0 -61
- data/lib/facet/module/nesting.rb +0 -45
- data/lib/facet/module/redef.rb +0 -31
- data/lib/facet/module/redefine_method.rb +0 -57
- data/lib/facet/module/redirect.rb +0 -30
- data/lib/facet/module/redirect_method.rb +0 -64
- data/lib/facet/module/remove.rb +0 -29
- data/lib/facet/module/rename.rb +0 -31
- data/lib/facet/module/rename_method.rb +0 -38
- data/lib/facet/module/revisal.rb +0 -49
- data/lib/facet/module/shadow_all.rb +0 -17
- data/lib/facet/module/shadow_method.rb +0 -42
- data/lib/facet/module/sort_on.rb +0 -73
- data/lib/facet/module/undef.rb +0 -29
- data/lib/facet/module/wrap.rb +0 -30
- data/lib/facet/module/wrap_method.rb +0 -48
- data/lib/facet/nilclass.rb +0 -7
- data/lib/facet/nilclass/empty.rb +0 -32
- data/lib/facet/nilclass/include.rb +0 -32
- data/lib/facet/nilclass/length.rb +0 -2
- data/lib/facet/nilclass/op_fetch.rb +0 -37
- data/lib/facet/nilclass/size.rb +0 -44
- data/lib/facet/nilclass/to_f.rb +0 -32
- data/lib/facet/nilclass/to_h.rb +0 -33
- data/lib/facet/numeric.rb +0 -5
- data/lib/facet/numeric/ceil_multiple.rb +0 -40
- data/lib/facet/numeric/pred.rb +0 -2
- data/lib/facet/numeric/succ.rb +0 -69
- data/lib/facet/numeric/to_b.rb +0 -38
- data/lib/facet/ostruct.rb +0 -0
- data/lib/facet/ostruct/__merge__.rb +0 -52
- data/lib/facet/ostruct/__table__.rb +0 -17
- data/lib/facet/ostruct/__update__.rb +0 -45
- data/lib/facet/ostruct/op_fetch.rb +0 -40
- data/lib/facet/ostruct/op_store.rb +0 -42
- data/lib/facet/ostruct/to_h.rb +0 -8
- data/lib/facet/pathname.rb +0 -2
- data/lib/facet/pathname/ascend.rb +0 -22
- data/lib/facet/pathname/descend.rb +0 -20
- data/lib/facet/proc.rb +0 -3
- data/lib/facet/proc/compose.rb +0 -62
- data/lib/facet/proc/op_mul.rb +0 -2
- data/lib/facet/proc/to_method.rb +0 -74
- data/lib/facet/range.rb +0 -4
- data/lib/facet/range/to_r.rb +0 -32
- data/lib/facet/range/to_range.rb +0 -36
- data/lib/facet/range/umbrella.rb +0 -67
- data/lib/facet/range/within.rb +0 -44
- data/lib/facet/regexp.rb +0 -3
- data/lib/facet/regexp/arity.rb +0 -41
- data/lib/facet/regexp/to_re.rb +0 -38
- data/lib/facet/regexp/to_regexp.rb +0 -36
- data/lib/facet/string.rb +0 -86
- data/lib/facet/string/align_center.rb +0 -87
- data/lib/facet/string/align_left.rb +0 -2
- data/lib/facet/string/align_right.rb +0 -2
- data/lib/facet/string/at.rb +0 -8
- data/lib/facet/string/at_rand.rb +0 -65
- data/lib/facet/string/basename.rb +0 -48
- data/lib/facet/string/blank.rb +0 -36
- data/lib/facet/string/bracket.rb +0 -70
- data/lib/facet/string/brief.rb +0 -33
- data/lib/facet/string/bytes.rb +0 -19
- data/lib/facet/string/camelcase.rb +0 -58
- data/lib/facet/string/camelize.rb +0 -35
- data/lib/facet/string/capitalized.rb +0 -38
- data/lib/facet/string/chars.rb +0 -34
- data/lib/facet/string/cmp.rb +0 -43
- data/lib/facet/string/demodulize.rb +0 -40
- data/lib/facet/string/dequote.rb +0 -29
- data/lib/facet/string/downcase.rb +0 -37
- data/lib/facet/string/dresner.rb +0 -49
- data/lib/facet/string/each_char.rb +0 -35
- data/lib/facet/string/each_word.rb +0 -50
- data/lib/facet/string/ends_with.rb +0 -2
- data/lib/facet/string/first.rb +0 -94
- data/lib/facet/string/first_char.rb +0 -20
- data/lib/facet/string/fold.rb +0 -67
- data/lib/facet/string/format.rb +0 -17
- data/lib/facet/string/frequency.rb +0 -39
- data/lib/facet/string/humanize.rb +0 -31
- data/lib/facet/string/indent.rb +0 -68
- data/lib/facet/string/index_all.rb +0 -40
- data/lib/facet/string/last.rb +0 -94
- data/lib/facet/string/last_char.rb +0 -22
- data/lib/facet/string/line_wrap.rb +0 -77
- data/lib/facet/string/lines.rb +0 -33
- data/lib/facet/string/lowercase.rb +0 -32
- data/lib/facet/string/margin.rb +0 -138
- data/lib/facet/string/mscan.rb +0 -42
- data/lib/facet/string/natcmp.rb +0 -108
- data/lib/facet/string/nchar.rb +0 -45
- data/lib/facet/string/ordinal.rb +0 -16
- data/lib/facet/string/plural.rb +0 -2
- data/lib/facet/string/pop.rb +0 -54
- data/lib/facet/string/probability.rb +0 -34
- data/lib/facet/string/pull.rb +0 -17
- data/lib/facet/string/push.rb +0 -44
- data/lib/facet/string/quote.rb +0 -68
- data/lib/facet/string/rand_byte.rb +0 -55
- data/lib/facet/string/rand_index.rb +0 -29
- data/lib/facet/string/range.rb +0 -37
- data/lib/facet/string/range_all.rb +0 -48
- data/lib/facet/string/range_of_line.rb +0 -42
- data/lib/facet/string/regesc.rb +0 -32
- data/lib/facet/string/self/format.rb +0 -17
- data/lib/facet/string/self/interpolate.rb +0 -31
- data/lib/facet/string/self/patterns.rb +0 -51
- data/lib/facet/string/self/rand_letter.rb +0 -34
- data/lib/facet/string/self/random.rb +0 -36
- data/lib/facet/string/shatter.rb +0 -45
- data/lib/facet/string/shift.rb +0 -42
- data/lib/facet/string/shuffle.rb +0 -42
- data/lib/facet/string/similarity.rb +0 -108
- data/lib/facet/string/singular.rb +0 -117
- data/lib/facet/string/slap.rb +0 -44
- data/lib/facet/string/soundex.rb +0 -102
- data/lib/facet/string/starts_with.rb +0 -24
- data/lib/facet/string/succ.rb +0 -38
- data/lib/facet/string/tab.rb +0 -2
- data/lib/facet/string/tabto.rb +0 -2
- data/lib/facet/string/to_a.rb +0 -35
- data/lib/facet/string/to_arr.rb +0 -55
- data/lib/facet/string/to_b.rb +0 -64
- data/lib/facet/string/to_const.rb +0 -39
- data/lib/facet/string/to_date.rb +0 -35
- data/lib/facet/string/to_proc.rb +0 -54
- data/lib/facet/string/to_re.rb +0 -46
- data/lib/facet/string/to_rx.rb +0 -2
- data/lib/facet/string/to_time.rb +0 -34
- data/lib/facet/string/unbracket.rb +0 -46
- data/lib/facet/string/underscore.rb +0 -18
- data/lib/facet/string/unix_crypt.rb +0 -41
- data/lib/facet/string/unpack.rb +0 -45
- data/lib/facet/string/unshift.rb +0 -42
- data/lib/facet/string/upcase.rb +0 -45
- data/lib/facet/string/uppercase.rb +0 -2
- data/lib/facet/string/whitespace.rb +0 -27
- data/lib/facet/string/word_filter.rb +0 -61
- data/lib/facet/string/word_wrap.rb +0 -90
- data/lib/facet/string/words.rb +0 -45
- data/lib/facet/symbol.rb +0 -13
- data/lib/facet/symbol/camelcase.rb +0 -42
- data/lib/facet/symbol/camelize.rb +0 -33
- data/lib/facet/symbol/capitalize.rb +0 -31
- data/lib/facet/symbol/capitalized.rb +0 -33
- data/lib/facet/symbol/downcase.rb +0 -36
- data/lib/facet/symbol/not.rb +0 -40
- data/lib/facet/symbol/pad.rb +0 -43
- data/lib/facet/symbol/succ.rb +0 -42
- data/lib/facet/symbol/to_const.rb +0 -40
- data/lib/facet/symbol/to_proc.rb +0 -45
- data/lib/facet/symbol/to_str.rb +0 -39
- data/lib/facet/symbol/underscore.rb +0 -32
- data/lib/facet/symbol/upcase.rb +0 -37
- data/lib/facet/time.rb +0 -7
- data/lib/facet/time/change.rb +0 -51
- data/lib/facet/time/elapse.rb +0 -41
- data/lib/facet/time/self/days_extrema.rb +0 -22
- data/lib/facet/time/stamp.rb +0 -47
- data/lib/facet/time/to_date.rb +0 -37
- data/lib/facet/time/to_s.rb +0 -33
- data/lib/facet/time/to_time.rb +0 -36
- data/lib/facet/unboundmethod.rb +0 -1
- data/lib/facet/unboundmethod/name.rb +0 -8
- data/lib/facets.rb +0 -200
- data/lib/facets/english/bytes.rb +0 -212
- data/lib/facets/english/multipliers.rb +0 -192
- data/lib/facets/english/ormsupport.rb +0 -233
- data/lib/facets/english/time.rb +0 -327
- data/lib/facets/group/inflect.rb +0 -71
- data/lib/facets/group/nilasemptiness.rb +0 -34
- data/lib/facets/group/random.rb +0 -21
- data/lib/facets/group/stringasarray.rb +0 -16
- data/lib/facets/method/README +0 -1
- data/lib/facets/support/functor.rb +0 -49
- data/setup.rb +0 -1551
- data/test/FIXTURE/create_file +0 -1
- data/test/FIXTURE/filelist/testfile.txt +0 -0
- data/test/FIXTURE/filelist/testfile2.txt +0 -0
- data/test/FIXTURE/ls_r/A.txt +0 -0
- data/test/FIXTURE/ls_r/A/B.txt +0 -0
- data/test/FIXTURE/ls_r/A/B/C.txt +0 -0
- data/test/FIXTURE/open_as_string_file +0 -1
- data/test/FIXTURE/read_list_file +0 -6
- data/test/FIXTURE/test_file.txt +0 -25
- data/test/FIXTURE/test_file2.txt +0 -25
- data/test/lib/facet/array/test_at_rand.rb +0 -34
- data/test/lib/facet/array/test_delete_unless.rb +0 -28
- data/test/lib/facet/array/test_delete_values.rb +0 -28
- data/test/lib/facet/array/test_delete_values_at.rb +0 -31
- data/test/lib/facet/array/test_first.rb +0 -46
- data/test/lib/facet/array/test_head.rb +0 -42
- data/test/lib/facet/array/test_last_index.rb +0 -26
- data/test/lib/facet/array/test_merge.rb +0 -35
- data/test/lib/facet/array/test_mid.rb +0 -33
- data/test/lib/facet/array/test_middle.rb +0 -29
- data/test/lib/facet/array/test_op_fetch.rb +0 -27
- data/test/lib/facet/array/test_op_store.rb +0 -30
- data/test/lib/facet/array/test_pick.rb +0 -40
- data/test/lib/facet/array/test_pos.rb +0 -28
- data/test/lib/facet/array/test_pull.rb +0 -28
- data/test/lib/facet/array/test_rand_index.rb +0 -29
- data/test/lib/facet/array/test_rand_subset.rb +0 -29
- data/test/lib/facet/array/test_range.rb +0 -32
- data/test/lib/facet/array/test_rotate.rb +0 -36
- data/test/lib/facet/array/test_select.rb +0 -28
- data/test/lib/facet/array/test_shuffle.rb +0 -35
- data/test/lib/facet/array/test_slap.rb +0 -28
- data/test/lib/facet/array/test_thru.rb +0 -27
- data/test/lib/facet/array/test_to_b.rb +0 -27
- data/test/lib/facet/array/test_to_h.rb +0 -33
- data/test/lib/facet/array/test_to_hash.rb +0 -27
- data/test/lib/facet/binding/self/test_of_caller.rb +0 -35
- data/test/lib/facet/binding/test___LINE__.rb +0 -43
- data/test/lib/facet/binding/test_call_stack.rb +0 -34
- data/test/lib/facet/binding/test_called.rb +0 -30
- data/test/lib/facet/binding/test_caller.rb +0 -35
- data/test/lib/facet/binding/test_defined.rb +0 -34
- data/test/lib/facet/binding/test_eval.rb +0 -34
- data/test/lib/facet/binding/test_local_variables.rb +0 -34
- data/test/lib/facet/binding/test_method_name.rb +0 -34
- data/test/lib/facet/binding/test_op_fetch.rb +0 -34
- data/test/lib/facet/binding/test_op_store.rb +0 -35
- data/test/lib/facet/binding/test_self.rb +0 -34
- data/test/lib/facet/class/test_descendents.rb +0 -30
- data/test/lib/facet/class/test_remove_descendents.rb +0 -32
- data/test/lib/facet/comparable/test_at_least.rb +0 -34
- data/test/lib/facet/comparable/test_clip.rb +0 -44
- data/test/lib/facet/comparable/test_cmp.rb +0 -28
- data/test/lib/facet/continuation/self/test_create.rb +0 -26
- data/test/lib/facet/date/test_days_in_month.rb +0 -30
- data/test/lib/facet/date/test_days_of_month.rb +0 -30
- data/test/lib/facet/date/test_stamp.rb +0 -38
- data/test/lib/facet/date/test_to_date.rb +0 -30
- data/test/lib/facet/date/test_to_s.rb +0 -30
- data/test/lib/facet/date/test_to_time.rb +0 -30
- data/test/lib/facet/dir/self/test_ancestor.rb +0 -26
- data/test/lib/facet/dir/self/test_ascend.rb +0 -41
- data/test/lib/facet/dir/self/test_ls_r.rb +0 -52
- data/test/lib/facet/enumerable/self/test_combinations.rb +0 -43
- data/test/lib/facet/enumerable/self/test_cross.rb +0 -31
- data/test/lib/facet/enumerable/test_collect_with_index.rb +0 -27
- data/test/lib/facet/enumerable/test_commonality.rb +0 -31
- data/test/lib/facet/enumerable/test_compact_collect.rb +0 -27
- data/test/lib/facet/enumerable/test_cross.rb +0 -30
- data/test/lib/facet/enumerable/test_each_combination.rb +0 -29
- data/test/lib/facet/enumerable/test_each_pair.rb +0 -29
- data/test/lib/facet/enumerable/test_each_slice.rb +0 -74
- data/test/lib/facet/enumerable/test_each_unique_pair.rb +0 -29
- data/test/lib/facet/enumerable/test_entropy.rb +0 -26
- data/test/lib/facet/enumerable/test_every.rb +0 -35
- data/test/lib/facet/enumerable/test_ew.rb +0 -31
- data/test/lib/facet/enumerable/test_filter_collect.rb +0 -31
- data/test/lib/facet/enumerable/test_find_collisions.rb +0 -30
- data/test/lib/facet/enumerable/test_frequency.rb +0 -27
- data/test/lib/facet/enumerable/test_graph.rb +0 -30
- data/test/lib/facet/enumerable/test_ideal_entropy.rb +0 -27
- data/test/lib/facet/enumerable/test_none.rb +0 -33
- data/test/lib/facet/enumerable/test_occur.rb +0 -30
- data/test/lib/facet/enumerable/test_one.rb +0 -35
- data/test/lib/facet/enumerable/test_op_pow.rb +0 -27
- data/test/lib/facet/enumerable/test_partition_by.rb +0 -31
- data/test/lib/facet/enumerable/test_permute.rb +0 -29
- data/test/lib/facet/enumerable/test_probability.rb +0 -27
- data/test/lib/facet/enumerable/test_to_h.rb +0 -27
- data/test/lib/facet/enumerable/test_uniq_by.rb +0 -28
- data/test/lib/facet/file/self/test_create.rb +0 -39
- data/test/lib/facet/file/self/test_open_as_string.rb +0 -40
- data/test/lib/facet/file/self/test_read_list.rb +0 -37
- data/test/lib/facet/file/self/test_sanitize.rb +0 -46
- data/test/lib/facet/file/self/test_split_all.rb +0 -27
- data/test/lib/facet/fileutils/test_slice.rb +0 -96
- data/test/lib/facet/fileutils/test_wc.rb +0 -68
- data/test/lib/facet/fileutils/test_which.rb +0 -61
- data/test/lib/facet/float/test_approx.rb +0 -28
- data/test/lib/facet/float/test_round_at.rb +0 -46
- data/test/lib/facet/float/test_round_to.rb +0 -46
- data/test/lib/facet/hash/self/test_zipnew.rb +0 -28
- data/test/lib/facet/hash/test_alias.rb +0 -31
- data/test/lib/facet/hash/test_assert_has_keys.rb +0 -27
- data/test/lib/facet/hash/test_assert_has_only_keys.rb +0 -27
- data/test/lib/facet/hash/test_at.rb +0 -28
- data/test/lib/facet/hash/test_collate.rb +0 -35
- data/test/lib/facet/hash/test_each.rb +0 -36
- data/test/lib/facet/hash/test_each_with_index.rb +0 -29
- data/test/lib/facet/hash/test_each_with_key.rb +0 -29
- data/test/lib/facet/hash/test_graph.rb +0 -28
- data/test/lib/facet/hash/test_has_keys.rb +0 -27
- data/test/lib/facet/hash/test_has_only_keys.rb +0 -27
- data/test/lib/facet/hash/test_inverse.rb +0 -28
- data/test/lib/facet/hash/test_keys_to_s.rb +0 -34
- data/test/lib/facet/hash/test_keys_to_sym.rb +0 -34
- data/test/lib/facet/hash/test_op_fetch.rb +0 -111
- data/test/lib/facet/hash/test_op_lshift.rb +0 -29
- data/test/lib/facet/hash/test_rand_key.rb +0 -27
- data/test/lib/facet/hash/test_rand_pair.rb +0 -27
- data/test/lib/facet/hash/test_rand_value.rb +0 -27
- data/test/lib/facet/hash/test_replace_each.rb +0 -29
- data/test/lib/facet/hash/test_shuffle.rb +0 -32
- data/test/lib/facet/hash/test_slice.rb +0 -27
- data/test/lib/facet/hash/test_swap.rb +0 -27
- data/test/lib/facet/hash/test_swapkey.rb +0 -29
- data/test/lib/facet/hash/test_to_h.rb +0 -27
- data/test/lib/facet/hash/test_to_ostruct.rb +0 -30
- data/test/lib/facet/hash/test_to_ostruct_recurse.rb +0 -30
- data/test/lib/facet/hash/test_traverse.rb +0 -37
- data/test/lib/facet/hash/test_update_each.rb +0 -29
- data/test/lib/facet/hash/test_update_keys.rb +0 -28
- data/test/lib/facet/hash/test_update_values.rb +0 -28
- data/test/lib/facet/hash/test_weave.rb +0 -29
- data/test/lib/facet/integer/test_factorial.rb +0 -30
- data/test/lib/facet/integer/test_multiple.rb +0 -43
- data/test/lib/facet/integer/test_ordinal.rb +0 -29
- data/test/lib/facet/integer/test_times_collect.rb +0 -28
- data/test/lib/facet/kernel/test___class__.rb +0 -26
- data/test/lib/facet/kernel/test_as.rb +0 -42
- data/test/lib/facet/kernel/test_assign_from.rb +0 -31
- data/test/lib/facet/kernel/test_assign_with.rb +0 -31
- data/test/lib/facet/kernel/test_bool.rb +0 -41
- data/test/lib/facet/kernel/test_bug.rb +0 -26
- data/test/lib/facet/kernel/test_call_stack.rb +0 -26
- data/test/lib/facet/kernel/test_called.rb +0 -26
- data/test/lib/facet/kernel/test_constant.rb +0 -33
- data/test/lib/facet/kernel/test_copy.rb +0 -40
- data/test/lib/facet/kernel/test_deep_copy.rb +0 -40
- data/test/lib/facet/kernel/test_demo.rb +0 -28
- data/test/lib/facet/kernel/test_fn.rb +0 -26
- data/test/lib/facet/kernel/test_generate_method_name.rb +0 -26
- data/test/lib/facet/kernel/test_get_by_id.rb +0 -28
- data/test/lib/facet/kernel/test_here.rb +0 -26
- data/test/lib/facet/kernel/test_in.rb +0 -27
- data/test/lib/facet/kernel/test_maybe.rb +0 -26
- data/test/lib/facet/kernel/test_metaclass.rb +0 -34
- data/test/lib/facet/kernel/test_method.rb +0 -32
- data/test/lib/facet/kernel/test_method_name.rb +0 -31
- data/test/lib/facet/kernel/test_methods.rb +0 -50
- data/test/lib/facet/kernel/test_new.rb +0 -30
- data/test/lib/facet/kernel/test_object_class.rb +0 -26
- data/test/lib/facet/kernel/test_object_hexid.rb +0 -27
- data/test/lib/facet/kernel/test_require_all.rb +0 -26
- data/test/lib/facet/kernel/test_require_esc.rb +0 -27
- data/test/lib/facet/kernel/test_require_facet.rb +0 -27
- data/test/lib/facet/kernel/test_resc.rb +0 -27
- data/test/lib/facet/kernel/test_returning.rb +0 -30
- data/test/lib/facet/kernel/test_send_as.rb +0 -26
- data/test/lib/facet/kernel/test_set_from.rb +0 -33
- data/test/lib/facet/kernel/test_set_with.rb +0 -33
- data/test/lib/facet/kernel/test_silently.rb +0 -28
- data/test/lib/facet/kernel/test_singleton.rb +0 -40
- data/test/lib/facet/kernel/test_superior.rb +0 -30
- data/test/lib/facet/kernel/test_supermethod.rb +0 -33
- data/test/lib/facet/kernel/test_this.rb +0 -26
- data/test/lib/facet/kernel/test_to_b.rb +0 -28
- data/test/lib/facet/kernel/test_to_bool.rb +0 -28
- data/test/lib/facet/kernel/test_uri.rb +0 -30
- data/test/lib/facet/kernel/test_val.rb +0 -43
- data/test/lib/facet/kernel/test_with_accessor.rb +0 -51
- data/test/lib/facet/matchdata/test_match.rb +0 -29
- data/test/lib/facet/matchdata/test_matchtree.rb +0 -32
- data/test/lib/facet/module/test_abstract.rb +0 -36
- data/test/lib/facet/module/test_alias_module_function.rb +0 -34
- data/test/lib/facet/module/test_ancestor.rb +0 -26
- data/test/lib/facet/module/test_basename.rb +0 -26
- data/test/lib/facet/module/test_by_name.rb +0 -29
- data/test/lib/facet/module/test_cattr_accessor.rb +0 -55
- data/test/lib/facet/module/test_clone_using.rb +0 -55
- data/test/lib/facet/module/test_dirname.rb +0 -26
- data/test/lib/facet/module/test_equate_on.rb +0 -37
- data/test/lib/facet/module/test_generate_instance_method_name.rb +0 -33
- data/test/lib/facet/module/test_include_as.rb +0 -35
- data/test/lib/facet/module/test_initializer.rb +0 -32
- data/test/lib/facet/module/test_instance_methods.rb +0 -59
- data/test/lib/facet/module/test_integrate.rb +0 -35
- data/test/lib/facet/module/test_memoize.rb +0 -50
- data/test/lib/facet/module/test_modspace.rb +0 -27
- data/test/lib/facet/module/test_namespace.rb +0 -33
- data/test/lib/facet/module/test_nesting.rb +0 -36
- data/test/lib/facet/module/test_redef.rb +0 -30
- data/test/lib/facet/module/test_redefine_method.rb +0 -30
- data/test/lib/facet/module/test_redirect.rb +0 -30
- data/test/lib/facet/module/test_redirect_method.rb +0 -30
- data/test/lib/facet/module/test_remove.rb +0 -30
- data/test/lib/facet/module/test_rename.rb +0 -31
- data/test/lib/facet/module/test_rename_method.rb +0 -31
- data/test/lib/facet/module/test_revisal.rb +0 -35
- data/test/lib/facet/module/test_shadow_method.rb +0 -30
- data/test/lib/facet/module/test_sort_on.rb +0 -42
- data/test/lib/facet/module/test_undef.rb +0 -30
- data/test/lib/facet/module/test_wrap.rb +0 -30
- data/test/lib/facet/module/test_wrap_method.rb +0 -30
- data/test/lib/facet/nilclass/test_empty.rb +0 -26
- data/test/lib/facet/nilclass/test_include.rb +0 -26
- data/test/lib/facet/nilclass/test_op_fetch.rb +0 -28
- data/test/lib/facet/nilclass/test_size.rb +0 -30
- data/test/lib/facet/nilclass/test_to_f.rb +0 -26
- data/test/lib/facet/nilclass/test_to_h.rb +0 -26
- data/test/lib/facet/numeric/test_ceil_multiple.rb +0 -31
- data/test/lib/facet/numeric/test_succ.rb +0 -40
- data/test/lib/facet/numeric/test_to_b.rb +0 -27
- data/test/lib/facet/ostruct/test___merge__.rb +0 -38
- data/test/lib/facet/ostruct/test___update__.rb +0 -29
- data/test/lib/facet/ostruct/test_op_fetch.rb +0 -27
- data/test/lib/facet/ostruct/test_op_store.rb +0 -28
- data/test/lib/facet/proc/test_compose.rb +0 -36
- data/test/lib/facet/proc/test_to_method.rb +0 -31
- data/test/lib/facet/range/test_to_r.rb +0 -27
- data/test/lib/facet/range/test_to_range.rb +0 -27
- data/test/lib/facet/range/test_umbrella.rb +0 -34
- data/test/lib/facet/range/test_within.rb +0 -29
- data/test/lib/facet/regexp/test_arity.rb +0 -33
- data/test/lib/facet/regexp/test_to_re.rb +0 -27
- data/test/lib/facet/regexp/test_to_regexp.rb +0 -27
- data/test/lib/facet/string/self/test_interpolate.rb +0 -27
- data/test/lib/facet/string/self/test_patterns.rb +0 -28
- data/test/lib/facet/string/self/test_rand_letter.rb +0 -26
- data/test/lib/facet/string/test_align_center.rb +0 -34
- data/test/lib/facet/string/test_at_rand.rb +0 -35
- data/test/lib/facet/string/test_basename.rb +0 -41
- data/test/lib/facet/string/test_blank.rb +0 -27
- data/test/lib/facet/string/test_bracket.rb +0 -49
- data/test/lib/facet/string/test_camelcase.rb +0 -39
- data/test/lib/facet/string/test_camelize.rb +0 -26
- data/test/lib/facet/string/test_capitalized.rb +0 -26
- data/test/lib/facet/string/test_chars.rb +0 -27
- data/test/lib/facet/string/test_cmp.rb +0 -30
- data/test/lib/facet/string/test_demodulize.rb +0 -38
- data/test/lib/facet/string/test_downcase.rb +0 -26
- data/test/lib/facet/string/test_dresner.rb +0 -32
- data/test/lib/facet/string/test_each_char.rb +0 -29
- data/test/lib/facet/string/test_each_word.rb +0 -29
- data/test/lib/facet/string/test_first.rb +0 -43
- data/test/lib/facet/string/test_fold.rb +0 -34
- data/test/lib/facet/string/test_frequency.rb +0 -28
- data/test/lib/facet/string/test_humanize.rb +0 -26
- data/test/lib/facet/string/test_indent.rb +0 -40
- data/test/lib/facet/string/test_index_all.rb +0 -26
- data/test/lib/facet/string/test_last.rb +0 -46
- data/test/lib/facet/string/test_line_wrap.rb +0 -27
- data/test/lib/facet/string/test_lines.rb +0 -26
- data/test/lib/facet/string/test_lowercase.rb +0 -26
- data/test/lib/facet/string/test_margin.rb +0 -117
- data/test/lib/facet/string/test_mscan.rb +0 -30
- data/test/lib/facet/string/test_natcmp.rb +0 -30
- data/test/lib/facet/string/test_nchar.rb +0 -29
- data/test/lib/facet/string/test_pop.rb +0 -47
- data/test/lib/facet/string/test_probability.rb +0 -28
- data/test/lib/facet/string/test_push.rb +0 -40
- data/test/lib/facet/string/test_quote.rb +0 -49
- data/test/lib/facet/string/test_rand_byte.rb +0 -35
- data/test/lib/facet/string/test_rand_index.rb +0 -26
- data/test/lib/facet/string/test_range.rb +0 -27
- data/test/lib/facet/string/test_range_all.rb +0 -27
- data/test/lib/facet/string/test_range_of_line.rb +0 -28
- data/test/lib/facet/string/test_regesc.rb +0 -28
- data/test/lib/facet/string/test_shatter.rb +0 -29
- data/test/lib/facet/string/test_shift.rb +0 -40
- data/test/lib/facet/string/test_shuffle.rb +0 -27
- data/test/lib/facet/string/test_similarity.rb +0 -26
- data/test/lib/facet/string/test_singular.rb +0 -32
- data/test/lib/facet/string/test_slap.rb +0 -40
- data/test/lib/facet/string/test_soundex.rb +0 -41
- data/test/lib/facet/string/test_succ.rb +0 -29
- data/test/lib/facet/string/test_to_a.rb +0 -27
- data/test/lib/facet/string/test_to_arr.rb +0 -26
- data/test/lib/facet/string/test_to_b.rb +0 -41
- data/test/lib/facet/string/test_to_const.rb +0 -28
- data/test/lib/facet/string/test_to_date.rb +0 -30
- data/test/lib/facet/string/test_to_proc.rb +0 -33
- data/test/lib/facet/string/test_to_re.rb +0 -28
- data/test/lib/facet/string/test_to_time.rb +0 -30
- data/test/lib/facet/string/test_unix_crypt.rb +0 -30
- data/test/lib/facet/string/test_unpack.rb +0 -34
- data/test/lib/facet/string/test_unshift.rb +0 -39
- data/test/lib/facet/string/test_upcase.rb +0 -30
- data/test/lib/facet/string/test_whitespace.rb +0 -27
- data/test/lib/facet/string/test_word_filter.rb +0 -34
- data/test/lib/facet/string/test_word_wrap.rb +0 -51
- data/test/lib/facet/string/test_words.rb +0 -37
- data/test/lib/facet/symbol/test_camelcase.rb +0 -26
- data/test/lib/facet/symbol/test_camelize.rb +0 -27
- data/test/lib/facet/symbol/test_capitalize.rb +0 -26
- data/test/lib/facet/symbol/test_capitalized.rb +0 -27
- data/test/lib/facet/symbol/test_downcase.rb +0 -27
- data/test/lib/facet/symbol/test_not.rb +0 -29
- data/test/lib/facet/symbol/test_pad.rb +0 -27
- data/test/lib/facet/symbol/test_succ.rb +0 -28
- data/test/lib/facet/symbol/test_to_const.rb +0 -28
- data/test/lib/facet/symbol/test_to_proc.rb +0 -27
- data/test/lib/facet/symbol/test_to_str.rb +0 -28
- data/test/lib/facet/symbol/test_underscore.rb +0 -26
- data/test/lib/facet/symbol/test_upcase.rb +0 -27
- data/test/lib/facet/time/test_change.rb +0 -33
- data/test/lib/facet/time/test_elapse.rb +0 -27
- data/test/lib/facet/time/test_stamp.rb +0 -31
- data/test/lib/facet/time/test_to_date.rb +0 -31
- data/test/lib/facet/time/test_to_s.rb +0 -31
- data/test/lib/facet/time/test_to_time.rb +0 -31
- data/test/lib/facets/english/test_bytes.rb +0 -84
- data/test/lib/facets/english/test_multipliers.rb +0 -114
- data/test/lib/facets/english/test_time.rb +0 -73
- data/test/testdir.rb +0 -8
data/lib/facets/english/bytes.rb
DELETED
@@ -1,212 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Binary Multipliers
|
3
|
-
#
|
4
|
-
# Copyright (c) 2005 Thomas Sawyer
|
5
|
-
# Copyright (c) 2004 Rich Kilmer
|
6
|
-
#
|
7
|
-
# Ruby License
|
8
|
-
#
|
9
|
-
# This module is free software. You may use, modify, and/or redistribute this
|
10
|
-
# software under the same terms as Ruby.
|
11
|
-
#
|
12
|
-
# This program is distributed in the hope that it will be useful, but WITHOUT
|
13
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
14
|
-
# FOR A PARTICULAR PURPOSE.
|
15
|
-
#
|
16
|
-
# ==========================================================================
|
17
|
-
# Revision History ::
|
18
|
-
# --------------------------------------------------------------------------
|
19
|
-
# 2005.08.10 trans * Made a module. Added in_* methods.
|
20
|
-
# 2005.07.28 trans * Rewrote lib to work in bits instead of bytes.
|
21
|
-
# 2005.04.28 trans * Ported from Rich Kilmer's lib.
|
22
|
-
# ==========================================================================
|
23
|
-
#
|
24
|
-
# :CREDIT: Credit goes to Richard Kilmer for the orignal work and
|
25
|
-
# Alexander Kellett for suggesting it be included here.
|
26
|
-
#
|
27
|
-
#++
|
28
|
-
|
29
|
-
#:title: Binary Multipliers
|
30
|
-
#
|
31
|
-
# Mixin for Numeric to make working with bits and bytes easier.
|
32
|
-
# These are numerous and therefore provided via a mega-module
|
33
|
-
# called BinaryMultiplers, rather then individual nano-methods.
|
34
|
-
#
|
35
|
-
# 1.byte #=> 8
|
36
|
-
# 2.bytes #=> 16
|
37
|
-
# 1.kilobit #=> 1024
|
38
|
-
# 1.kilobyte #=> 8192
|
39
|
-
#
|
40
|
-
|
41
|
-
class Numeric
|
42
|
-
|
43
|
-
def bit ; self ; end
|
44
|
-
def bits ; self ; end
|
45
|
-
def byte ; self * 8 ; end
|
46
|
-
def bytes ; self * 8 ; end
|
47
|
-
|
48
|
-
[ 'kilo', 'mega', 'giga', 'tera', 'peta', 'exa' ].each_with_index do |m, i|
|
49
|
-
j = i + 1
|
50
|
-
class_eval %{
|
51
|
-
def #{m}bit ; self * #{1024**j} ; end
|
52
|
-
def #{m}byte ; self * #{1024**j*8} ; end
|
53
|
-
def in_#{m}bits ; self / #{1024**j} ; end
|
54
|
-
def in_#{m}bytes ; self / #{1024**j*8} ; end
|
55
|
-
alias_method :#{m}bits, :#{m}bit
|
56
|
-
alias_method :#{m}bytes, :#{m}byte
|
57
|
-
}
|
58
|
-
end
|
59
|
-
|
60
|
-
[ 'kibi', 'mebi', 'gibi', 'tebi', 'pebi', 'exbi' ].each_with_index do |m, i|
|
61
|
-
j = i + 1
|
62
|
-
class_eval %{
|
63
|
-
def #{m}bit ; self * #{1024**j} ; end
|
64
|
-
def #{m}byte ; self * #{1024**j*8} ; end
|
65
|
-
def in_#{m}bits ; self / #{1024**j} ; end
|
66
|
-
def in_#{m}bytes ; self / #{1024**j*8} ; end
|
67
|
-
alias_method :#{m}bits, :#{m}bit
|
68
|
-
alias_method :#{m}bytes, :#{m}byte
|
69
|
-
}
|
70
|
-
end
|
71
|
-
|
72
|
-
# Formated string of bits proportial to size.
|
73
|
-
#
|
74
|
-
# 1024.bits_to_s #=> "1.00 kb"
|
75
|
-
# 1048576.bits_to_s #=> "1.00 mb"
|
76
|
-
# 1073741824.bits_to_s #=> "1.00 gb"
|
77
|
-
# 1099511627776.bits_to_s #=> "1.00 tb"
|
78
|
-
#
|
79
|
-
# Takes a format string to adjust output.
|
80
|
-
#
|
81
|
-
# 1024.bits_to_s('%.0f') #=> "1 kb"
|
82
|
-
#
|
83
|
-
def strfbits(fmt='%.2f')
|
84
|
-
case
|
85
|
-
when self < 1024
|
86
|
-
"#{self} bits"
|
87
|
-
when self < 1024**2
|
88
|
-
"#{fmt % (self.to_f / 1024)} kb"
|
89
|
-
when self < 1024**3
|
90
|
-
"#{fmt % (self.to_f / 1024**2)} mb"
|
91
|
-
when self < 1024**4
|
92
|
-
"#{fmt % (self.to_f / 1024**3)} gb"
|
93
|
-
when self < 1024**5
|
94
|
-
"#{fmt % (self.to_f / 1024**4)} tb"
|
95
|
-
else
|
96
|
-
"#{self} bits"
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
# Formated string of bytes proportial to size.
|
101
|
-
#
|
102
|
-
# 1024.bytes_to_s #=> "1.00 KB"
|
103
|
-
# 1048576.bytes_to_s #=> "1.00 MB"
|
104
|
-
# 1073741824.bytes_to_s #=> "1.00 GB"
|
105
|
-
# 1099511627776.bytes_to_s #=> "1.00 TB"
|
106
|
-
#
|
107
|
-
# Takes a format string to adjust output.
|
108
|
-
#
|
109
|
-
# 1024.bytes_to_s('%.0f') #=> "1 KB"
|
110
|
-
#
|
111
|
-
def strfbytes(fmt='%.2f')
|
112
|
-
case
|
113
|
-
when self < 1024
|
114
|
-
"#{self} bytes"
|
115
|
-
when self < 1024**2
|
116
|
-
"#{fmt % (self.to_f / 1024)} KB"
|
117
|
-
when self < 1024**3
|
118
|
-
"#{fmt % (self.to_f / 1024**2)} MB"
|
119
|
-
when self < 1024**4
|
120
|
-
"#{fmt % (self.to_f / 1024**3)} GB"
|
121
|
-
when self < 1024**5
|
122
|
-
"#{fmt % (self.to_f / 1024**4)} TB"
|
123
|
-
else
|
124
|
-
"#{self} bytes"
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
# deprecated
|
129
|
-
alias_method :octet_units, :strfbytes
|
130
|
-
|
131
|
-
end
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
# _____ _
|
136
|
-
# |_ _|__ ___| |_
|
137
|
-
# | |/ _ \/ __| __|
|
138
|
-
# | | __/\__ \ |_
|
139
|
-
# |_|\___||___/\__|
|
140
|
-
#
|
141
|
-
|
142
|
-
=begin testing
|
143
|
-
|
144
|
-
require 'test/unit'
|
145
|
-
|
146
|
-
class TC_Numeric < Test::Unit::TestCase
|
147
|
-
|
148
|
-
# bits
|
149
|
-
|
150
|
-
def test_bits
|
151
|
-
assert_equal( 8, 8.bits )
|
152
|
-
end
|
153
|
-
|
154
|
-
def test_kilobits
|
155
|
-
assert_equal( 1024**1, 1.kilobit )
|
156
|
-
end
|
157
|
-
|
158
|
-
def test_megabits
|
159
|
-
assert_equal( 1024**2, 1.megabit )
|
160
|
-
end
|
161
|
-
|
162
|
-
def test_gigabits
|
163
|
-
assert_equal( 1024**3, 1.gigabit )
|
164
|
-
end
|
165
|
-
|
166
|
-
def test_terabits
|
167
|
-
assert_equal( 1024**4, 1.terabit )
|
168
|
-
end
|
169
|
-
|
170
|
-
# bytes
|
171
|
-
|
172
|
-
def test_bytes
|
173
|
-
assert_equal( 8192, 1024.bytes )
|
174
|
-
end
|
175
|
-
|
176
|
-
def test_kilobytes
|
177
|
-
assert_equal( 1024**1*8, 1.kilobyte )
|
178
|
-
end
|
179
|
-
|
180
|
-
def test_megabytes
|
181
|
-
assert_equal( 1024**2*8, 1.megabyte )
|
182
|
-
end
|
183
|
-
|
184
|
-
def test_gigabytes
|
185
|
-
assert_equal( 1024**3*8, 1.gigabyte )
|
186
|
-
end
|
187
|
-
|
188
|
-
def test_terabytes
|
189
|
-
assert_equal( 1024**4*8, 1.terabyte )
|
190
|
-
end
|
191
|
-
|
192
|
-
# bits_to_s
|
193
|
-
|
194
|
-
def test_strfbits
|
195
|
-
assert_equal( "1.00 kb", 1024.strfbits )
|
196
|
-
assert_equal( "1.00 mb", 1048576.strfbits )
|
197
|
-
assert_equal( "1.00 gb", 1073741824.strfbits )
|
198
|
-
assert_equal( "1.00 tb", 1099511627776.strfbits )
|
199
|
-
end
|
200
|
-
|
201
|
-
# bytes_to_s
|
202
|
-
|
203
|
-
def test_strfbytes
|
204
|
-
assert_equal( "1.00 KB", 1024.strfbytes )
|
205
|
-
assert_equal( "1.00 MB", 1048576.strfbytes )
|
206
|
-
assert_equal( "1.00 GB", 1073741824.strfbytes )
|
207
|
-
assert_equal( "1.00 TB", 1099511627776.strfbytes )
|
208
|
-
end
|
209
|
-
|
210
|
-
end
|
211
|
-
|
212
|
-
=end
|
@@ -1,192 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# multipliers.rb
|
3
|
-
#
|
4
|
-
# Copyright (c) 2005 Thomas Sawyer
|
5
|
-
#
|
6
|
-
# Ruby License
|
7
|
-
#
|
8
|
-
# This module is free software. You may use, modify, and/or redistribute this
|
9
|
-
# software under the same terms as Ruby.
|
10
|
-
#
|
11
|
-
# This program is distributed in the hope that it will be useful, but WITHOUT
|
12
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
-
# FOR A PARTICULAR PURPOSE.
|
14
|
-
#
|
15
|
-
# ==========================================================================
|
16
|
-
# Revision History ::
|
17
|
-
# --------------------------------------------------------------------------
|
18
|
-
# 2005.08.10 trans * Created, inspired by Rich Kilmer's bytes.rb.
|
19
|
-
# ==========================================================================
|
20
|
-
#++
|
21
|
-
|
22
|
-
#:title: Multipliers
|
23
|
-
#
|
24
|
-
# Adds methods to Numeric to make working with
|
25
|
-
# magnitudes (kilo, mega, giga, milli, micro, etc.)
|
26
|
-
# as well as bits and bytes easier.
|
27
|
-
#
|
28
|
-
# 1.kilo #=> 1000
|
29
|
-
# 1.milli #=> 0.001
|
30
|
-
# 1.kibi #=> 1024
|
31
|
-
#
|
32
|
-
# To display a value in a certain denomination, simply
|
33
|
-
# perform the inverse operation by placing the
|
34
|
-
# multiplier called on unit (1) in the denominator.
|
35
|
-
#
|
36
|
-
# 1000 / 1.kilo #=> 1
|
37
|
-
# 1024 / 1.kibi #=> 1
|
38
|
-
#
|
39
|
-
|
40
|
-
class Numeric
|
41
|
-
|
42
|
-
# SI Multipliers
|
43
|
-
|
44
|
-
def deka ; self * 10 ; end
|
45
|
-
def hecto ; self * 100 ; end
|
46
|
-
def kilo ; self * 1000 ; end
|
47
|
-
def mega ; self * 1000000 ; end
|
48
|
-
def giga ; self * 1000000000 ; end
|
49
|
-
def tera ; self * 1000000000000 ; end
|
50
|
-
def peta ; self * 1000000000000000 ; end
|
51
|
-
def exa ; self * 1000000000000000000 ; end
|
52
|
-
|
53
|
-
# SI Fractional
|
54
|
-
|
55
|
-
def deci ; self.to_f / 10 ; end
|
56
|
-
def centi ; self.to_f / 100 ; end
|
57
|
-
def milli ; self.to_f / 1000 ; end
|
58
|
-
def micro ; self.to_f / 1000000 ; end
|
59
|
-
def nano ; self.to_f / 1000000000 ; end
|
60
|
-
def pico ; self.to_f / 1000000000000 ; end
|
61
|
-
def femto ; self.to_f / 1000000000000000 ; end
|
62
|
-
def atto ; self.to_f / 1000000000000000000 ; end
|
63
|
-
|
64
|
-
# SI Binary
|
65
|
-
|
66
|
-
def kibi ; self * 1024 ; end
|
67
|
-
def mebi ; self * 1024**2 ; end
|
68
|
-
def gibi ; self * 1024**3 ; end
|
69
|
-
def tebi ; self * 1024**4 ; end
|
70
|
-
def pebi ; self * 1024**5 ; end
|
71
|
-
def exbi ; self * 1024**6 ; end
|
72
|
-
|
73
|
-
# Bits and Bytes
|
74
|
-
|
75
|
-
def bit ; self ; end
|
76
|
-
def bits ; self ; end
|
77
|
-
def byte ; self * 8 ; end
|
78
|
-
def bytes ; self * 8 ; end
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
# _____ _
|
85
|
-
# |_ _|__ ___| |_
|
86
|
-
# | |/ _ \/ __| __|
|
87
|
-
# | | __/\__ \ |_
|
88
|
-
# |_|\___||___/\__|
|
89
|
-
#
|
90
|
-
|
91
|
-
=begin testing
|
92
|
-
|
93
|
-
require 'test/unit'
|
94
|
-
|
95
|
-
class TC_Multipliers < Test::Unit::TestCase
|
96
|
-
|
97
|
-
def test_deka
|
98
|
-
assert_equal( 10, 1.deka )
|
99
|
-
end
|
100
|
-
|
101
|
-
def test_hecto
|
102
|
-
assert_equal( 100, 1.hecto )
|
103
|
-
end
|
104
|
-
|
105
|
-
def test_kilo
|
106
|
-
assert_equal( 1000, 1.kilo )
|
107
|
-
end
|
108
|
-
|
109
|
-
def test_mega
|
110
|
-
assert_equal( 1000000, 1.mega )
|
111
|
-
end
|
112
|
-
|
113
|
-
def test_giga
|
114
|
-
assert_equal( 1000000000, 1.giga )
|
115
|
-
end
|
116
|
-
|
117
|
-
def test_tera
|
118
|
-
assert_equal( 1000000000000, 1.tera )
|
119
|
-
end
|
120
|
-
|
121
|
-
def test_peta
|
122
|
-
assert_equal( 1000000000000000, 1.peta )
|
123
|
-
end
|
124
|
-
|
125
|
-
def test_exa
|
126
|
-
assert_equal( 1000000000000000000, 1.exa )
|
127
|
-
end
|
128
|
-
|
129
|
-
# Fractional
|
130
|
-
|
131
|
-
def test_deci
|
132
|
-
assert_equal( 0.1, 1.deci )
|
133
|
-
end
|
134
|
-
|
135
|
-
def test_centi
|
136
|
-
assert_equal( 0.01, 1.centi )
|
137
|
-
end
|
138
|
-
|
139
|
-
def test_milli
|
140
|
-
assert_equal( 0.001, 1.milli )
|
141
|
-
end
|
142
|
-
|
143
|
-
def test_milli
|
144
|
-
assert_equal( 0.000001, 1.micro )
|
145
|
-
end
|
146
|
-
|
147
|
-
def test_nano
|
148
|
-
assert_equal( 0.000000001, 1.nano )
|
149
|
-
end
|
150
|
-
|
151
|
-
def test_pico
|
152
|
-
assert_equal( 0.000000000001, 1.pico )
|
153
|
-
end
|
154
|
-
|
155
|
-
def test_femto
|
156
|
-
assert_equal( 0.000000000000001, 1.femto )
|
157
|
-
end
|
158
|
-
|
159
|
-
def test_atto
|
160
|
-
assert_equal( 0.000000000000000001, 1.atto )
|
161
|
-
end
|
162
|
-
|
163
|
-
# SI Binary
|
164
|
-
|
165
|
-
def test_kibi
|
166
|
-
assert_equal( 1024, 1.kibi )
|
167
|
-
end
|
168
|
-
|
169
|
-
def test_mebi
|
170
|
-
assert_equal( 1024**2, 1.mebi )
|
171
|
-
end
|
172
|
-
|
173
|
-
def test_gibi
|
174
|
-
assert_equal( 1024**3, 1.gibi )
|
175
|
-
end
|
176
|
-
|
177
|
-
def test_tebi
|
178
|
-
assert_equal( 1024**4, 1.tebi )
|
179
|
-
end
|
180
|
-
|
181
|
-
def test_pebi
|
182
|
-
assert_equal( 1024**5, 1.pebi )
|
183
|
-
end
|
184
|
-
|
185
|
-
def test_exbi
|
186
|
-
assert_equal( 1024**6, 1.exbi )
|
187
|
-
end
|
188
|
-
|
189
|
-
end
|
190
|
-
|
191
|
-
=end
|
192
|
-
|
@@ -1,233 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# ORMSupport
|
3
|
-
#
|
4
|
-
# Copyright (c) 2004,2005 Thomas Sawyer
|
5
|
-
#
|
6
|
-
# Ruby License
|
7
|
-
#
|
8
|
-
# This module is free software. You may use, modify, and/or redistribute this
|
9
|
-
# software under the same terms as Ruby.
|
10
|
-
#
|
11
|
-
# This program is distributed in the hope that it will be useful, but WITHOUT
|
12
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
-
# FOR A PARTICULAR PURPOSE.
|
14
|
-
#
|
15
|
-
# ==========================================================================
|
16
|
-
# Revision History
|
17
|
-
# ==========================================================================
|
18
|
-
#
|
19
|
-
# 5.8.25 Trans
|
20
|
-
# - Created based on a set of methods from Rails. Spruced up to support
|
21
|
-
# Multiple frameworks, mainly Nitro.
|
22
|
-
#
|
23
|
-
# ==========================================================================
|
24
|
-
#++
|
25
|
-
|
26
|
-
#:title: ORMSupport
|
27
|
-
#
|
28
|
-
# Provides a number of basc convenience methods for working with Object
|
29
|
-
# Relational Mappings.
|
30
|
-
#
|
31
|
-
# == Usage
|
32
|
-
#
|
33
|
-
# TODO
|
34
|
-
#
|
35
|
-
# == Author(s)
|
36
|
-
#
|
37
|
-
# * D.H.H.
|
38
|
-
# * George Moschovitis
|
39
|
-
# * Thomas Sawyer
|
40
|
-
#
|
41
|
-
|
42
|
-
require 'facet/module/attr_setter'
|
43
|
-
require 'facet/module/basename'
|
44
|
-
require 'facet/string/to_const'
|
45
|
-
require 'facet/inflect'
|
46
|
-
|
47
|
-
module ORMSupport
|
48
|
-
|
49
|
-
#++
|
50
|
-
# class level
|
51
|
-
#--
|
52
|
-
|
53
|
-
def self.default_system(s=:"~")
|
54
|
-
unless s == :"~"
|
55
|
-
@default_system = x.to_sym
|
56
|
-
else
|
57
|
-
@default_system ||= :og
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def self.default_key(k=:"~")
|
62
|
-
unless k == :"~"
|
63
|
-
@default_key = k.to_s
|
64
|
-
else
|
65
|
-
@default_key ||= '_id'
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
#++
|
70
|
-
# instance level
|
71
|
-
#--
|
72
|
-
|
73
|
-
# Converts a class-esque name into a table name.
|
74
|
-
def tablename( sys=:og )
|
75
|
-
sys ||= ORMSupport.default_system
|
76
|
-
case sys.to_sym
|
77
|
-
when :rails, :ar, :activerecord
|
78
|
-
to_s.underscore.plural
|
79
|
-
when :nitro, :og
|
80
|
-
to_s.gsub(/::/, '_').downcase
|
81
|
-
else
|
82
|
-
to_s.gsub(/::/, '_').downcase
|
83
|
-
end
|
84
|
-
end
|
85
|
-
alias_method :table_name, :tablename # a la Rails
|
86
|
-
alias_method :tableize, :tablename # a la Rails
|
87
|
-
|
88
|
-
# Converts a table name into a class name.
|
89
|
-
#--
|
90
|
-
# Should this return the calculated name even if the class isn't found?
|
91
|
-
#++
|
92
|
-
def classname( sys=nil )
|
93
|
-
sys ||= ORMSupport.default_system
|
94
|
-
case sys.to_sym
|
95
|
-
when :rails, :ar, :activerecord
|
96
|
-
cn = to_s.singular.camelize
|
97
|
-
when :nitro, :og
|
98
|
-
cn = to_s.gsub(/_/, '::').camelize
|
99
|
-
else
|
100
|
-
cn = to_s.gsub(/_/, '::').camelize
|
101
|
-
end
|
102
|
-
k = findclass( cn )
|
103
|
-
return k.name if k
|
104
|
-
return cn
|
105
|
-
end
|
106
|
-
alias_method :class_name, :classname # a la Rails
|
107
|
-
|
108
|
-
# Like classname, but returns the actual class.
|
109
|
-
#--
|
110
|
-
# TODO Error if not found?
|
111
|
-
#++
|
112
|
-
def classify( sys=:og )
|
113
|
-
findclass( classname( sys ) )
|
114
|
-
end
|
115
|
-
|
116
|
-
def findclass( str )
|
117
|
-
str = str.gsub(/^::/,'')
|
118
|
-
k = nil
|
119
|
-
ObjectSpace.each_object(Class) { |c| (k = c; break) if c.name.downcase == str.downcase }
|
120
|
-
return k
|
121
|
-
end
|
122
|
-
private :findclass
|
123
|
-
|
124
|
-
|
125
|
-
# This is good for generating database key/id field names from class names.
|
126
|
-
# In essense, it demodulizes, underscores and appends 'id'.
|
127
|
-
def keyname( key=nil )
|
128
|
-
key ||= ORMSupport.default_key
|
129
|
-
case key.to_sym
|
130
|
-
when :_id
|
131
|
-
self.basename.underscore + "_id"
|
132
|
-
when :id
|
133
|
-
self.basename.underscore + "id"
|
134
|
-
when :_key
|
135
|
-
self.basename.underscore + "_key"
|
136
|
-
when :key
|
137
|
-
self.basename.underscore + "key"
|
138
|
-
else
|
139
|
-
self.basename.underscore + ORMSupport.default_key
|
140
|
-
end
|
141
|
-
end
|
142
|
-
alias_method :key_name, :keyname # to be consistant
|
143
|
-
alias_method :foreign_key, :keyname # a la Rails
|
144
|
-
|
145
|
-
end
|
146
|
-
|
147
|
-
#--
|
148
|
-
|
149
|
-
class String
|
150
|
-
include ORMSupport
|
151
|
-
end
|
152
|
-
|
153
|
-
class Class
|
154
|
-
include ORMSupport
|
155
|
-
alias_method :demodulize, :basename # a la Rails
|
156
|
-
end
|
157
|
-
|
158
|
-
#++
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
# _____ _
|
163
|
-
# |_ _|__ ___| |_
|
164
|
-
# | |/ _ \/ __| __|
|
165
|
-
# | | __/\__ \ |_
|
166
|
-
# |_|\___||___/\__|
|
167
|
-
#
|
168
|
-
|
169
|
-
=begin #testing
|
170
|
-
|
171
|
-
require 'test/unit'
|
172
|
-
|
173
|
-
# fixtures
|
174
|
-
|
175
|
-
class Vendor
|
176
|
-
end
|
177
|
-
|
178
|
-
module MockMod
|
179
|
-
class Customer
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
# test
|
184
|
-
|
185
|
-
class TC_ORMSupport < Test::Unit::TestCase
|
186
|
-
|
187
|
-
# tablename
|
188
|
-
|
189
|
-
def test_tablename
|
190
|
-
assert_equal( 'vendor', "Vendor".tablename )
|
191
|
-
assert_equal( 'mockmod_customer', "MockMod::Customer".tablename )
|
192
|
-
end
|
193
|
-
|
194
|
-
# tableize
|
195
|
-
|
196
|
-
def test_tableize
|
197
|
-
assert_equal( 'vendor', "Vendor".tableize )
|
198
|
-
assert_equal( 'mockmod_customer', "MockMod::Customer".tableize )
|
199
|
-
end
|
200
|
-
|
201
|
-
# classname
|
202
|
-
|
203
|
-
def test_classname
|
204
|
-
assert_equal( 'Vendor', "vendor".classname )
|
205
|
-
assert_equal( 'MockMod::Customer', "mockmod_customer".classname, :none )
|
206
|
-
end
|
207
|
-
|
208
|
-
# classify
|
209
|
-
|
210
|
-
def test_classify
|
211
|
-
assert_equal( Vendor, "vendor".classify )
|
212
|
-
assert_equal( MockMod::Customer, "mockmod_customer".classify )
|
213
|
-
end
|
214
|
-
|
215
|
-
# keyname
|
216
|
-
|
217
|
-
def test_keyname
|
218
|
-
assert_equal( 'vendor_id', "Vendor".keyname )
|
219
|
-
assert_equal( 'customer_id', "MockMod::Customer".keyname )
|
220
|
-
assert_equal( 'customerid', "MockMod::Customer".keyname( :id ) )
|
221
|
-
end
|
222
|
-
|
223
|
-
# foriegn_key (same as keyname)
|
224
|
-
|
225
|
-
def test_foriegn_key
|
226
|
-
assert_equal( 'vendor_id', "Vendor".foreign_key )
|
227
|
-
assert_equal( 'customer_id', "MockMod::Customer".foreign_key )
|
228
|
-
assert_equal( 'customerid', "MockMod::Customer".foreign_key( :id ) )
|
229
|
-
end
|
230
|
-
|
231
|
-
end
|
232
|
-
|
233
|
-
=end
|