facets 1.8.49 → 1.8.51
Sign up to get free protection for your applications and to get access to all the features.
- data/PROJECT +4 -1
- data/Rakefile +25 -48
- data/VERSION +1 -1
- data/doc/AUTHORS +1 -0
- data/doc/CHANGES +6 -0
- data/lib/facets/core/kernel/tap.rb +33 -3
- data/lib/facets/more/command.rb +507 -271
- metadata +2 -548
- data/test/lib/facets/core/array/test_at_rand.rb +0 -34
- data/test/lib/facets/core/array/test_delete_unless.rb +0 -28
- data/test/lib/facets/core/array/test_delete_values.rb +0 -28
- data/test/lib/facets/core/array/test_delete_values_at.rb +0 -31
- data/test/lib/facets/core/array/test_first.rb +0 -46
- data/test/lib/facets/core/array/test_head.rb +0 -42
- data/test/lib/facets/core/array/test_last_index.rb +0 -26
- data/test/lib/facets/core/array/test_merge.rb +0 -35
- data/test/lib/facets/core/array/test_mid.rb +0 -33
- data/test/lib/facets/core/array/test_middle.rb +0 -29
- data/test/lib/facets/core/array/test_op_div.rb +0 -27
- data/test/lib/facets/core/array/test_op_fetch.rb +0 -35
- data/test/lib/facets/core/array/test_pad.rb +0 -48
- data/test/lib/facets/core/array/test_pick.rb +0 -40
- data/test/lib/facets/core/array/test_pos.rb +0 -28
- data/test/lib/facets/core/array/test_pot.rb +0 -28
- data/test/lib/facets/core/array/test_pull.rb +0 -28
- data/test/lib/facets/core/array/test_rand_index.rb +0 -29
- data/test/lib/facets/core/array/test_rand_subset.rb +0 -29
- data/test/lib/facets/core/array/test_range.rb +0 -32
- data/test/lib/facets/core/array/test_rotate.rb +0 -36
- data/test/lib/facets/core/array/test_select.rb +0 -28
- data/test/lib/facets/core/array/test_shuffle.rb +0 -35
- data/test/lib/facets/core/array/test_thru.rb +0 -27
- data/test/lib/facets/core/array/test_to_b.rb +0 -27
- data/test/lib/facets/core/array/test_to_h.rb +0 -33
- data/test/lib/facets/core/array/test_to_hash.rb +0 -27
- data/test/lib/facets/core/binding/self/test_of_caller.rb +0 -35
- data/test/lib/facets/core/binding/test___LINE__.rb +0 -43
- data/test/lib/facets/core/binding/test_call_stack.rb +0 -34
- data/test/lib/facets/core/binding/test_called.rb +0 -30
- data/test/lib/facets/core/binding/test_caller.rb +0 -35
- data/test/lib/facets/core/binding/test_defined.rb +0 -34
- data/test/lib/facets/core/binding/test_eval.rb +0 -34
- data/test/lib/facets/core/binding/test_local_variables.rb +0 -34
- data/test/lib/facets/core/binding/test_method_name.rb +0 -34
- data/test/lib/facets/core/binding/test_op_fetch.rb +0 -34
- data/test/lib/facets/core/binding/test_op_store.rb +0 -35
- data/test/lib/facets/core/binding/test_self.rb +0 -34
- data/test/lib/facets/core/class/test_cattr.rb +0 -63
- data/test/lib/facets/core/class/test_descendents.rb +0 -30
- data/test/lib/facets/core/class/test_method_name.rb +0 -26
- data/test/lib/facets/core/class/test_remove_descendents.rb +0 -32
- data/test/lib/facets/core/class/test_unix_path.rb +0 -26
- data/test/lib/facets/core/comparable/test_at_least.rb +0 -34
- data/test/lib/facets/core/comparable/test_clip.rb +0 -44
- data/test/lib/facets/core/comparable/test_cmp.rb +0 -28
- data/test/lib/facets/core/continuation/self/test_create.rb +0 -26
- data/test/lib/facets/core/date/test_days_in_month.rb +0 -30
- data/test/lib/facets/core/date/test_days_of_month.rb +0 -30
- data/test/lib/facets/core/date/test_stamp.rb +0 -38
- data/test/lib/facets/core/date/test_to_date.rb +0 -30
- data/test/lib/facets/core/date/test_to_s.rb +0 -30
- data/test/lib/facets/core/date/test_to_time.rb +0 -30
- data/test/lib/facets/core/dir/self/test_ancestor.rb +0 -26
- data/test/lib/facets/core/dir/self/test_ascend.rb +0 -41
- data/test/lib/facets/core/enumerable/self/test_combinations.rb +0 -46
- data/test/lib/facets/core/enumerable/test_cart.rb +0 -49
- data/test/lib/facets/core/enumerable/test_collect_with_index.rb +0 -27
- data/test/lib/facets/core/enumerable/test_commonality.rb +0 -31
- data/test/lib/facets/core/enumerable/test_compact_collect.rb +0 -27
- data/test/lib/facets/core/enumerable/test_count.rb +0 -38
- data/test/lib/facets/core/enumerable/test_each_by.rb +0 -71
- data/test/lib/facets/core/enumerable/test_each_combination.rb +0 -29
- data/test/lib/facets/core/enumerable/test_each_pair.rb +0 -29
- data/test/lib/facets/core/enumerable/test_each_slice.rb +0 -57
- data/test/lib/facets/core/enumerable/test_each_unique_pair.rb +0 -29
- data/test/lib/facets/core/enumerable/test_eachn.rb +0 -34
- data/test/lib/facets/core/enumerable/test_elementwise.rb +0 -40
- data/test/lib/facets/core/enumerable/test_entropy.rb +0 -26
- data/test/lib/facets/core/enumerable/test_every.rb +0 -35
- data/test/lib/facets/core/enumerable/test_ew.rb +0 -31
- data/test/lib/facets/core/enumerable/test_filter_collect.rb +0 -31
- data/test/lib/facets/core/enumerable/test_find_collisions.rb +0 -30
- data/test/lib/facets/core/enumerable/test_frequency.rb +0 -27
- data/test/lib/facets/core/enumerable/test_graph.rb +0 -30
- data/test/lib/facets/core/enumerable/test_ideal_entropy.rb +0 -27
- data/test/lib/facets/core/enumerable/test_none.rb +0 -33
- data/test/lib/facets/core/enumerable/test_occur.rb +0 -30
- data/test/lib/facets/core/enumerable/test_one.rb +0 -35
- data/test/lib/facets/core/enumerable/test_op_pow.rb +0 -27
- data/test/lib/facets/core/enumerable/test_op_tilde_self.rb +0 -40
- data/test/lib/facets/core/enumerable/test_partition_by.rb +0 -31
- data/test/lib/facets/core/enumerable/test_permutation.rb +0 -29
- data/test/lib/facets/core/enumerable/test_probability.rb +0 -27
- data/test/lib/facets/core/enumerable/test_to_h.rb +0 -27
- data/test/lib/facets/core/enumerable/test_uniq_by.rb +0 -28
- data/test/lib/facets/core/file/self/test_create.rb +0 -44
- data/test/lib/facets/core/file/self/test_open_as_string.rb +0 -50
- data/test/lib/facets/core/file/self/test_read_list.rb +0 -40
- data/test/lib/facets/core/file/self/test_sanitize.rb +0 -46
- data/test/lib/facets/core/file/self/test_split_all.rb +0 -27
- data/test/lib/facets/core/float/test_round_at.rb +0 -46
- data/test/lib/facets/core/float/test_round_to.rb +0 -46
- data/test/lib/facets/core/hash/self/test_zipnew.rb +0 -28
- data/test/lib/facets/core/hash/test_alias.rb +0 -31
- data/test/lib/facets/core/hash/test_assert_has_keys.rb +0 -27
- data/test/lib/facets/core/hash/test_assert_has_only_keys.rb +0 -27
- data/test/lib/facets/core/hash/test_at.rb +0 -28
- data/test/lib/facets/core/hash/test_collate.rb +0 -35
- data/test/lib/facets/core/hash/test_each_with_index.rb +0 -29
- data/test/lib/facets/core/hash/test_each_with_key.rb +0 -29
- data/test/lib/facets/core/hash/test_graph.rb +0 -28
- data/test/lib/facets/core/hash/test_has_keys.rb +0 -27
- data/test/lib/facets/core/hash/test_has_only_keys.rb +0 -27
- data/test/lib/facets/core/hash/test_inverse.rb +0 -30
- data/test/lib/facets/core/hash/test_normalize_keys.rb +0 -34
- data/test/lib/facets/core/hash/test_op_fetch.rb +0 -111
- data/test/lib/facets/core/hash/test_op_lshift.rb +0 -29
- data/test/lib/facets/core/hash/test_rand_key.rb +0 -27
- data/test/lib/facets/core/hash/test_rand_pair.rb +0 -27
- data/test/lib/facets/core/hash/test_rand_value.rb +0 -27
- data/test/lib/facets/core/hash/test_rekey.rb +0 -52
- data/test/lib/facets/core/hash/test_replace_each.rb +0 -29
- data/test/lib/facets/core/hash/test_shuffle.rb +0 -32
- data/test/lib/facets/core/hash/test_slice.rb +0 -27
- data/test/lib/facets/core/hash/test_stringify_keys.rb +0 -34
- data/test/lib/facets/core/hash/test_swap.rb +0 -27
- data/test/lib/facets/core/hash/test_swapkey.rb +0 -29
- data/test/lib/facets/core/hash/test_symbolize_keys.rb +0 -34
- data/test/lib/facets/core/hash/test_to_h.rb +0 -27
- data/test/lib/facets/core/hash/test_to_ostruct.rb +0 -30
- data/test/lib/facets/core/hash/test_to_ostruct_recurse.rb +0 -44
- data/test/lib/facets/core/hash/test_traverse.rb +0 -37
- data/test/lib/facets/core/hash/test_update_each.rb +0 -29
- data/test/lib/facets/core/hash/test_update_keys.rb +0 -28
- data/test/lib/facets/core/hash/test_update_values.rb +0 -28
- data/test/lib/facets/core/hash/test_weave.rb +0 -29
- data/test/lib/facets/core/integer/test_factorial.rb +0 -30
- data/test/lib/facets/core/integer/test_multiple.rb +0 -43
- data/test/lib/facets/core/integer/test_of.rb +0 -28
- data/test/lib/facets/core/integer/test_ordinal.rb +0 -29
- data/test/lib/facets/core/integer/test_times_collect.rb +0 -28
- data/test/lib/facets/core/kernel/test___class__.rb +0 -26
- data/test/lib/facets/core/kernel/test_as.rb +0 -42
- data/test/lib/facets/core/kernel/test_assign_from.rb +0 -31
- data/test/lib/facets/core/kernel/test_assign_with.rb +0 -31
- data/test/lib/facets/core/kernel/test_bool.rb +0 -41
- data/test/lib/facets/core/kernel/test_bug.rb +0 -26
- data/test/lib/facets/core/kernel/test_call_stack.rb +0 -26
- data/test/lib/facets/core/kernel/test_called.rb +0 -26
- data/test/lib/facets/core/kernel/test_callee.rb +0 -26
- data/test/lib/facets/core/kernel/test_constant.rb +0 -33
- data/test/lib/facets/core/kernel/test_copy.rb +0 -40
- data/test/lib/facets/core/kernel/test_deep_copy.rb +0 -40
- data/test/lib/facets/core/kernel/test_demo.rb +0 -28
- data/test/lib/facets/core/kernel/test_fn.rb +0 -26
- data/test/lib/facets/core/kernel/test_get_by_id.rb +0 -28
- data/test/lib/facets/core/kernel/test_here.rb +0 -26
- data/test/lib/facets/core/kernel/test_in.rb +0 -27
- data/test/lib/facets/core/kernel/test_instance_class.rb +0 -27
- data/test/lib/facets/core/kernel/test_instance_exec.rb +0 -58
- data/test/lib/facets/core/kernel/test_maybe.rb +0 -26
- data/test/lib/facets/core/kernel/test_meta_class.rb +0 -27
- data/test/lib/facets/core/kernel/test_metaclass.rb +0 -27
- data/test/lib/facets/core/kernel/test_method.rb +0 -32
- data/test/lib/facets/core/kernel/test_methods.rb +0 -50
- data/test/lib/facets/core/kernel/test_new.rb +0 -30
- data/test/lib/facets/core/kernel/test_object_class.rb +0 -26
- data/test/lib/facets/core/kernel/test_object_hexid.rb +0 -27
- data/test/lib/facets/core/kernel/test_qua_class.rb +0 -27
- data/test/lib/facets/core/kernel/test_require_all.rb +0 -26
- data/test/lib/facets/core/kernel/test_require_esc.rb +0 -27
- data/test/lib/facets/core/kernel/test_resc.rb +0 -27
- data/test/lib/facets/core/kernel/test_send_as.rb +0 -26
- data/test/lib/facets/core/kernel/test_set_from.rb +0 -33
- data/test/lib/facets/core/kernel/test_set_with.rb +0 -42
- data/test/lib/facets/core/kernel/test_silently.rb +0 -28
- data/test/lib/facets/core/kernel/test_singleton.rb +0 -40
- data/test/lib/facets/core/kernel/test_singleton_class.rb +0 -27
- data/test/lib/facets/core/kernel/test_super_at.rb +0 -30
- data/test/lib/facets/core/kernel/test_supermethod.rb +0 -33
- data/test/lib/facets/core/kernel/test_this.rb +0 -26
- data/test/lib/facets/core/kernel/test_to_b.rb +0 -28
- data/test/lib/facets/core/kernel/test_to_bool.rb +0 -28
- data/test/lib/facets/core/kernel/test_to_data.rb +0 -61
- data/test/lib/facets/core/kernel/test_uri.rb +0 -30
- data/test/lib/facets/core/kernel/test_val.rb +0 -43
- data/test/lib/facets/core/kernel/test_with.rb +0 -30
- data/test/lib/facets/core/kernel/test_with_accessor.rb +0 -51
- data/test/lib/facets/core/matchdata/test_match.rb +0 -29
- data/test/lib/facets/core/matchdata/test_matchtree.rb +0 -37
- data/test/lib/facets/core/module/self/test_op_add.rb +0 -50
- data/test/lib/facets/core/module/test_abstract.rb +0 -36
- data/test/lib/facets/core/module/test_alias_method_chain.rb +0 -46
- data/test/lib/facets/core/module/test_alias_module_function.rb +0 -34
- data/test/lib/facets/core/module/test_ancestor.rb +0 -26
- data/test/lib/facets/core/module/test_attr_tester.rb +0 -39
- data/test/lib/facets/core/module/test_basename.rb +0 -26
- data/test/lib/facets/core/module/test_by_name.rb +0 -29
- data/test/lib/facets/core/module/test_class_extension.rb +0 -70
- data/test/lib/facets/core/module/test_clone_using.rb +0 -55
- data/test/lib/facets/core/module/test_dirname.rb +0 -26
- data/test/lib/facets/core/module/test_equate_on.rb +0 -37
- data/test/lib/facets/core/module/test_include_as.rb +0 -45
- data/test/lib/facets/core/module/test_initializer.rb +0 -32
- data/test/lib/facets/core/module/test_instance_methods.rb +0 -59
- data/test/lib/facets/core/module/test_integrate.rb +0 -35
- data/test/lib/facets/core/module/test_memoize.rb +0 -50
- data/test/lib/facets/core/module/test_modspace.rb +0 -27
- data/test/lib/facets/core/module/test_namespace.rb +0 -66
- data/test/lib/facets/core/module/test_nesting.rb +0 -36
- data/test/lib/facets/core/module/test_new.rb +0 -34
- data/test/lib/facets/core/module/test_nodef.rb +0 -30
- data/test/lib/facets/core/module/test_on_included.rb +0 -36
- data/test/lib/facets/core/module/test_redef.rb +0 -30
- data/test/lib/facets/core/module/test_redefine_method.rb +0 -30
- data/test/lib/facets/core/module/test_redirect.rb +0 -30
- data/test/lib/facets/core/module/test_redirect_method.rb +0 -30
- data/test/lib/facets/core/module/test_remove.rb +0 -30
- data/test/lib/facets/core/module/test_rename.rb +0 -31
- data/test/lib/facets/core/module/test_rename_method.rb +0 -31
- data/test/lib/facets/core/module/test_revisal.rb +0 -35
- data/test/lib/facets/core/module/test_shadow_method.rb +0 -30
- data/test/lib/facets/core/module/test_sort_on.rb +0 -42
- data/test/lib/facets/core/module/test_this.rb +0 -31
- data/test/lib/facets/core/module/test_wrap.rb +0 -30
- data/test/lib/facets/core/module/test_wrap_method.rb +0 -30
- data/test/lib/facets/core/nilclass/test_blank.rb +0 -26
- data/test/lib/facets/core/nilclass/test_empty.rb +0 -26
- data/test/lib/facets/core/nilclass/test_include.rb +0 -26
- data/test/lib/facets/core/nilclass/test_op_fetch.rb +0 -28
- data/test/lib/facets/core/nilclass/test_size.rb +0 -30
- data/test/lib/facets/core/nilclass/test_to_h.rb +0 -26
- data/test/lib/facets/core/numeric/test_approx.rb +0 -29
- data/test/lib/facets/core/numeric/test_ceil_multiple.rb +0 -31
- data/test/lib/facets/core/numeric/test_distance.rb +0 -28
- data/test/lib/facets/core/numeric/test_succ.rb +0 -40
- data/test/lib/facets/core/numeric/test_to_b.rb +0 -27
- data/test/lib/facets/core/ostruct/test___update__.rb +0 -45
- data/test/lib/facets/core/ostruct/test_instance_delegate.rb +0 -36
- data/test/lib/facets/core/ostruct/test_op_fetch.rb +0 -33
- data/test/lib/facets/core/proc/test_compose.rb +0 -29
- data/test/lib/facets/core/proc/test_op_mul.rb +0 -34
- data/test/lib/facets/core/proc/test_to_method.rb +0 -44
- data/test/lib/facets/core/range/test_to_r.rb +0 -27
- data/test/lib/facets/core/range/test_to_range.rb +0 -27
- data/test/lib/facets/core/range/test_umbrella.rb +0 -34
- data/test/lib/facets/core/range/test_within.rb +0 -29
- data/test/lib/facets/core/regexp/test_arity.rb +0 -33
- data/test/lib/facets/core/regexp/test_to_re.rb +0 -27
- data/test/lib/facets/core/regexp/test_to_regexp.rb +0 -27
- data/test/lib/facets/core/string/self/test_interpolate.rb +0 -27
- data/test/lib/facets/core/string/self/test_patterns.rb +0 -28
- data/test/lib/facets/core/string/self/test_rand_letter.rb +0 -26
- data/test/lib/facets/core/string/test_align_center.rb +0 -34
- data/test/lib/facets/core/string/test_at_rand.rb +0 -35
- data/test/lib/facets/core/string/test_basename.rb +0 -41
- data/test/lib/facets/core/string/test_blank.rb +0 -27
- data/test/lib/facets/core/string/test_bracket.rb +0 -49
- data/test/lib/facets/core/string/test_bytes.rb +0 -25
- data/test/lib/facets/core/string/test_camelcase.rb +0 -39
- data/test/lib/facets/core/string/test_camelize.rb +0 -26
- data/test/lib/facets/core/string/test_capitalize_all.rb +0 -26
- data/test/lib/facets/core/string/test_capitalized.rb +0 -26
- data/test/lib/facets/core/string/test_chars.rb +0 -27
- data/test/lib/facets/core/string/test_cleave.rb +0 -43
- data/test/lib/facets/core/string/test_cmp.rb +0 -30
- data/test/lib/facets/core/string/test_demodulize.rb +0 -38
- data/test/lib/facets/core/string/test_divide.rb +0 -29
- data/test/lib/facets/core/string/test_downcase.rb +0 -26
- data/test/lib/facets/core/string/test_dresner.rb +0 -32
- data/test/lib/facets/core/string/test_each_char.rb +0 -29
- data/test/lib/facets/core/string/test_each_word.rb +0 -29
- data/test/lib/facets/core/string/test_first.rb +0 -43
- data/test/lib/facets/core/string/test_fold.rb +0 -34
- data/test/lib/facets/core/string/test_humanize.rb +0 -26
- data/test/lib/facets/core/string/test_indent.rb +0 -40
- data/test/lib/facets/core/string/test_index_all.rb +0 -26
- data/test/lib/facets/core/string/test_last.rb +0 -46
- data/test/lib/facets/core/string/test_line_wrap.rb +0 -27
- data/test/lib/facets/core/string/test_lines.rb +0 -26
- data/test/lib/facets/core/string/test_lowercase.rb +0 -26
- data/test/lib/facets/core/string/test_margin.rb +0 -117
- data/test/lib/facets/core/string/test_methodize.rb +0 -27
- data/test/lib/facets/core/string/test_modulize.rb +0 -29
- data/test/lib/facets/core/string/test_mscan.rb +0 -30
- data/test/lib/facets/core/string/test_natcmp.rb +0 -30
- data/test/lib/facets/core/string/test_nchar.rb +0 -29
- data/test/lib/facets/core/string/test_pathize.rb +0 -29
- data/test/lib/facets/core/string/test_pop.rb +0 -47
- data/test/lib/facets/core/string/test_pot.rb +0 -39
- data/test/lib/facets/core/string/test_push.rb +0 -40
- data/test/lib/facets/core/string/test_quote.rb +0 -49
- data/test/lib/facets/core/string/test_rand_byte.rb +0 -35
- data/test/lib/facets/core/string/test_rand_index.rb +0 -26
- data/test/lib/facets/core/string/test_range.rb +0 -27
- data/test/lib/facets/core/string/test_range_all.rb +0 -27
- data/test/lib/facets/core/string/test_range_of_line.rb +0 -28
- data/test/lib/facets/core/string/test_regesc.rb +0 -28
- data/test/lib/facets/core/string/test_shatter.rb +0 -29
- data/test/lib/facets/core/string/test_shift.rb +0 -40
- data/test/lib/facets/core/string/test_shuffle.rb +0 -27
- data/test/lib/facets/core/string/test_similarity.rb +0 -26
- data/test/lib/facets/core/string/test_singular.rb +0 -86
- data/test/lib/facets/core/string/test_soundex.rb +0 -41
- data/test/lib/facets/core/string/test_succ.rb +0 -29
- data/test/lib/facets/core/string/test_to_a.rb +0 -27
- data/test/lib/facets/core/string/test_to_b.rb +0 -41
- data/test/lib/facets/core/string/test_to_const.rb +0 -28
- data/test/lib/facets/core/string/test_to_date.rb +0 -30
- data/test/lib/facets/core/string/test_to_proc.rb +0 -33
- data/test/lib/facets/core/string/test_to_re.rb +0 -28
- data/test/lib/facets/core/string/test_to_time.rb +0 -30
- data/test/lib/facets/core/string/test_unix_crypt.rb +0 -30
- data/test/lib/facets/core/string/test_unpack.rb +0 -34
- data/test/lib/facets/core/string/test_unshift.rb +0 -39
- data/test/lib/facets/core/string/test_upcase.rb +0 -30
- data/test/lib/facets/core/string/test_whitespace.rb +0 -27
- data/test/lib/facets/core/string/test_word_filter.rb +0 -34
- data/test/lib/facets/core/string/test_word_wrap.rb +0 -51
- data/test/lib/facets/core/string/test_words.rb +0 -37
- data/test/lib/facets/core/symbol/test_camelcase.rb +0 -26
- data/test/lib/facets/core/symbol/test_camelize.rb +0 -27
- data/test/lib/facets/core/symbol/test_capitalize.rb +0 -26
- data/test/lib/facets/core/symbol/test_capitalized.rb +0 -27
- data/test/lib/facets/core/symbol/test_downcase.rb +0 -27
- data/test/lib/facets/core/symbol/test_not.rb +0 -29
- data/test/lib/facets/core/symbol/test_pad.rb +0 -27
- data/test/lib/facets/core/symbol/test_succ.rb +0 -28
- data/test/lib/facets/core/symbol/test_to_const.rb +0 -28
- data/test/lib/facets/core/symbol/test_to_proc.rb +0 -33
- data/test/lib/facets/core/symbol/test_to_str.rb +0 -28
- data/test/lib/facets/core/symbol/test_underscore.rb +0 -26
- data/test/lib/facets/core/symbol/test_upcase.rb +0 -27
- data/test/lib/facets/core/time/test_change.rb +0 -33
- data/test/lib/facets/core/time/test_elapse.rb +0 -27
- data/test/lib/facets/core/time/test_stamp.rb +0 -39
- data/test/lib/facets/core/time/test_to_date.rb +0 -31
- data/test/lib/facets/core/time/test_to_s.rb +0 -31
- data/test/lib/facets/core/time/test_to_time.rb +0 -31
- data/test/lib/facets/more/test_ann.rb +0 -112
- data/test/lib/facets/more/test_ann_attr.rb +0 -39
- data/test/lib/facets/more/test_ansicode.rb +0 -36
- data/test/lib/facets/more/test_arguments.rb +0 -83
- data/test/lib/facets/more/test_association.rb +0 -51
- data/test/lib/facets/more/test_autoarray.rb +0 -32
- data/test/lib/facets/more/test_basicobject.rb +0 -67
- data/test/lib/facets/more/test_bbcode.rb +0 -34
- data/test/lib/facets/more/test_binaryreader.rb +0 -64
- data/test/lib/facets/more/test_bitmask.rb +0 -47
- data/test/lib/facets/more/test_buildingblock.rb +0 -48
- data/test/lib/facets/more/test_bytes.rb +0 -84
- data/test/lib/facets/more/test_classmethods.rb +0 -69
- data/test/lib/facets/more/test_command.rb +0 -69
- data/test/lib/facets/more/test_coroutine.rb +0 -60
- data/test/lib/facets/more/test_crypt.rb +0 -46
- data/test/lib/facets/more/test_cut.rb +0 -198
- data/test/lib/facets/more/test_dependency.rb +0 -82
- data/test/lib/facets/more/test_dictionary.rb +0 -107
- data/test/lib/facets/more/test_elementor.rb +0 -52
- data/test/lib/facets/more/test_enumerablepass.rb +0 -86
- data/test/lib/facets/more/test_floatstring.rb +0 -36
- data/test/lib/facets/more/test_functor.rb +0 -39
- data/test/lib/facets/more/test_htmlbuilder.rb +0 -38
- data/test/lib/facets/more/test_htmlfilter.rb +0 -86
- data/test/lib/facets/more/test_infinity.rb +0 -50
- data/test/lib/facets/more/test_inheritor.rb +0 -155
- data/test/lib/facets/more/test_instance_intercept.rb +0 -50
- data/test/lib/facets/more/test_interval.rb +0 -119
- data/test/lib/facets/more/test_json.rb +0 -232
- data/test/lib/facets/more/test_linkedlist.rb +0 -53
- data/test/lib/facets/more/test_lisp.rb +0 -47
- data/test/lib/facets/more/test_lisp_format.rb +0 -37
- data/test/lib/facets/more/test_lrucache.rb +0 -25
- data/test/lib/facets/more/test_mathconstants.rb +0 -18
- data/test/lib/facets/more/test_methodfilter.rb +0 -45
- data/test/lib/facets/more/test_methodprobe.rb +0 -53
- data/test/lib/facets/more/test_multipliers.rb +0 -114
- data/test/lib/facets/more/test_multiton.rb +0 -199
- data/test/lib/facets/more/test_nackclass.rb +0 -45
- data/test/lib/facets/more/test_nilcomparable.rb +0 -47
- data/test/lib/facets/more/test_opencascade.rb +0 -75
- data/test/lib/facets/more/test_openobject.rb +0 -126
- data/test/lib/facets/more/test_overload.rb +0 -54
- data/test/lib/facets/more/test_paramix.rb +0 -100
- data/test/lib/facets/more/test_pqueue.rb +0 -39
- data/test/lib/facets/more/test_preinitialize.rb +0 -49
- data/test/lib/facets/more/test_promoteself.rb +0 -45
- data/test/lib/facets/more/test_recorder.rb +0 -44
- data/test/lib/facets/more/test_snapshot.rb +0 -34
- data/test/lib/facets/more/test_statichash.rb +0 -31
- data/test/lib/facets/more/test_syncarray.rb +0 -28
- data/test/lib/facets/more/test_synchash.rb +0 -28
- data/test/lib/facets/more/test_tagiterator.rb +0 -93
- data/test/lib/facets/more/test_timer.rb +0 -66
- data/test/lib/facets/more/test_times.rb +0 -103
- data/test/lib/facets/more/test_tuple.rb +0 -64
- data/test/lib/facets/more/test_typecast.rb +0 -68
- data/test/lib/facets/more/test_uninheritable.rb +0 -42
- data/test/lib/facets/more/test_units.rb +0 -111
- data/test/lib/facets/more/test_xmlbuilder.rb +0 -54
- data/test/lib/facets/more/test_xmlhelper.rb +0 -40
- data/test/lib/facets/more/test_xoxo.rb +0 -288
- data/test/lib/facets/more/test_yamlstruct.rb +0 -37
- data/test/lib/facets/yore/enumerable/test_cross.rb +0 -44
- data/test/lib/facets/yore/kernel/test_require_facet.rb +0 -27
- data/test/lib/facets/yore/module/test_namespace.rb +0 -33
- data/test/lib/facets/yore/test_annattr.rb +0 -39
- data/test/lib/facets/yore/test_annotation.rb +0 -318
- data/work/README +0 -42
- data/work/TODO +0 -73
- data/work/bin/minitar +0 -3
- data/work/bin/minitar.rb +0 -814
- data/work/core/array/at_rand.rb +0 -95
- data/work/core/array/each_slice.rb +0 -23
- data/work/core/array/pick_values.rb +0 -32
- data/work/core/array/rand_indexes.rb +0 -33
- data/work/core/binding/class.rb +0 -11
- data/work/core/binding/delegate-binding.rb +0 -19
- data/work/core/binding/delegate.rb +0 -15
- data/work/core/binding/proc.rb +0 -6
- data/work/core/class/to_module.rb +0 -3
- data/work/core/enumerable/op_fetch.rb +0 -30
- data/work/core/fileutils/cptouch.rb +0 -20
- data/work/core/fileutils/nl_convert.rb +0 -133
- data/work/core/io/expect.rb +0 -127
- data/work/core/join_with.rb +0 -13
- data/work/core/kernel/call_line.rb +0 -15
- data/work/core/kernel/does.rb +0 -7
- data/work/core/kernel/message.rb +0 -6
- data/work/core/kernel/query.rb +0 -15
- data/work/core/kernel/taint.rb +0 -10
- data/work/core/logger/clean_logger.rb +0 -10
- data/work/core/module/attr-old.rb +0 -308
- data/work/core/module/attr.rb +0 -98
- data/work/core/module/attr_xxx.rb +0 -22
- data/work/core/module/by_regexp.rb +0 -21
- data/work/core/module/cast.rb +0 -64
- data/work/core/module/class_attribute_accessors.rb +0 -57
- data/work/core/module/inherit.rb +0 -99
- data/work/core/module/inherit0.rb +0 -59
- data/work/core/module/let.rb +0 -51
- data/work/core/module/meta_attr.rb +0 -60
- data/work/core/module/module_attribute_accessors.rb +0 -57
- data/work/core/module/permissions.rb +0 -32
- data/work/core/module/preserved.rb +0 -108
- data/work/core/module/sattr_accessor.rb +0 -1
- data/work/core/module/sattr_reader.rb +0 -1
- data/work/core/module/sattr_setter.rb +0 -1
- data/work/core/module/sattr_tester.rb +0 -1
- data/work/core/module/sattr_writer.rb +0 -1
- data/work/core/module/tc_attr.rb +0 -107
- data/work/core/module/to_module.rb +0 -37
- data/work/core/module/version.rb +0 -23
- data/work/core/string/frequency.rb +0 -40
- data/work/core/string/op_add.rb +0 -24
- data/work/core/string/op_div.rb +0 -15
- data/work/core/string/pred.rb +0 -217
- data/work/core/string/probability.rb +0 -35
- data/work/core/string/succ_distance.rb +0 -112
- data/work/core/string/to_arr.rb +0 -57
- data/work/core/string/to_ary.rb +0 -12
- data/work/core/string/word_wrap.rb +0 -62
- data/work/hash_open.rb +0 -23
- data/work/misc/calibre/ProjectInfo.annotation +0 -46
- data/work/misc/calibre/ProjectInfo.ansicode +0 -33
- data/work/misc/calibre/ProjectInfo.association +0 -34
- data/work/misc/calibre/ProjectInfo.basicobject +0 -36
- data/work/misc/calibre/ProjectInfo.bbcode +0 -34
- data/work/misc/calibre/ProjectInfo.binaryreader +0 -35
- data/work/misc/calibre/ProjectInfo.bitmask +0 -33
- data/work/misc/calibre/ProjectInfo.classinherit +0 -36
- data/work/misc/calibre/ProjectInfo.classmethods +0 -36
- data/work/misc/calibre/ProjectInfo.cloneable +0 -33
- data/work/misc/calibre/ProjectInfo.consoleapp +0 -35
- data/work/misc/calibre/ProjectInfo.coroutine +0 -37
- data/work/misc/calibre/ProjectInfo.crypt +0 -33
- data/work/misc/calibre/ProjectInfo.dictionary +0 -40
- data/work/misc/calibre/ProjectInfo.downloader +0 -39
- data/work/misc/calibre/ProjectInfo.enumerablepass +0 -35
- data/work/misc/calibre/ProjectInfo.expirable +0 -37
- data/work/misc/calibre/ProjectInfo.floatstring +0 -35
- data/work/misc/calibre/ProjectInfo.functor +0 -40
- data/work/misc/calibre/ProjectInfo.heap +0 -33
- data/work/misc/calibre/ProjectInfo.inheritor +0 -36
- data/work/misc/calibre/ProjectInfo.interval +0 -36
- data/work/misc/calibre/ProjectInfo.lisp +0 -38
- data/work/misc/calibre/ProjectInfo.lrucache +0 -34
- data/work/misc/calibre/ProjectInfo.mathconstants +0 -41
- data/work/misc/calibre/ProjectInfo.methodprobe +0 -38
- data/work/misc/calibre/ProjectInfo.mock +0 -34
- data/work/misc/calibre/ProjectInfo.multiton +0 -36
- data/work/misc/calibre/ProjectInfo.nackclass +0 -33
- data/work/misc/calibre/ProjectInfo.nilcomparable +0 -35
- data/work/misc/calibre/ProjectInfo.nullclass +0 -35
- data/work/misc/calibre/ProjectInfo.one +0 -37
- data/work/misc/calibre/ProjectInfo.openobject +0 -39
- data/work/misc/calibre/ProjectInfo.paramix +0 -38
- data/work/misc/calibre/ProjectInfo.pool +0 -33
- data/work/misc/calibre/ProjectInfo.progressbar +0 -37
- data/work/misc/calibre/ProjectInfo.reference +0 -36
- data/work/misc/calibre/ProjectInfo.semaphore +0 -36
- data/work/misc/calibre/ProjectInfo.stateparser +0 -39
- data/work/misc/calibre/ProjectInfo.statichash +0 -33
- data/work/misc/calibre/ProjectInfo.system +0 -34
- data/work/misc/calibre/ProjectInfo.tagiterator +0 -36
- data/work/misc/calibre/ProjectInfo.timer +0 -35
- data/work/misc/calibre/ProjectInfo.tracepoint +0 -37
- data/work/misc/calibre/ProjectInfo.tuple +0 -36
- data/work/misc/calibre/ProjectInfo.uniheritable +0 -34
- data/work/misc/calibre/ProjectInfo.units +0 -34
- data/work/misc/calibre/ProjectInfo.yamlstruct +0 -34
- data/work/more/annotation-rw.rb +0 -217
- data/work/more/aobject.rb +0 -132
- data/work/more/autohash.rb +0 -67
- data/work/more/cache.rb +0 -189
- data/work/more/class_inheritable_attributes.rb +0 -120
- data/work/more/commandrunner.rb +0 -101
- data/work/more/daemon.rb +0 -70
- data/work/more/debugger.rb +0 -167
- data/work/more/detach.rb +0 -423
- data/work/more/enumtype.rb +0 -115
- data/work/more/ioreactor.rb +0 -671
- data/work/more/logger_sing.rb +0 -207
- data/work/more/must.rb +0 -37
- data/work/more/old-tkxml.rb +0 -189
- data/work/more/pairhash.rb +0 -55
- data/work/more/password.rb +0 -80
- data/work/more/print_exception.rb +0 -35
- data/work/more/rand.rb +0 -412
- data/work/more/range.rb +0 -383
- data/work/more/sanitize.rb +0 -48
- data/work/more/superstruct.rb +0 -735
- data/work/more/tag.rb +0 -31
- data/work/more/timer.rb +0 -164
- data/work/op_rshift.rb +0 -87
- data/work/openobject-temp.rb +0 -45
- data/work/pore/autorequire.rb +0 -83
- data/work/pore/basefactory.rb +0 -40
- data/work/pore/hash/each.rb +0 -76
- data/work/pore/merge3.rb +0 -765
- data/work/pore/superann.rb +0 -134
- data/work/pore/sys.rb +0 -186
- data/work/pore/utils.rb +0 -518
- data/work/yore/HashAquisition.rb +0 -36
- data/work/yore/Rakefile.old +0 -181
- data/work/yore/Reapfile +0 -63
- data/work/yore/annotation.rb +0 -489
- data/work/yore/annotation2.rb +0 -466
- data/work/yore/commandutils.rb +0 -379
- data/work/yore/openobject.rb +0 -298
- data/work/yore/reap.rb +0 -184
- data/work/yore/reap.yml +0 -47
- data/work/yore/taskable-old.rb +0 -519
- data/work/yore/taskable.rb +0 -482
data/work/yore/HashAquisition.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'facets/core/hash/having_fallback'
|
2
|
-
|
3
|
-
class OpenAscend < OpenObject
|
4
|
-
|
5
|
-
def method_missing( sym, arg=nil )
|
6
|
-
type = sym.to_s[-1,1]
|
7
|
-
name = sym.to_s.gsub(/[=!?]$/, '').to_sym
|
8
|
-
if type == '='
|
9
|
-
self[name] = arg
|
10
|
-
elsif type == '!'
|
11
|
-
self[name] = arg
|
12
|
-
self
|
13
|
-
else
|
14
|
-
val = self[name]
|
15
|
-
val = object_class[val].fallback(self) if Hash === val
|
16
|
-
val
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
class HashWithAquisition < Hash
|
23
|
-
|
24
|
-
def [](key)
|
25
|
-
val = super
|
26
|
-
val.fallback(self) if Hash == val
|
27
|
-
val
|
28
|
-
end
|
29
|
-
|
30
|
-
def fetch(key,*args,&blk)
|
31
|
-
val = super
|
32
|
-
val.fallback(self) if Hash == val
|
33
|
-
val
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
data/work/yore/Rakefile.old
DELETED
@@ -1,181 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
#require 'uri'
|
4
|
-
require 'yaml'
|
5
|
-
require 'fileutils'
|
6
|
-
require './lib/facets/core/file/self/read_list'
|
7
|
-
|
8
|
-
require 'reap/rake'
|
9
|
-
|
10
|
-
DATPATH = "data/facets"
|
11
|
-
ETCPATH = "conf/facets"
|
12
|
-
REQPATH = "facets/core"
|
13
|
-
MTHPATH = "lib/facets/core"
|
14
|
-
GENPATH = "lib/facets/core"
|
15
|
-
|
16
|
-
|
17
|
-
task :default => [ :tasks ]
|
18
|
-
|
19
|
-
task :tasks do
|
20
|
-
Rake.application.options.show_task_pattern = //
|
21
|
-
Rake.application.display_tasks_and_comments
|
22
|
-
end
|
23
|
-
|
24
|
-
#-----------------------------------------------------
|
25
|
-
# Generate facet/
|
26
|
-
#-----------------------------------------------------
|
27
|
-
desc %{Build facet redirect directory}
|
28
|
-
task :redirect do
|
29
|
-
sh %{rm -R 'lib/facet'} if File.directory?('lib/facet')
|
30
|
-
print "Creating redirection facet/ files..."
|
31
|
-
['core','more'].each{ |d|
|
32
|
-
from = "lib/facets"
|
33
|
-
rbs = Dir.glob( File.join( from, d, '**/*.rb' ) )
|
34
|
-
rbs.each { |e|
|
35
|
-
nolib = e.gsub( /^lib\//, '' )
|
36
|
-
re = Regexp.new( Regexp.escape( File.join( from, d ) + '/' ) )
|
37
|
-
link = e.gsub( re, 'lib/facet/')
|
38
|
-
FileUtils.mkdir_p( File.dirname( link ) )
|
39
|
-
File.open( link, "w+" ) { |w|
|
40
|
-
w << "require '#{nolib}'"
|
41
|
-
}
|
42
|
-
}
|
43
|
-
}
|
44
|
-
puts "[done]"
|
45
|
-
end
|
46
|
-
|
47
|
-
#-----------------------------------------------------
|
48
|
-
# Read in the facets directory and sort-out per class
|
49
|
-
#-----------------------------------------------------
|
50
|
-
Methods = {}
|
51
|
-
task :methods do
|
52
|
-
Dir.chdir(MTHPATH) do
|
53
|
-
dg = Dir.glob('*/**/*.rb')
|
54
|
-
dg.each { |f|
|
55
|
-
klass, *meth= f.split('/')
|
56
|
-
Methods[ klass ] ||= []
|
57
|
-
Methods[ klass ] << "#{meth.join('/').chomp('.rb')}"
|
58
|
-
}
|
59
|
-
Methods.keys.each { |k| Methods[k].sort! }
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
#-----------------------------------------------------
|
64
|
-
# Save method index to file in yaml format
|
65
|
-
#-----------------------------------------------------
|
66
|
-
desc %{Generate method index file}
|
67
|
-
task :index => [ :methods ] do
|
68
|
-
print "Creating method index... "
|
69
|
-
loc = File.join( DATPATH, 'index.yml' )
|
70
|
-
File.open( loc, 'w' ) { |f|
|
71
|
-
f << Methods.to_yaml
|
72
|
-
}
|
73
|
-
puts "[done]"
|
74
|
-
end
|
75
|
-
|
76
|
-
#-----------------------------------------------------
|
77
|
-
# Create per class feature files
|
78
|
-
#-----------------------------------------------------
|
79
|
-
desc %Q{Generate per-class feature files}
|
80
|
-
task :class => [:methods ] do
|
81
|
-
print "Creating per class files... "
|
82
|
-
|
83
|
-
index = Methods
|
84
|
-
noauto = File.read_list( File.join( ETCPATH, 'noauto' ) )
|
85
|
-
allfiles = index.collect{ |k,ms| ms.collect{ |m| "#{k}/#{m}" } }.flatten
|
86
|
-
full = calc_full(allfiles, noauto)
|
87
|
-
|
88
|
-
index.each { |classname, method_files|
|
89
|
-
File.open( "#{GENPATH}/#{classname.downcase}.rb", 'w' ) { |f|
|
90
|
-
method_files.each { |rf|
|
91
|
-
mfn = "#{classname.downcase}/#{rf}"
|
92
|
-
if full.include?(mfn)
|
93
|
-
f << %Q{require '#{REQPATH}/#{mfn}'\n}
|
94
|
-
end
|
95
|
-
}
|
96
|
-
}
|
97
|
-
}
|
98
|
-
puts "[done]"
|
99
|
-
end
|
100
|
-
|
101
|
-
#-----------------------------------------------------
|
102
|
-
# Do all prep tasks (do this to generate data index
|
103
|
-
# file and method group files)
|
104
|
-
#-----------------------------------------------------
|
105
|
-
desc %{Do all preperation (index, class)}
|
106
|
-
task :prep => [ :index, :class, :redirect ] do
|
107
|
-
end
|
108
|
-
|
109
|
-
#-----------------------------------------------------
|
110
|
-
# List Methods
|
111
|
-
#-----------------------------------------------------
|
112
|
-
desc %{Output a list of all methods}
|
113
|
-
task 'list' => [ :methods ] do
|
114
|
-
puts method_list_outline
|
115
|
-
end
|
116
|
-
|
117
|
-
# #-----------------------------------------------------
|
118
|
-
# # HTML List MethodsFile.new(
|
119
|
-
# #-----------------------------------------------------
|
120
|
-
#
|
121
|
-
# HEAD = <<-HERE
|
122
|
-
# <html>
|
123
|
-
# <head>
|
124
|
-
# <style>
|
125
|
-
# pre#methods {
|
126
|
-
# font-size: .8em;
|
127
|
-
# line-height: 1em;
|
128
|
-
# }
|
129
|
-
# </style>
|
130
|
-
# </head>
|
131
|
-
# <body>
|
132
|
-
# <pre id="methods">
|
133
|
-
# HERE
|
134
|
-
#
|
135
|
-
# FOOT=<<-HERE
|
136
|
-
# </pre>
|
137
|
-
# </body>
|
138
|
-
# </html>
|
139
|
-
# HERE
|
140
|
-
#
|
141
|
-
# desc %{generate method list html file}
|
142
|
-
# task 'listHtml' => [ :scrape_methods ] do
|
143
|
-
# s = HEAD + method_list_outline + FOOT
|
144
|
-
# File.open('pub/www/methods.html', 'w') { |f| f << s }
|
145
|
-
# end
|
146
|
-
|
147
|
-
#desc "Check for open comment tests"
|
148
|
-
#task :testchk do
|
149
|
-
# system %q{grep -r ^#=begin\ test ./lib}
|
150
|
-
#end
|
151
|
-
|
152
|
-
|
153
|
-
#-----------------------------------------------------
|
154
|
-
# Supporting Methods
|
155
|
-
#-----------------------------------------------------
|
156
|
-
|
157
|
-
private
|
158
|
-
|
159
|
-
def method_list_outline
|
160
|
-
s = ''
|
161
|
-
Methods.keys.sort.each { |k|
|
162
|
-
ms = Methods[k].collect{|m| m.gsub(%r{^self\/},'::')}.sort
|
163
|
-
s << "#{k}:\n"
|
164
|
-
ms.each { |m| s << " #{m}\n" }
|
165
|
-
}
|
166
|
-
s
|
167
|
-
end
|
168
|
-
|
169
|
-
# Full set of require files (allfiles minus noauto and unsafe)
|
170
|
-
def calc_full( allfiles, noauto )
|
171
|
-
sf = allfiles.dup
|
172
|
-
noauto.each do |f|
|
173
|
-
if f.include?('*')
|
174
|
-
re = %r"#{f.gsub('*','.*')}"
|
175
|
-
sf.reject!{ |x| x =~ re }
|
176
|
-
elsif sf.include?(f)
|
177
|
-
sf.delete f
|
178
|
-
end
|
179
|
-
end
|
180
|
-
sf.sort
|
181
|
-
end
|
data/work/yore/Reapfile
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
LIBDIR = 'lib'
|
4
|
-
REDIR = 'facet'
|
5
|
-
SRCDIR = 'facets'
|
6
|
-
|
7
|
-
desc "Generate facet/ redirection dir"
|
8
|
-
|
9
|
-
task :redirect do
|
10
|
-
#puts "Creating redirection folder #{REDIR}/ ..."
|
11
|
-
count = 0
|
12
|
-
dest = File.join( LIBDIR, REDIR )
|
13
|
-
FileUtils.rm_r(dest) if File.directory?(dest)
|
14
|
-
Dir.chdir( LIBDIR ) do
|
15
|
-
['core','more'].each{ |d|
|
16
|
-
from = File.join( SRCDIR, d )
|
17
|
-
files = Dir.glob( File.join( from, '**/*.rb' ) )
|
18
|
-
files.each { |e|
|
19
|
-
re = Regexp.new( Regexp.escape( from + '/' ) )
|
20
|
-
link = e.sub( re, 'facet/')
|
21
|
-
FileUtils.mkdir_p( File.dirname( link ) )
|
22
|
-
File.open( link, "w+" ) { |w| w << "require '#{e}'" }
|
23
|
-
count += 1
|
24
|
-
}
|
25
|
-
}
|
26
|
-
end
|
27
|
-
puts "Created #{count} redirection files in #{REDIR}/ folder."
|
28
|
-
end
|
29
|
-
|
30
|
-
# List core methods
|
31
|
-
|
32
|
-
desc "Output a list of all methods"
|
33
|
-
|
34
|
-
task :list => [ :index_methods ] do
|
35
|
-
puts method_list_outline
|
36
|
-
end
|
37
|
-
|
38
|
-
# Read in the facets directory and sort-out per class
|
39
|
-
|
40
|
-
METHODS = {}
|
41
|
-
MTHPATH = "lib/facets/core"
|
42
|
-
|
43
|
-
task :index_methods do
|
44
|
-
Dir.chdir(MTHPATH) do
|
45
|
-
dg = Dir.glob('*/**/*.rb')
|
46
|
-
dg.each { |f|
|
47
|
-
klass, *meth= f.split('/')
|
48
|
-
METHODS[ klass ] ||= []
|
49
|
-
METHODS[ klass ] << "#{meth.join('/').chomp('.rb')}"
|
50
|
-
}
|
51
|
-
METHODS.keys.each { |k| METHODS[k].sort! }
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def method_list_outline
|
56
|
-
s = ''
|
57
|
-
METHODS.keys.sort.each { |k|
|
58
|
-
ms = METHODS[k].collect{|m| m.gsub(%r{^self\/},'::')}.sort
|
59
|
-
s << "#{k}:\n"
|
60
|
-
ms.each { |m| s << " #{m}\n" }
|
61
|
-
}
|
62
|
-
s
|
63
|
-
end
|
data/work/yore/annotation.rb
DELETED
@@ -1,489 +0,0 @@
|
|
1
|
-
# = annotation.rb
|
2
|
-
#
|
3
|
-
# == Copyright (c) 2005 Thomas Sawyer
|
4
|
-
#
|
5
|
-
# Ruby License
|
6
|
-
#
|
7
|
-
# This module is free software. You may use, modify, and/or redistribute this
|
8
|
-
# software under the same terms as Ruby.
|
9
|
-
#
|
10
|
-
# This program is distributed in the hope that it will be useful, but WITHOUT
|
11
|
-
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
12
|
-
# FOR A PARTICULAR PURPOSE.
|
13
|
-
#
|
14
|
-
# == Authors & Contributors
|
15
|
-
#
|
16
|
-
# * Thomas Sawyer
|
17
|
-
|
18
|
-
# Author:: Thomas Sawyer
|
19
|
-
# Copyright:: Copyright (c) 2005 Thomas Sawyer
|
20
|
-
# License:: Ruby License
|
21
|
-
|
22
|
-
require 'facets/core/array/merge'
|
23
|
-
require 'facets/more/openobject'
|
24
|
-
#require 'facets/more/inheritor'
|
25
|
-
require 'facets/more/nullclass'
|
26
|
-
|
27
|
-
# = Annotation
|
28
|
-
#
|
29
|
-
# Annotations allows you to annontate objects, including methods with arbitrary
|
30
|
-
# "metadata". These annotations don't do anything in themselves. They are
|
31
|
-
# merely comments. But you can put them to use. For instance an attribute
|
32
|
-
# validator might check for an annotation called :valid and test against it.
|
33
|
-
#
|
34
|
-
# Annotation is an OpenObject, and is used across the board for keeping annotations.
|
35
|
-
#
|
36
|
-
# Annotation class serves for both simple and inherited cases depending on whether
|
37
|
-
# a base class is given.
|
38
|
-
#
|
39
|
-
# == Synopsis
|
40
|
-
#
|
41
|
-
# class X
|
42
|
-
# attr :a
|
43
|
-
# ann :@a, :valid => lambda{ |x| x.is_a?(Integer) }
|
44
|
-
#
|
45
|
-
# def validate
|
46
|
-
# instance_variables.each { |iv|
|
47
|
-
# if validator = self.class.ann(iv)[:valid]
|
48
|
-
# value = instance_variable_get(iv)
|
49
|
-
# unless validator.call(vale)
|
50
|
-
# raise "Invalid value #{value} for #{iv}"
|
51
|
-
# end
|
52
|
-
# end
|
53
|
-
# }
|
54
|
-
# end
|
55
|
-
#
|
56
|
-
# end
|
57
|
-
#
|
58
|
-
|
59
|
-
class Annotation < OpenObject
|
60
|
-
|
61
|
-
def initialize( set={} )
|
62
|
-
super( set )
|
63
|
-
end
|
64
|
-
|
65
|
-
def inherits( base, &heritage )
|
66
|
-
@base = base
|
67
|
-
@heritage = heritage
|
68
|
-
self
|
69
|
-
end
|
70
|
-
|
71
|
-
def method_missing( sym, *args, &blk )
|
72
|
-
p sym
|
73
|
-
name = sym.to_s.gsub(/([=!?])$/, '').to_sym
|
74
|
-
type = sym.to_s[-1,1]
|
75
|
-
|
76
|
-
unless @base
|
77
|
-
r = super
|
78
|
-
return Kernel.null if r.nil? and type != '?'
|
79
|
-
return r
|
80
|
-
else
|
81
|
-
if type == '!'
|
82
|
-
unless key?(name)
|
83
|
-
parent = nil
|
84
|
-
@base.ancestors.each do |anc|
|
85
|
-
if ans = @heritage.call(anc) #anc.method_annotation[@key]
|
86
|
-
parent = ans[name]
|
87
|
-
break if parent
|
88
|
-
end
|
89
|
-
end
|
90
|
-
if parent
|
91
|
-
return table[name] = parent.dup #vs. object_class.new?
|
92
|
-
end
|
93
|
-
end
|
94
|
-
return super( name )
|
95
|
-
end
|
96
|
-
|
97
|
-
iob = dup
|
98
|
-
super
|
99
|
-
return inheritance if iob != self
|
100
|
-
#return inheritance.__send__( sym, *args, &blk )
|
101
|
-
return inheritance.method_missing( sym, *args, &blk )
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
def [](x)
|
106
|
-
@base ? inheritance[x] : super
|
107
|
-
end
|
108
|
-
|
109
|
-
def inheritance
|
110
|
-
return self unless @base
|
111
|
-
inh = @base.ancestors.collect{ |anc| @heritage.call(anc) }.compact
|
112
|
-
unless inh.empty?
|
113
|
-
a = Annotation.new #( inh.pop.to_h )
|
114
|
-
#inh.push( a ) #.dup )
|
115
|
-
inh.reverse.inject(a){ |memo, i| memo.send(:merge, i) }
|
116
|
-
return a
|
117
|
-
end
|
118
|
-
nil
|
119
|
-
end
|
120
|
-
|
121
|
-
end
|
122
|
-
|
123
|
-
# This is a simple decorator for accessing a module's
|
124
|
-
# method annotations (and it's own annotations).
|
125
|
-
|
126
|
-
class Annotator #:nodoc:
|
127
|
-
|
128
|
-
# Privatize a few Kernel methods that are most likely to clash,
|
129
|
-
# but arn't essential here. TODO Maybe more in this context?
|
130
|
-
|
131
|
-
private :class, :clone, :display, :type, :method, :to_a, :to_s
|
132
|
-
|
133
|
-
#
|
134
|
-
|
135
|
-
def initialize( mod ) ; @mod = mod ; end
|
136
|
-
|
137
|
-
def inspect ; "#<Annotator #{@mod}>" ; end
|
138
|
-
|
139
|
-
def self ; @mod.annotation ; end
|
140
|
-
|
141
|
-
def [](sym)
|
142
|
-
sym == :self ? @mod.annotation : @mod.method_annotation( sym )
|
143
|
-
end
|
144
|
-
|
145
|
-
def method_missing( sym, *args, &blk )
|
146
|
-
type = sym.to_s[-1,1]
|
147
|
-
name = sym.to_s.gsub(/[=!?]$/, '').to_sym
|
148
|
-
|
149
|
-
return @mod.annotation if name == :self
|
150
|
-
|
151
|
-
r = @mod.method_annotation( name )
|
152
|
-
|
153
|
-
return nil if type == '?' and r == Kernel.null
|
154
|
-
return r
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
# Any object can be annotated.
|
159
|
-
|
160
|
-
module ::Kernel
|
161
|
-
# Store and retrieve annotations for an object.
|
162
|
-
def annotation( harg=nil )
|
163
|
-
@_annotation ||= Annotation.new
|
164
|
-
return @_annotation unless harg
|
165
|
-
@_annotation.send(:update, harg)
|
166
|
-
end
|
167
|
-
|
168
|
-
#--
|
169
|
-
# Not sure about this.
|
170
|
-
#++
|
171
|
-
def ann( *args )
|
172
|
-
#return annotation unless harg
|
173
|
-
#annotation.send(:update, harg)
|
174
|
-
#if singleton_class?
|
175
|
-
(class << self; self; end).ann( *args )
|
176
|
-
#else
|
177
|
-
# self.class.ann( *args )
|
178
|
-
#end
|
179
|
-
end
|
180
|
-
|
181
|
-
end
|
182
|
-
|
183
|
-
# Modules and Classes have more sifisticated annotation.
|
184
|
-
# They differ from normal object annotation in that
|
185
|
-
# the are inheritables.
|
186
|
-
|
187
|
-
class ::Module
|
188
|
-
|
189
|
-
#def annotation
|
190
|
-
# @_annotation ||= Annotation.new.inherits( self ){ |anc| anc.annotation }
|
191
|
-
#end
|
192
|
-
|
193
|
-
def annotation( harg=nil )
|
194
|
-
@_annotation ||= Annotation.new.inherits( self ){ |anc| anc.annotation }
|
195
|
-
return @_annotation unless harg
|
196
|
-
@_annotation.send(:update,harg) if harg
|
197
|
-
end
|
198
|
-
|
199
|
-
def method_annotation( key=nil )
|
200
|
-
@_method_annotation ||= {}
|
201
|
-
return @_method_annotation unless key
|
202
|
-
key = key.to_sym
|
203
|
-
if a = @_method_annotation[key]
|
204
|
-
return a
|
205
|
-
elsif ancestors.any? { |anc| anc.method_annotation[key] }
|
206
|
-
@_method_annotation[key] = Annotation.new.inherits( self ){ |anc| anc.method_annotation[key] }
|
207
|
-
else
|
208
|
-
null
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
|
-
# Does this module/class or its ancestors have any annotation
|
213
|
-
# for a given method?
|
214
|
-
def annotated?( key )
|
215
|
-
return annotation if self == key
|
216
|
-
r = method_annotation( key )
|
217
|
-
null == r ? nil : r
|
218
|
-
end
|
219
|
-
|
220
|
-
# Returns a list of all annotated methods.
|
221
|
-
def annotated_methods(include_ancestors=true)
|
222
|
-
annlist = []
|
223
|
-
if include_ancestors
|
224
|
-
ancestors.inject([]){ |memo, anc|
|
225
|
-
memo | anc.method_annotation.keys
|
226
|
-
}
|
227
|
-
else
|
228
|
-
method_annotation.keys
|
229
|
-
end
|
230
|
-
end
|
231
|
-
|
232
|
-
# Define annotation for a key. The note parameter must be
|
233
|
-
# a Hash or Hash-like object.
|
234
|
-
private
|
235
|
-
def define_annotation( key, note )
|
236
|
-
key = key.to_sym
|
237
|
-
method_annotation[key] = Annotation.new(note).inherits(self){ |anc| anc.method_annotation[key] }
|
238
|
-
method_annotation[key]
|
239
|
-
end
|
240
|
-
|
241
|
-
public
|
242
|
-
def ann(*args)
|
243
|
-
harg = args.last.is_a?(Hash) ? args.pop : {}
|
244
|
-
|
245
|
-
#return annotator if args.empty? and harg.empty?
|
246
|
-
return @_ann ||= Annotator.new( self ) if args.empty? and harg.empty?
|
247
|
-
|
248
|
-
# for array of "mini-hashes" format
|
249
|
-
if harg.empty? and Hash === args[0]
|
250
|
-
args.each{|e| e.each{|k,v| harg[k]=v}}
|
251
|
-
args = []
|
252
|
-
end
|
253
|
-
|
254
|
-
# querying a single annotation
|
255
|
-
if harg.empty? and args.size == 1
|
256
|
-
return annotation if self == args[0] or :self == args[0]
|
257
|
-
#return args[0].annotation unless args[0].is_a?(Symbol) or args[0].is_a?(String)
|
258
|
-
return method_annotation( args[0] ) #.inherit
|
259
|
-
end
|
260
|
-
|
261
|
-
# if last element is a class (and there are more then just the one element)
|
262
|
-
harg[:class] = args.pop if args.last.is_a?(Class) and args.size > 1
|
263
|
-
|
264
|
-
if args.empty? # hash format
|
265
|
-
harg.each do |key,hsh|
|
266
|
-
if key == :self
|
267
|
-
annotation.send(:update,hsh)
|
268
|
-
next
|
269
|
-
end
|
270
|
-
note = annotated?( key )
|
271
|
-
if note and null != note
|
272
|
-
note.send(:update,hsh)
|
273
|
-
else
|
274
|
-
define_annotation( key, hsh )
|
275
|
-
end
|
276
|
-
end
|
277
|
-
return harg.keys
|
278
|
-
else # name, hash format
|
279
|
-
args.each do |key|
|
280
|
-
if key == :self
|
281
|
-
annotation.send(:update,harg)
|
282
|
-
next
|
283
|
-
end
|
284
|
-
note = annotated?( key )
|
285
|
-
if note and null != note
|
286
|
-
note.send(:update,harg)
|
287
|
-
else
|
288
|
-
define_annotation( key, harg )
|
289
|
-
end
|
290
|
-
end
|
291
|
-
return args
|
292
|
-
end
|
293
|
-
|
294
|
-
end #def ann
|
295
|
-
|
296
|
-
end #class ::Module
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
# _____ _
|
301
|
-
# |_ _|__ ___| |_
|
302
|
-
# | |/ _ \/ __| __|
|
303
|
-
# | | __/\__ \ |_
|
304
|
-
# |_|\___||___/\__|
|
305
|
-
#
|
306
|
-
|
307
|
-
=begin testing
|
308
|
-
|
309
|
-
require 'test/unit'
|
310
|
-
|
311
|
-
class TC01 < Test::Unit::TestCase
|
312
|
-
class X
|
313
|
-
def x1 ; end
|
314
|
-
ann :x1, :q=>3
|
315
|
-
ann :x1, :a=>1
|
316
|
-
end
|
317
|
-
|
318
|
-
def test_01_001
|
319
|
-
assert_equal( 1, X.ann(:x1)[:a] )
|
320
|
-
assert_equal( 3, X.ann(:x1)[:q] )
|
321
|
-
assert_equal( null, X.ann(:x2) )
|
322
|
-
end
|
323
|
-
def test_01_002
|
324
|
-
assert_equal( 1, X.ann(:x1)[:a] )
|
325
|
-
assert_equal( 3, X.ann(:x1)[:q] )
|
326
|
-
assert_equal( nil, X.ann(:x1)[:c] )
|
327
|
-
end
|
328
|
-
def test_01_003
|
329
|
-
assert_equal( 1, X.ann.x1[:a] )
|
330
|
-
assert_equal( 3, X.ann.x1[:q] )
|
331
|
-
end
|
332
|
-
def test_01_004
|
333
|
-
assert_equal( 1, X.ann.x1.a )
|
334
|
-
assert_equal( 3, X.ann.x1.q )
|
335
|
-
end
|
336
|
-
def test_01_005
|
337
|
-
assert_equal( null, X.ann.x2 )
|
338
|
-
assert_equal( null, X.ann.x1.r )
|
339
|
-
end
|
340
|
-
def test_02_007
|
341
|
-
X.ann.x1.a = 2
|
342
|
-
assert_equal(2, X.ann.x1.a)
|
343
|
-
end
|
344
|
-
end
|
345
|
-
|
346
|
-
class TC02 < Test::Unit::TestCase
|
347
|
-
class X
|
348
|
-
def x ; end
|
349
|
-
ann :x, :z=>1
|
350
|
-
end
|
351
|
-
class Y < X
|
352
|
-
#ann :x, :y=>2
|
353
|
-
end
|
354
|
-
|
355
|
-
def test_02_001
|
356
|
-
assert( Y.annotated?( :x ) )
|
357
|
-
end
|
358
|
-
def test_02_002
|
359
|
-
#assert_equal( [:x1], Y.annotated_methods )
|
360
|
-
end
|
361
|
-
def test_02_003
|
362
|
-
#assert_equal( 1, Y.ann(:x).inheritance )
|
363
|
-
#assert_equal( 1, Y.ann(:x) )
|
364
|
-
end
|
365
|
-
def test_02_004
|
366
|
-
assert_equal(1, X.ann(:x)[:z])
|
367
|
-
assert_equal(1, Y.ann(:x)[:z])
|
368
|
-
end
|
369
|
-
def test_02_005
|
370
|
-
assert_equal(1, Y.ann(:x).z)
|
371
|
-
end
|
372
|
-
def test_02_006
|
373
|
-
assert_equal(1, Y.ann.x.z)
|
374
|
-
end
|
375
|
-
def test_02_007
|
376
|
-
Y.ann.x.z = 2
|
377
|
-
assert_equal(2, Y.ann.x.z)
|
378
|
-
end
|
379
|
-
end
|
380
|
-
|
381
|
-
class TC03 < Test::Unit::TestCase
|
382
|
-
class X
|
383
|
-
def n ; end
|
384
|
-
ann :n, :v=>1
|
385
|
-
ann :n, :p=>3
|
386
|
-
end
|
387
|
-
class Y < X
|
388
|
-
ann :n, :b=>2
|
389
|
-
end
|
390
|
-
|
391
|
-
def test_03_001
|
392
|
-
assert_equal(2, Y.ann(:n)[:b])
|
393
|
-
assert_equal(1, Y.ann(:n)[:v])
|
394
|
-
end
|
395
|
-
def test_03_002
|
396
|
-
assert_equal(2, Y.ann(:n).b)
|
397
|
-
end
|
398
|
-
def test_03_003
|
399
|
-
assert_equal(2, Y.ann.n.b)
|
400
|
-
end
|
401
|
-
def test_03_004
|
402
|
-
#assert_equal( [:n], Y.annotated_methods )
|
403
|
-
end
|
404
|
-
end
|
405
|
-
|
406
|
-
class TC04 < Test::Unit::TestCase
|
407
|
-
module M
|
408
|
-
ann :m, :c=>3
|
409
|
-
end
|
410
|
-
|
411
|
-
def test_04_001
|
412
|
-
assert_equal(3, M.ann.m.c)
|
413
|
-
end
|
414
|
-
end
|
415
|
-
|
416
|
-
class TC05 < Test::Unit::TestCase
|
417
|
-
module M
|
418
|
-
ann :m, :c=>3
|
419
|
-
end
|
420
|
-
class Y ; end
|
421
|
-
class Z < Y
|
422
|
-
include M
|
423
|
-
end
|
424
|
-
|
425
|
-
def test_05_001
|
426
|
-
assert_equal( 3, Z.ann.m.c )
|
427
|
-
end
|
428
|
-
end
|
429
|
-
|
430
|
-
class TC06 < Test::Unit::TestCase
|
431
|
-
module M
|
432
|
-
ann :m, String
|
433
|
-
end
|
434
|
-
|
435
|
-
def test_06_001
|
436
|
-
assert_equal( String, M.ann.m.class )
|
437
|
-
end
|
438
|
-
end
|
439
|
-
|
440
|
-
class TC07 < Test::Unit::TestCase
|
441
|
-
class K
|
442
|
-
ann self, :oid => 'key'
|
443
|
-
ann :w, String
|
444
|
-
end
|
445
|
-
|
446
|
-
def test_07_001
|
447
|
-
assert_equal( String, K.ann.w.class )
|
448
|
-
end
|
449
|
-
|
450
|
-
def test_07_002
|
451
|
-
assert_equal( 'key', K.ann.self.oid )
|
452
|
-
end
|
453
|
-
|
454
|
-
def test_07_003
|
455
|
-
#assert_equal( K.ann.self, K.ann(:self) )
|
456
|
-
#assert_equal( K.ann(K), K.annotation )
|
457
|
-
#assert_equal( K.ann.self.to_h, K.ann(K).to_h )
|
458
|
-
#assert_equal( K.ann.self, K.ann(K) )
|
459
|
-
end
|
460
|
-
end
|
461
|
-
|
462
|
-
class TC08 < Test::Unit::TestCase
|
463
|
-
module M
|
464
|
-
ann :this, :koko => []
|
465
|
-
ann.this.koko! << 1
|
466
|
-
end
|
467
|
-
class C1
|
468
|
-
#ann :this, :koko => []
|
469
|
-
include M
|
470
|
-
ann.this.koko! << 2
|
471
|
-
ann.this.koko! << 3
|
472
|
-
end
|
473
|
-
class C2
|
474
|
-
include M
|
475
|
-
ann.this.koko! << 4
|
476
|
-
end
|
477
|
-
|
478
|
-
def test_08_001
|
479
|
-
assert_equal( [1], M.ann.this.koko )
|
480
|
-
end
|
481
|
-
def test_08_002
|
482
|
-
assert_equal( [1,2,3], C1.ann.this.koko )
|
483
|
-
end
|
484
|
-
def test_08_003
|
485
|
-
assert_equal( [1,4], C2.ann.this.koko )
|
486
|
-
end
|
487
|
-
end
|
488
|
-
|
489
|
-
=end
|