facets 1.7.0 → 1.7.30
Sign up to get free protection for your applications and to get access to all the features.
- data/{meta/projectinfo → PROJECT} +1 -3
- data/README +114 -47
- data/VERSION +1 -0
- data/doc/{ChangeLog → CHANGELOG} +30 -0
- data/doc/{ChangeLog.pre1.5 → CHANGELOG.1} +0 -0
- data/{COPYING → doc/COPYING} +0 -0
- data/lib/facet/cache.rb +1 -0
- data/lib/facet/doublemetaphone.rb +1 -0
- data/lib/facet/enumerable/eachn.rb +1 -0
- data/lib/facet/file/self/null.rb +1 -0
- data/lib/facet/filesystem.rb +1 -0
- data/lib/facet/filetest/self/root.rb +1 -0
- data/lib/facet/hash/delete_at.rb +1 -0
- data/lib/facet/hash/delete_values.rb +1 -0
- data/lib/facet/hash/delete_values_at.rb +1 -0
- data/lib/facet/kernel/load_local.rb +1 -0
- data/lib/facet/main_as_module.rb +1 -0
- data/lib/facet/nilclass/to_path.rb +1 -0
- data/lib/facet/symbol/to_s.rb +1 -0
- data/lib/facets.rb +1 -0
- data/lib/facets/core/array/delete_values_at.rb +2 -0
- data/lib/facets/core/array/op_fetch.rb +27 -0
- data/lib/facets/core/array/op_store.rb +2 -47
- data/lib/facets/core/enumerable/each_by.rb +91 -2
- data/lib/facets/core/enumerable/eachn.rb +41 -0
- data/lib/facets/core/file/self/null.rb +17 -0
- data/lib/facets/core/filetest/self/root.rb +13 -0
- data/lib/facets/core/hash/delete_at.rb +10 -0
- data/lib/facets/core/hash/delete_values.rb +20 -0
- data/lib/facets/core/hash/delete_values_at.rb +24 -0
- data/lib/facets/core/hash/each.rb +26 -11
- data/lib/facets/core/kernel/load_local.rb +26 -0
- data/lib/facets/core/nilclass/to_path.rb +18 -0
- data/lib/facets/core/symbol/to_s.rb +10 -0
- data/lib/facets/more/association.rb +1 -1
- data/lib/facets/more/cache.rb +81 -0
- data/lib/facets/more/command.rb +11 -1
- data/lib/facets/more/doublemetaphone.rb +371 -0
- data/lib/facets/more/filesystem.rb +43 -0
- data/lib/facets/more/main_as_module.rb +42 -0
- data/lib/facets/more/taskable.rb +89 -212
- data/setup.rb +204 -181
- data/test/lib/facets/core/array/test_at_rand.rb +1 -1
- data/test/lib/facets/core/array/test_delete_unless.rb +1 -1
- data/test/lib/facets/core/array/test_delete_values.rb +1 -1
- data/test/lib/facets/core/array/test_delete_values_at.rb +1 -1
- data/test/lib/facets/core/array/test_first.rb +1 -1
- data/test/lib/facets/core/array/test_head.rb +1 -1
- data/test/lib/facets/core/array/test_last_index.rb +1 -1
- data/test/lib/facets/core/array/test_merge.rb +1 -1
- data/test/lib/facets/core/array/test_mid.rb +1 -1
- data/test/lib/facets/core/array/test_middle.rb +1 -1
- data/test/lib/facets/core/array/test_op_fetch.rb +9 -1
- data/test/lib/facets/core/array/test_op_store.rb +1 -1
- data/test/lib/facets/core/array/test_pick.rb +1 -1
- data/test/lib/facets/core/array/test_pos.rb +1 -1
- data/test/lib/facets/core/array/test_pot.rb +1 -1
- data/test/lib/facets/core/array/test_pull.rb +1 -1
- data/test/lib/facets/core/array/test_rand_index.rb +1 -1
- data/test/lib/facets/core/array/test_rand_subset.rb +1 -1
- data/test/lib/facets/core/array/test_range.rb +1 -1
- data/test/lib/facets/core/array/test_rotate.rb +1 -1
- data/test/lib/facets/core/array/test_select.rb +1 -1
- data/test/lib/facets/core/array/test_shuffle.rb +1 -1
- data/test/lib/facets/core/array/test_thru.rb +1 -1
- data/test/lib/facets/core/array/test_to_b.rb +1 -1
- data/test/lib/facets/core/array/test_to_h.rb +1 -1
- data/test/lib/facets/core/array/test_to_hash.rb +1 -1
- data/test/lib/facets/core/binding/self/test_of_caller.rb +1 -1
- data/test/lib/facets/core/binding/test___LINE__.rb +1 -1
- data/test/lib/facets/core/binding/test_call_stack.rb +1 -1
- data/test/lib/facets/core/binding/test_called.rb +1 -1
- data/test/lib/facets/core/binding/test_caller.rb +1 -1
- data/test/lib/facets/core/binding/test_defined.rb +1 -1
- data/test/lib/facets/core/binding/test_eval.rb +1 -1
- data/test/lib/facets/core/binding/test_local_variables.rb +1 -1
- data/test/lib/facets/core/binding/test_method_name.rb +1 -1
- data/test/lib/facets/core/binding/test_op_fetch.rb +1 -1
- data/test/lib/facets/core/binding/test_op_store.rb +1 -1
- data/test/lib/facets/core/binding/test_self.rb +1 -1
- data/test/lib/facets/core/class/test_cattr.rb +1 -1
- data/test/lib/facets/core/class/test_descendents.rb +1 -1
- data/test/lib/facets/core/class/test_method_name.rb +1 -1
- data/test/lib/facets/core/class/test_remove_descendents.rb +1 -1
- data/test/lib/facets/core/class/test_unix_path.rb +1 -1
- data/test/lib/facets/core/comparable/test_at_least.rb +1 -1
- data/test/lib/facets/core/comparable/test_clip.rb +1 -1
- data/test/lib/facets/core/comparable/test_cmp.rb +1 -1
- data/test/lib/facets/core/continuation/self/test_create.rb +1 -1
- data/test/lib/facets/core/date/test_days_in_month.rb +1 -1
- data/test/lib/facets/core/date/test_days_of_month.rb +1 -1
- data/test/lib/facets/core/date/test_stamp.rb +1 -1
- data/test/lib/facets/core/date/test_to_date.rb +1 -1
- data/test/lib/facets/core/date/test_to_s.rb +1 -1
- data/test/lib/facets/core/date/test_to_time.rb +1 -1
- data/test/lib/facets/core/dir/self/test_ancestor.rb +1 -1
- data/test/lib/facets/core/dir/self/test_ascend.rb +1 -1
- data/test/lib/facets/core/enumerable/self/test_combinations.rb +1 -1
- data/test/lib/facets/core/enumerable/self/test_cross.rb +1 -1
- data/test/lib/facets/core/enumerable/test_collect_with_index.rb +1 -1
- data/test/lib/facets/core/enumerable/test_commonality.rb +1 -1
- data/test/lib/facets/core/enumerable/test_compact_collect.rb +1 -1
- data/test/lib/facets/core/enumerable/test_count.rb +1 -1
- data/test/lib/facets/core/enumerable/test_cross.rb +1 -1
- data/test/lib/facets/core/enumerable/test_each_by.rb +71 -0
- data/test/lib/facets/core/enumerable/test_each_combination.rb +1 -1
- data/test/lib/facets/core/enumerable/test_each_pair.rb +1 -1
- data/test/lib/facets/core/enumerable/test_each_unique_pair.rb +1 -1
- data/test/lib/facets/core/enumerable/test_eachn.rb +34 -0
- data/test/lib/facets/core/enumerable/test_entropy.rb +1 -1
- data/test/lib/facets/core/enumerable/test_every.rb +1 -1
- data/test/lib/facets/core/enumerable/test_ew.rb +1 -1
- data/test/lib/facets/core/enumerable/test_filter_collect.rb +1 -1
- data/test/lib/facets/core/enumerable/test_find_collisions.rb +1 -1
- data/test/lib/facets/core/enumerable/test_frequency.rb +1 -1
- data/test/lib/facets/core/enumerable/test_graph.rb +1 -1
- data/test/lib/facets/core/enumerable/test_ideal_entropy.rb +1 -1
- data/test/lib/facets/core/enumerable/test_none.rb +1 -1
- data/test/lib/facets/core/enumerable/test_occur.rb +1 -1
- data/test/lib/facets/core/enumerable/test_one.rb +1 -1
- data/test/lib/facets/core/enumerable/test_op_pow.rb +1 -1
- data/test/lib/facets/core/enumerable/test_partition_by.rb +1 -1
- data/test/lib/facets/core/enumerable/test_permute.rb +1 -1
- data/test/lib/facets/core/enumerable/test_probability.rb +1 -1
- data/test/lib/facets/core/enumerable/test_to_h.rb +1 -1
- data/test/lib/facets/core/enumerable/test_uniq_by.rb +1 -1
- data/test/lib/facets/core/file/self/test_create.rb +1 -1
- data/test/lib/facets/core/file/self/test_open_as_string.rb +1 -1
- data/test/lib/facets/core/file/self/test_read_list.rb +1 -1
- data/test/lib/facets/core/file/self/test_sanitize.rb +1 -1
- data/test/lib/facets/core/file/self/test_split_all.rb +1 -1
- data/test/lib/facets/core/float/test_round_at.rb +1 -1
- data/test/lib/facets/core/float/test_round_to.rb +1 -1
- data/test/lib/facets/core/hash/self/test_zipnew.rb +1 -1
- data/test/lib/facets/core/hash/test_alias.rb +1 -1
- data/test/lib/facets/core/hash/test_assert_has_keys.rb +1 -1
- data/test/lib/facets/core/hash/test_assert_has_only_keys.rb +1 -1
- data/test/lib/facets/core/hash/test_at.rb +1 -1
- data/test/lib/facets/core/hash/test_collate.rb +1 -1
- data/test/lib/facets/core/hash/test_each.rb +1 -1
- data/test/lib/facets/core/hash/test_each_with_index.rb +1 -1
- data/test/lib/facets/core/hash/test_each_with_key.rb +1 -1
- data/test/lib/facets/core/hash/test_graph.rb +1 -1
- data/test/lib/facets/core/hash/test_has_keys.rb +1 -1
- data/test/lib/facets/core/hash/test_has_only_keys.rb +1 -1
- data/test/lib/facets/core/hash/test_inverse.rb +1 -1
- data/test/lib/facets/core/hash/test_normalize_keys.rb +1 -1
- data/test/lib/facets/core/hash/test_op_fetch.rb +1 -1
- data/test/lib/facets/core/hash/test_op_lshift.rb +1 -1
- data/test/lib/facets/core/hash/test_rand_key.rb +1 -1
- data/test/lib/facets/core/hash/test_rand_pair.rb +1 -1
- data/test/lib/facets/core/hash/test_rand_value.rb +1 -1
- data/test/lib/facets/core/hash/test_replace_each.rb +1 -1
- data/test/lib/facets/core/hash/test_shuffle.rb +1 -1
- data/test/lib/facets/core/hash/test_slice.rb +1 -1
- data/test/lib/facets/core/hash/test_stringify_keys.rb +1 -1
- data/test/lib/facets/core/hash/test_swap.rb +1 -1
- data/test/lib/facets/core/hash/test_swapkey.rb +1 -1
- data/test/lib/facets/core/hash/test_symbolize_keys.rb +1 -1
- data/test/lib/facets/core/hash/test_to_h.rb +1 -1
- data/test/lib/facets/core/hash/test_to_ostruct.rb +1 -1
- data/test/lib/facets/core/hash/test_to_ostruct_recurse.rb +1 -1
- data/test/lib/facets/core/hash/test_traverse.rb +1 -1
- data/test/lib/facets/core/hash/test_update_each.rb +1 -1
- data/test/lib/facets/core/hash/test_update_keys.rb +1 -1
- data/test/lib/facets/core/hash/test_update_values.rb +1 -1
- data/test/lib/facets/core/hash/test_weave.rb +1 -1
- data/test/lib/facets/core/integer/test_factorial.rb +1 -1
- data/test/lib/facets/core/integer/test_multiple.rb +1 -1
- data/test/lib/facets/core/integer/test_of.rb +1 -1
- data/test/lib/facets/core/integer/test_ordinal.rb +1 -1
- data/test/lib/facets/core/integer/test_times_collect.rb +1 -1
- data/test/lib/facets/core/kernel/test___class__.rb +1 -1
- data/test/lib/facets/core/kernel/test_as.rb +1 -1
- data/test/lib/facets/core/kernel/test_assign_from.rb +1 -1
- data/test/lib/facets/core/kernel/test_assign_with.rb +1 -1
- data/test/lib/facets/core/kernel/test_bool.rb +1 -1
- data/test/lib/facets/core/kernel/test_bug.rb +1 -1
- data/test/lib/facets/core/kernel/test_call_stack.rb +1 -1
- data/test/lib/facets/core/kernel/test_called.rb +1 -1
- data/test/lib/facets/core/kernel/test_callee.rb +1 -1
- data/test/lib/facets/core/kernel/test_constant.rb +1 -1
- data/test/lib/facets/core/kernel/test_copy.rb +1 -1
- data/test/lib/facets/core/kernel/test_deep_copy.rb +1 -1
- data/test/lib/facets/core/kernel/test_demo.rb +1 -1
- data/test/lib/facets/core/kernel/test_fn.rb +1 -1
- data/test/lib/facets/core/kernel/test_get_by_id.rb +1 -1
- data/test/lib/facets/core/kernel/test_here.rb +1 -1
- data/test/lib/facets/core/kernel/test_in.rb +1 -1
- data/test/lib/facets/core/kernel/test_instance_exec.rb +1 -1
- data/test/lib/facets/core/kernel/test_maybe.rb +1 -1
- data/test/lib/facets/core/kernel/test_metaclass.rb +1 -1
- data/test/lib/facets/core/kernel/test_method.rb +1 -1
- data/test/lib/facets/core/kernel/test_methods.rb +1 -1
- data/test/lib/facets/core/kernel/test_new.rb +1 -1
- data/test/lib/facets/core/kernel/test_object_class.rb +1 -1
- data/test/lib/facets/core/kernel/test_object_hexid.rb +1 -1
- data/test/lib/facets/core/kernel/test_quaclass.rb +1 -1
- data/test/lib/facets/core/kernel/test_require_all.rb +1 -1
- data/test/lib/facets/core/kernel/test_require_esc.rb +1 -1
- data/test/lib/facets/core/kernel/test_require_facet.rb +1 -1
- data/test/lib/facets/core/kernel/test_resc.rb +1 -1
- data/test/lib/facets/core/kernel/test_returning.rb +1 -1
- data/test/lib/facets/core/kernel/test_send_as.rb +1 -1
- data/test/lib/facets/core/kernel/test_set_from.rb +1 -1
- data/test/lib/facets/core/kernel/test_set_with.rb +1 -1
- data/test/lib/facets/core/kernel/test_silently.rb +1 -1
- data/test/lib/facets/core/kernel/test_singleton.rb +1 -1
- data/test/lib/facets/core/kernel/test_singleton_class.rb +1 -1
- data/test/lib/facets/core/kernel/test_superior.rb +1 -1
- data/test/lib/facets/core/kernel/test_supermethod.rb +1 -1
- data/test/lib/facets/core/kernel/test_this.rb +1 -1
- data/test/lib/facets/core/kernel/test_to_b.rb +1 -1
- data/test/lib/facets/core/kernel/test_to_bool.rb +1 -1
- data/test/lib/facets/core/kernel/test_to_data.rb +1 -1
- data/test/lib/facets/core/kernel/test_uri.rb +1 -1
- data/test/lib/facets/core/kernel/test_val.rb +1 -1
- data/test/lib/facets/core/kernel/test_with_accessor.rb +1 -1
- data/test/lib/facets/core/matchdata/test_match.rb +1 -1
- data/test/lib/facets/core/matchdata/test_matchtree.rb +1 -1
- data/test/lib/facets/core/module/test_abstract.rb +1 -1
- data/test/lib/facets/core/module/test_alias_module_function.rb +1 -1
- data/test/lib/facets/core/module/test_ancestor.rb +1 -1
- data/test/lib/facets/core/module/test_basename.rb +1 -1
- data/test/lib/facets/core/module/test_by_name.rb +1 -1
- data/test/lib/facets/core/module/test_class_extension.rb +1 -1
- data/test/lib/facets/core/module/test_clone_using.rb +1 -1
- data/test/lib/facets/core/module/test_dirname.rb +1 -1
- data/test/lib/facets/core/module/test_equate_on.rb +1 -1
- data/test/lib/facets/core/module/test_include_as.rb +1 -1
- data/test/lib/facets/core/module/test_initializer.rb +1 -1
- data/test/lib/facets/core/module/test_instance_methods.rb +1 -1
- data/test/lib/facets/core/module/test_integrate.rb +1 -1
- data/test/lib/facets/core/module/test_memoize.rb +1 -1
- data/test/lib/facets/core/module/test_modspace.rb +1 -1
- data/test/lib/facets/core/module/test_namespace.rb +1 -1
- data/test/lib/facets/core/module/test_nesting.rb +1 -1
- data/test/lib/facets/core/module/test_nodef.rb +1 -1
- data/test/lib/facets/core/module/test_on_included.rb +1 -1
- data/test/lib/facets/core/module/test_redef.rb +1 -1
- data/test/lib/facets/core/module/test_redefine_method.rb +1 -1
- data/test/lib/facets/core/module/test_redirect.rb +1 -1
- data/test/lib/facets/core/module/test_redirect_method.rb +1 -1
- data/test/lib/facets/core/module/test_remove.rb +1 -1
- data/test/lib/facets/core/module/test_rename.rb +1 -1
- data/test/lib/facets/core/module/test_rename_method.rb +1 -1
- data/test/lib/facets/core/module/test_revisal.rb +1 -1
- data/test/lib/facets/core/module/test_shadow_method.rb +1 -1
- data/test/lib/facets/core/module/test_sort_on.rb +1 -1
- data/test/lib/facets/core/module/test_this.rb +1 -1
- data/test/lib/facets/core/module/test_wrap.rb +1 -1
- data/test/lib/facets/core/module/test_wrap_method.rb +1 -1
- data/test/lib/facets/core/nilclass/test_blank.rb +1 -1
- data/test/lib/facets/core/nilclass/test_empty.rb +1 -1
- data/test/lib/facets/core/nilclass/test_include.rb +1 -1
- data/test/lib/facets/core/nilclass/test_op_fetch.rb +1 -1
- data/test/lib/facets/core/nilclass/test_size.rb +1 -1
- data/test/lib/facets/core/nilclass/test_to_h.rb +1 -1
- data/test/lib/facets/core/numeric/test_approx.rb +1 -1
- data/test/lib/facets/core/numeric/test_ceil_multiple.rb +1 -1
- data/test/lib/facets/core/numeric/test_distance.rb +1 -1
- data/test/lib/facets/core/numeric/test_succ.rb +1 -1
- data/test/lib/facets/core/numeric/test_to_b.rb +1 -1
- data/test/lib/facets/core/ostruct/test___merge__.rb +1 -1
- data/test/lib/facets/core/ostruct/test___update__.rb +1 -1
- data/test/lib/facets/core/ostruct/test_op_fetch.rb +1 -1
- data/test/lib/facets/core/ostruct/test_op_store.rb +1 -1
- data/test/lib/facets/core/proc/test_compose.rb +1 -1
- data/test/lib/facets/core/proc/test_op_mul.rb +1 -1
- data/test/lib/facets/core/proc/test_to_method.rb +1 -1
- data/test/lib/facets/core/range/test_to_r.rb +1 -1
- data/test/lib/facets/core/range/test_to_range.rb +1 -1
- data/test/lib/facets/core/range/test_umbrella.rb +1 -1
- data/test/lib/facets/core/range/test_within.rb +1 -1
- data/test/lib/facets/core/regexp/test_arity.rb +1 -1
- data/test/lib/facets/core/regexp/test_to_re.rb +1 -1
- data/test/lib/facets/core/regexp/test_to_regexp.rb +1 -1
- data/test/lib/facets/core/string/self/test_interpolate.rb +1 -1
- data/test/lib/facets/core/string/self/test_patterns.rb +1 -1
- data/test/lib/facets/core/string/self/test_rand_letter.rb +1 -1
- data/test/lib/facets/core/string/test_align_center.rb +1 -1
- data/test/lib/facets/core/string/test_at_rand.rb +1 -1
- data/test/lib/facets/core/string/test_basename.rb +1 -1
- data/test/lib/facets/core/string/test_blank.rb +1 -1
- data/test/lib/facets/core/string/test_bracket.rb +1 -1
- data/test/lib/facets/core/string/test_camelcase.rb +1 -1
- data/test/lib/facets/core/string/test_camelize.rb +1 -1
- data/test/lib/facets/core/string/test_capitalized.rb +1 -1
- data/test/lib/facets/core/string/test_chars.rb +1 -1
- data/test/lib/facets/core/string/test_cmp.rb +1 -1
- data/test/lib/facets/core/string/test_demodulize.rb +1 -1
- data/test/lib/facets/core/string/test_divide.rb +1 -1
- data/test/lib/facets/core/string/test_downcase.rb +1 -1
- data/test/lib/facets/core/string/test_dresner.rb +1 -1
- data/test/lib/facets/core/string/test_each_char.rb +1 -1
- data/test/lib/facets/core/string/test_each_word.rb +1 -1
- data/test/lib/facets/core/string/test_first.rb +1 -1
- data/test/lib/facets/core/string/test_fold.rb +1 -1
- data/test/lib/facets/core/string/test_humanize.rb +1 -1
- data/test/lib/facets/core/string/test_indent.rb +1 -1
- data/test/lib/facets/core/string/test_index_all.rb +1 -1
- data/test/lib/facets/core/string/test_last.rb +1 -1
- data/test/lib/facets/core/string/test_line_wrap.rb +1 -1
- data/test/lib/facets/core/string/test_lines.rb +1 -1
- data/test/lib/facets/core/string/test_lowercase.rb +1 -1
- data/test/lib/facets/core/string/test_margin.rb +1 -1
- data/test/lib/facets/core/string/test_methodize.rb +1 -1
- data/test/lib/facets/core/string/test_modulize.rb +1 -1
- data/test/lib/facets/core/string/test_mscan.rb +1 -1
- data/test/lib/facets/core/string/test_natcmp.rb +1 -1
- data/test/lib/facets/core/string/test_nchar.rb +1 -1
- data/test/lib/facets/core/string/test_pathize.rb +1 -1
- data/test/lib/facets/core/string/test_pop.rb +1 -1
- data/test/lib/facets/core/string/test_pot.rb +1 -1
- data/test/lib/facets/core/string/test_push.rb +1 -1
- data/test/lib/facets/core/string/test_quote.rb +1 -1
- data/test/lib/facets/core/string/test_rand_byte.rb +1 -1
- data/test/lib/facets/core/string/test_rand_index.rb +1 -1
- data/test/lib/facets/core/string/test_range.rb +1 -1
- data/test/lib/facets/core/string/test_range_all.rb +1 -1
- data/test/lib/facets/core/string/test_range_of_line.rb +1 -1
- data/test/lib/facets/core/string/test_regesc.rb +1 -1
- data/test/lib/facets/core/string/test_shatter.rb +1 -1
- data/test/lib/facets/core/string/test_shift.rb +1 -1
- data/test/lib/facets/core/string/test_shuffle.rb +1 -1
- data/test/lib/facets/core/string/test_similarity.rb +1 -1
- data/test/lib/facets/core/string/test_singular.rb +1 -1
- data/test/lib/facets/core/string/test_soundex.rb +1 -1
- data/test/lib/facets/core/string/test_succ.rb +1 -1
- data/test/lib/facets/core/string/test_to_a.rb +1 -1
- data/test/lib/facets/core/string/test_to_b.rb +1 -1
- data/test/lib/facets/core/string/test_to_const.rb +1 -1
- data/test/lib/facets/core/string/test_to_date.rb +1 -1
- data/test/lib/facets/core/string/test_to_proc.rb +1 -1
- data/test/lib/facets/core/string/test_to_re.rb +1 -1
- data/test/lib/facets/core/string/test_to_time.rb +1 -1
- data/test/lib/facets/core/string/test_unix_crypt.rb +1 -1
- data/test/lib/facets/core/string/test_unpack.rb +1 -1
- data/test/lib/facets/core/string/test_unshift.rb +1 -1
- data/test/lib/facets/core/string/test_upcase.rb +1 -1
- data/test/lib/facets/core/string/test_whitespace.rb +1 -1
- data/test/lib/facets/core/string/test_word_filter.rb +1 -1
- data/test/lib/facets/core/string/test_word_wrap.rb +1 -1
- data/test/lib/facets/core/string/test_words.rb +1 -1
- data/test/lib/facets/core/symbol/test_camelcase.rb +1 -1
- data/test/lib/facets/core/symbol/test_camelize.rb +1 -1
- data/test/lib/facets/core/symbol/test_capitalize.rb +1 -1
- data/test/lib/facets/core/symbol/test_capitalized.rb +1 -1
- data/test/lib/facets/core/symbol/test_downcase.rb +1 -1
- data/test/lib/facets/core/symbol/test_not.rb +1 -1
- data/test/lib/facets/core/symbol/test_pad.rb +1 -1
- data/test/lib/facets/core/symbol/test_succ.rb +1 -1
- data/test/lib/facets/core/symbol/test_to_const.rb +1 -1
- data/test/lib/facets/core/symbol/test_to_proc.rb +1 -1
- data/test/lib/facets/core/symbol/test_to_str.rb +1 -1
- data/test/lib/facets/core/symbol/test_underscore.rb +1 -1
- data/test/lib/facets/core/symbol/test_upcase.rb +1 -1
- data/test/lib/facets/core/time/test_change.rb +1 -1
- data/test/lib/facets/core/time/test_elapse.rb +1 -1
- data/test/lib/facets/core/time/test_stamp.rb +1 -1
- data/test/lib/facets/core/time/test_to_date.rb +1 -1
- data/test/lib/facets/core/time/test_to_s.rb +1 -1
- data/test/lib/facets/core/time/test_to_time.rb +1 -1
- data/test/lib/facets/more/test_annattr.rb +1 -1
- data/test/lib/facets/more/test_annotation.rb +1 -1
- data/test/lib/facets/more/test_ansicode.rb +1 -1
- data/test/lib/facets/more/test_association.rb +1 -1
- data/test/lib/facets/more/test_autoarray.rb +1 -1
- data/test/lib/facets/more/test_basicobject.rb +1 -1
- data/test/lib/facets/more/test_bbcode.rb +1 -1
- data/test/lib/facets/more/test_binaryreader.rb +1 -1
- data/test/lib/facets/more/test_bitmask.rb +1 -1
- data/test/lib/facets/more/test_bytes.rb +1 -1
- data/test/lib/facets/more/test_classmethods.rb +1 -1
- data/test/lib/facets/more/test_command.rb +1 -1
- data/test/lib/facets/more/test_coroutine.rb +1 -1
- data/test/lib/facets/more/test_crypt.rb +1 -1
- data/test/lib/facets/more/test_cut.rb +1 -1
- data/test/lib/facets/more/test_dictionary.rb +1 -1
- data/test/lib/facets/more/test_elementor.rb +1 -1
- data/test/lib/facets/more/test_enumerablepass.rb +1 -1
- data/test/lib/facets/more/test_floatstring.rb +1 -1
- data/test/lib/facets/more/test_functor.rb +1 -1
- data/test/lib/facets/more/test_htmlbuilder.rb +1 -1
- data/test/lib/facets/more/test_infinity.rb +1 -1
- data/test/lib/facets/more/test_inheritor.rb +1 -1
- data/test/lib/facets/more/test_instance_intercept.rb +1 -1
- data/test/lib/facets/more/test_interval.rb +1 -1
- data/test/lib/facets/more/test_json.rb +1 -1
- data/test/lib/facets/more/test_lisp.rb +1 -1
- data/test/lib/facets/more/test_lisp_format.rb +1 -1
- data/test/lib/facets/more/test_lrucache.rb +1 -1
- data/test/lib/facets/more/test_mathconstants.rb +1 -1
- data/test/lib/facets/more/test_methodfilter.rb +1 -1
- data/test/lib/facets/more/test_methodprobe.rb +1 -1
- data/test/lib/facets/more/test_multipliers.rb +1 -1
- data/test/lib/facets/more/test_multiton.rb +1 -1
- data/test/lib/facets/more/test_nackclass.rb +1 -1
- data/test/lib/facets/more/test_nilcomparable.rb +1 -1
- data/test/lib/facets/more/test_opencascade.rb +1 -1
- data/test/lib/facets/more/test_openobject.rb +1 -1
- data/test/lib/facets/more/test_overload.rb +1 -1
- data/test/lib/facets/more/test_paramix.rb +1 -1
- data/test/lib/facets/more/test_pqueue.rb +1 -1
- data/test/lib/facets/more/test_predicate.rb +1 -1
- data/test/lib/facets/more/test_preinitialize.rb +1 -1
- data/test/lib/facets/more/test_promoteself.rb +1 -1
- data/test/lib/facets/more/test_recorder.rb +1 -1
- data/test/lib/facets/more/test_snapshot.rb +1 -1
- data/test/lib/facets/more/test_statichash.rb +1 -1
- data/test/lib/facets/more/test_syncarray.rb +1 -1
- data/test/lib/facets/more/test_synchash.rb +1 -1
- data/test/lib/facets/more/test_tagiterator.rb +1 -1
- data/test/lib/facets/more/test_taskable.rb +28 -7
- data/test/lib/facets/more/test_timer.rb +1 -1
- data/test/lib/facets/more/test_times.rb +1 -1
- data/test/lib/facets/more/test_tuple.rb +1 -1
- data/test/lib/facets/more/test_typecast.rb +1 -1
- data/test/lib/facets/more/test_uninheritable.rb +1 -1
- data/test/lib/facets/more/test_units.rb +1 -1
- data/test/lib/facets/more/test_xmlbuilder.rb +1 -1
- data/test/lib/facets/more/test_xmlhelper.rb +1 -1
- data/test/lib/facets/more/test_xoxo.rb +1 -1
- data/test/lib/facets/more/test_yamlstruct.rb +1 -1
- data/util/announce +20 -0
- data/util/changelog +8 -0
- data/util/count +8 -0
- data/util/extest +8 -0
- data/util/list +38 -0
- data/util/package +9 -0
- data/util/prepare +12 -0
- data/util/redirect +34 -0
- data/util/release +13 -0
- data/util/setup +7 -0
- data/util/test +7 -0
- data/util/version +8 -0
- metadata +1514 -1491
- data/doc/CAUTION +0 -55
- data/doc/IMPORTANT +0 -8
- data/doc/LATEST +0 -41
- data/doc/history/ANN-0.6.0 +0 -40
- data/doc/history/ANN-0.6.1 +0 -36
- data/doc/history/ANN-0.6.3 +0 -43
- data/doc/history/ANN-0.7.0 +0 -59
- data/doc/history/ANN-0.8.1 +0 -127
- data/doc/history/INTRO +0 -172
- data/doc/history/README +0 -223
- data/doc/history/README-OLD +0 -180
- data/doc/manifest +0 -1209
- data/doc/scrap/Rakefile.old +0 -181
- data/lib/facet/enumerable/each_slice.rb +0 -1
- data/lib/facets/core/enumerable/each_slice.rb +0 -131
- data/meta/reapfile +0 -184
- data/meta/task +0 -74
- data/meta/tasks/calibre.rb +0 -16
- data/meta/version +0 -1
@@ -0,0 +1,43 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
|
6
|
+
class FileSystem
|
7
|
+
include FileUtils
|
8
|
+
|
9
|
+
attr_reader :root
|
10
|
+
|
11
|
+
def initialize( )
|
12
|
+
@root = "/"
|
13
|
+
end
|
14
|
+
|
15
|
+
def root?(dir=nil)
|
16
|
+
pth = File.expand_path(dir||work)
|
17
|
+
return true if pth == '/'
|
18
|
+
return true if pth =~ /^(\w:)?\/$/
|
19
|
+
false
|
20
|
+
end
|
21
|
+
|
22
|
+
def work; Dir.pwd; end
|
23
|
+
|
24
|
+
def ls
|
25
|
+
Dir.entries.collect do |f|
|
26
|
+
File.directory?(f) ? Dir.new(f) : File.new(f)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Direct access to a directory or file.
|
31
|
+
|
32
|
+
def [](name)
|
33
|
+
if File.directory?(name)
|
34
|
+
Dir.new(name)
|
35
|
+
elsif File.file?(name)
|
36
|
+
File.new(name)
|
37
|
+
else
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# Main as Module
|
2
|
+
|
3
|
+
(Module.public_instance_methods - public_methods).each do |m|
|
4
|
+
next if m == "initialize"
|
5
|
+
next if m =~ /^\W+$/
|
6
|
+
eval <<-END
|
7
|
+
def self.#{m}( *args, &block )
|
8
|
+
Object.class_eval do
|
9
|
+
#{m}( *args, &block )
|
10
|
+
end
|
11
|
+
end
|
12
|
+
END
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
(Module.private_instance_methods - private_methods).each do |m|
|
18
|
+
next if m == "initialize"
|
19
|
+
next if m =~ /^\W+$/
|
20
|
+
eval <<-END
|
21
|
+
def self.#{m}( *args, &block )
|
22
|
+
Object.class_eval do
|
23
|
+
#{m}( *args, &block )
|
24
|
+
end
|
25
|
+
end
|
26
|
+
END
|
27
|
+
end
|
28
|
+
|
29
|
+
protected
|
30
|
+
|
31
|
+
(Module.protected_instance_methods - protected_methods).each do |m|
|
32
|
+
next if m == "initialize"
|
33
|
+
next if m =~ /^\W+$/
|
34
|
+
eval <<-END
|
35
|
+
def self.#{m}( *args, &block )
|
36
|
+
Object.class_eval do
|
37
|
+
#{m}( *args, &block )
|
38
|
+
end
|
39
|
+
end
|
40
|
+
END
|
41
|
+
end
|
42
|
+
|
data/lib/facets/more/taskable.rb
CHANGED
@@ -19,131 +19,77 @@
|
|
19
19
|
# Copyright:: Copyright (c) 2006 Thomas Sawyer
|
20
20
|
# License:: Ruby License
|
21
21
|
|
22
|
-
|
23
|
-
require 'facets/core/kernel/cache.rb'
|
24
|
-
require 'facets/core/kernel/method.rb'
|
25
|
-
require 'facets/more/inheritor.rb'
|
22
|
+
$main = self
|
26
23
|
|
27
|
-
# =
|
24
|
+
# = Taskable
|
28
25
|
#
|
29
|
-
#
|
30
|
-
#
|
26
|
+
# The Taskable module provides a generic task system
|
27
|
+
# patterned after Rake, but useable in any
|
28
|
+
# code context --not just with the Rake tool. In other
|
29
|
+
# words one can create methods with dependencies.
|
31
30
|
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
# may eventually be added to Facets or submitted as a patch.
|
36
|
-
|
37
|
-
module TSort
|
38
|
-
def strongly_connected_components_from(node)
|
39
|
-
result = []
|
40
|
-
each_strongly_connected_component_from(node) do |component|
|
41
|
-
result << component
|
42
|
-
end
|
43
|
-
result
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# = Task
|
31
|
+
# NOTE Unlike methods, tasks can't take independent parameters
|
32
|
+
# if they are to be used as prerequisites. The arguments passed
|
33
|
+
# to a task call will aslo be passed to it's prequisites.
|
48
34
|
#
|
49
|
-
#
|
35
|
+
# To use Taskable at the toplevel do:
|
50
36
|
#
|
51
|
-
#
|
52
|
-
# Not sure that would be a good idea anyway.
|
53
|
-
|
54
|
-
class Task
|
55
|
-
attr_accessor :description
|
56
|
-
|
57
|
-
def initialize( name, container, preq, desc=nil, &action )
|
58
|
-
@name = name
|
59
|
-
@container = container
|
60
|
-
@prerequisite = preq || []
|
61
|
-
@description = desc
|
62
|
-
@action = action
|
63
|
-
end
|
64
|
-
|
65
|
-
def prerequisite
|
66
|
-
@prerequisite ||= []
|
67
|
-
end
|
37
|
+
# include Taskable
|
68
38
|
|
69
|
-
|
70
|
-
# # TODO Problem is 'a' can't take any parameters,
|
71
|
-
# # and there's no way to sort the tasks
|
72
|
-
# # from here. FIX if possible.
|
73
|
-
# #++
|
74
|
-
# def to_proc
|
75
|
-
# r = @prerequisite
|
76
|
-
# n = @name
|
77
|
-
# a = @action
|
78
|
-
# lambda {
|
79
|
-
# r.each{ |d| send(d) unless n == d }
|
80
|
-
# instance_eval &a if a
|
81
|
-
# }
|
82
|
-
# end
|
39
|
+
module Taskable
|
83
40
|
|
84
|
-
def
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
t.each_strongly_connected_component_from( name ) { |c|
|
89
|
-
#@container.instance_task(c).call
|
90
|
-
@container.send("->#{d}")
|
91
|
-
}
|
41
|
+
def self.included?( base )
|
42
|
+
if base == $main
|
43
|
+
require 'facets/more/main_as_module.rb'
|
44
|
+
end
|
92
45
|
end
|
93
46
|
|
94
|
-
|
95
|
-
@action.call
|
96
|
-
end
|
47
|
+
#
|
97
48
|
|
98
|
-
def
|
99
|
-
@
|
49
|
+
def descriptions
|
50
|
+
@descriptions ||= {}
|
100
51
|
end
|
101
52
|
|
102
|
-
#
|
103
|
-
# It is used to generate the proper dependency chains.
|
104
|
-
# TODO Make Multiton off of base.
|
53
|
+
#
|
105
54
|
|
106
|
-
|
107
|
-
include TSort
|
108
|
-
|
109
|
-
def initialize( base, name )
|
110
|
-
@base = base.class
|
111
|
-
@name = name
|
112
|
-
instance_map( name )
|
113
|
-
end
|
55
|
+
def task( name_preqs, &action )
|
114
56
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
57
|
+
if Hash === name_preqs
|
58
|
+
name = name_preqs.keys[0]
|
59
|
+
preqs = name_preqs.values[0]
|
60
|
+
else
|
61
|
+
name = name_preqs
|
62
|
+
preqs = []
|
120
63
|
end
|
121
64
|
|
122
|
-
|
65
|
+
descriptions[name.to_sym] = desc!
|
123
66
|
|
124
|
-
|
125
|
-
|
67
|
+
if action
|
68
|
+
define_method( "->#{name}" , &action )
|
69
|
+
else
|
70
|
+
define_method( "->#{name}" ) {}
|
126
71
|
end
|
127
|
-
end
|
128
72
|
|
129
|
-
|
73
|
+
preqs = preqs.collect { |q| q.to_sym }.uniq
|
130
74
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
# This capability might be added in the future, but
|
141
|
-
# presently syntax limitations make it awkward.
|
75
|
+
define_method( "pre-#{name}" ) do |build|
|
76
|
+
return build if preqs.empty?
|
77
|
+
bld = [*build]
|
78
|
+
(preqs - build).each { |n|
|
79
|
+
bld.concat( send("pre-#{n}", bld) )
|
80
|
+
bld << n
|
81
|
+
}
|
82
|
+
bld.uniq
|
83
|
+
end
|
142
84
|
|
143
|
-
|
85
|
+
define_method( name ) do |*args|
|
86
|
+
first = send("pre-#{name}",[])
|
87
|
+
raise if first.include?(name.to_sym)
|
88
|
+
first.each{|n| send("->#{n}",*args)}
|
89
|
+
send("->#{name}",*args)
|
90
|
+
end
|
144
91
|
|
145
|
-
|
146
|
-
# TODO Not sure this is properly reading from ancestors.
|
92
|
+
end
|
147
93
|
|
148
94
|
# Define description for subsequent task.
|
149
95
|
|
@@ -155,131 +101,41 @@ module Taskable
|
|
155
101
|
# Use up the description for subsequent task.
|
156
102
|
|
157
103
|
def desc!
|
158
|
-
l = @last_description
|
159
|
-
@last_description = nil
|
104
|
+
l, @last_description = @last_description, nil
|
160
105
|
l
|
161
106
|
end
|
162
107
|
|
163
|
-
|
164
|
-
|
165
|
-
def instance_task( name )
|
166
|
-
instance_task_table[ name.to_sym ]
|
167
|
-
end
|
168
|
-
|
169
|
-
# List of task names.
|
108
|
+
public
|
170
109
|
|
171
110
|
def instance_tasks
|
172
|
-
|
173
|
-
|
174
|
-
|
111
|
+
i = []
|
112
|
+
instance_methods.each do |name|
|
113
|
+
if name =~ /^->(.*)/
|
114
|
+
i << $1
|
115
|
+
end
|
116
|
+
end
|
117
|
+
i
|
175
118
|
end
|
176
119
|
|
177
120
|
# List of task names with descriptions.
|
178
121
|
|
179
122
|
def described_tasks
|
180
|
-
instance_tasks.select { |name|
|
123
|
+
instance_tasks.select { |name| descriptions[name.to_sym] }
|
181
124
|
end
|
182
125
|
|
183
126
|
# List of task names without descriptions.
|
184
127
|
|
185
128
|
def undescribed_tasks
|
186
|
-
instance_tasks.select { |name| !
|
187
|
-
end
|
188
|
-
|
189
|
-
# Define a task.
|
190
|
-
|
191
|
-
def task(args, &action)
|
192
|
-
if Hash === args
|
193
|
-
raise ArgumentError, "#{args.size} for 1" if args.size != 1
|
194
|
-
name, *deps = *(args.to_a.flatten)
|
195
|
-
name = name.to_sym
|
196
|
-
deps = deps.compact.collect{ |e| e.to_sym }
|
197
|
-
else
|
198
|
-
name, deps = args.to_sym, []
|
199
|
-
end
|
200
|
-
# create task via create core and callable methods.
|
201
|
-
# We do it this way b/c otherwise we'd have to use
|
202
|
-
# instance_eval and then can't ever pass paramaters.
|
203
|
-
if action
|
204
|
-
define_method( "->#{name}", &action ) # core of the task
|
205
|
-
define_method( name ) do |*args|
|
206
|
-
# ensure no cycles in the graph and extract call graph
|
207
|
-
#own = (class << self; self; end) # in case there are singletons?
|
208
|
-
todolist = Task::Graph.new( self, name )
|
209
|
-
todolist.each_strongly_connected_component_from( name ) do |c|
|
210
|
-
send("->#{c}", *args)
|
211
|
-
end
|
212
|
-
end
|
213
|
-
instance_task_table![name] = Task.new( name, self, deps, desc!, &action )
|
214
|
-
elsif !instance_task_table![name]
|
215
|
-
#define_method( "->#{name}", lambda{} ) # empty action
|
216
|
-
define_method( name ) do |*args|
|
217
|
-
# ensure no cycles in the graph and extract call graph
|
218
|
-
#own = (class << self; self; end) # in case there are singletons?
|
219
|
-
todolist = Task::Graph.new( self, name )
|
220
|
-
todolist.each_strongly_connected_component_from( name ) do |c|
|
221
|
-
send("->#{c}", *args) unless "#{c}" == "#{name}"
|
222
|
-
end
|
223
|
-
end
|
224
|
-
instance_task_table![name] = Task.new( name, self, deps, desc!, &action )
|
225
|
-
else
|
226
|
-
m = instance_task_table![name]
|
227
|
-
#m.description = desc! # TODO should this apply only if there is an action?
|
228
|
-
m.prerequisite.concat deps unless deps.empty?
|
229
|
-
m
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
# Include the Task module into the Module class.
|
234
|
-
|
235
|
-
class ::Module
|
236
|
-
include Taskable
|
237
|
-
# This has to be down here and not in Taskable b/c of
|
238
|
-
# a glitch in inheritor's design.
|
239
|
-
inheritor :instance_task_table, {}, :merge
|
129
|
+
instance_tasks.select { |name| ! descriptions[name.to_sym] }
|
240
130
|
end
|
241
131
|
|
242
132
|
end
|
243
133
|
|
244
|
-
#
|
245
134
|
|
246
|
-
class
|
247
|
-
|
248
|
-
(class << self; self; end).instance_task( name )
|
249
|
-
end
|
135
|
+
class Module
|
136
|
+
include Taskable
|
250
137
|
end
|
251
138
|
|
252
|
-
#--
|
253
|
-
# TODO Allows tasks to defined at the toplevel (main).
|
254
|
-
# This may need work b/c it might cause an infinite loop.
|
255
|
-
# Plus there are a few method missing yet. Anyway,
|
256
|
-
# I'm not needing this functionality at the moment, and
|
257
|
-
# I leave it to somone else to finish when they do.
|
258
|
-
#
|
259
|
-
# class Object
|
260
|
-
#
|
261
|
-
# def instance_tasks
|
262
|
-
# (class << self; self; end).instance_tasks
|
263
|
-
# end
|
264
|
-
#
|
265
|
-
# def instance_task(*args, &blk)
|
266
|
-
# (class << self; self; end).task(*args, &blk)
|
267
|
-
# end
|
268
|
-
#
|
269
|
-
# def desc(*args, &blk)
|
270
|
-
# (class << self; self; end).desc(*args, &blk)
|
271
|
-
# end
|
272
|
-
#
|
273
|
-
# def desc!(*args, &blk)
|
274
|
-
# (class << self; self; end).desc!(*args, &blk)
|
275
|
-
# end
|
276
|
-
#
|
277
|
-
# def task(*args, &blk)
|
278
|
-
# (class << self; self; end).desc(*args, &blk)
|
279
|
-
# end
|
280
|
-
#
|
281
|
-
# end
|
282
|
-
#++
|
283
139
|
|
284
140
|
|
285
141
|
# _____ _
|
@@ -292,7 +148,7 @@ end
|
|
292
148
|
|
293
149
|
require 'test/unit'
|
294
150
|
|
295
|
-
class
|
151
|
+
class TestTaskable1 < Test::Unit::TestCase
|
296
152
|
|
297
153
|
module M
|
298
154
|
task :m1 => [ :c1 ] do @x << "m1" end
|
@@ -349,9 +205,6 @@ end
|
|
349
205
|
task :o2 => [ :o1 ] do (@x||=[]) << "o2" end
|
350
206
|
end
|
351
207
|
|
352
|
-
# TODO Appearently extending does play well with inheritor?
|
353
|
-
# F = Module.new { extend O }
|
354
|
-
|
355
208
|
# tests
|
356
209
|
|
357
210
|
def test_B1
|
@@ -416,13 +269,13 @@ end
|
|
416
269
|
|
417
270
|
def test_E1
|
418
271
|
e = E.new
|
419
|
-
assert_raises(
|
272
|
+
assert_raises( NoMethodError ) { e.e1 }
|
420
273
|
#assert_equal( [ 'c1', 'e1' ], e.x )
|
421
274
|
end
|
422
275
|
|
423
276
|
def test_E2
|
424
277
|
e = E.new
|
425
|
-
assert_raises(
|
278
|
+
assert_raises( NoMethodError ) { e.e2 }
|
426
279
|
#assert_equal( [ 'c1', 'm1', 'e2' ], e.x )
|
427
280
|
end
|
428
281
|
|
@@ -443,4 +296,28 @@ end
|
|
443
296
|
|
444
297
|
end
|
445
298
|
|
299
|
+
# ##
|
300
|
+
# # Test toplevel usage.
|
301
|
+
# #
|
302
|
+
#
|
303
|
+
# include Taskable
|
304
|
+
#
|
305
|
+
# task :foo do
|
306
|
+
# "foo"
|
307
|
+
# end
|
308
|
+
#
|
309
|
+
# task :bar => [ :foo ] do
|
310
|
+
# "bar"
|
311
|
+
# end
|
312
|
+
#
|
313
|
+
# class TestTaskable2 < Test::Unit::TestCase
|
314
|
+
# def test_01
|
315
|
+
# assert_equal( "foo", foo )
|
316
|
+
# end
|
317
|
+
# def test_01
|
318
|
+
# assert_equal( "bar", bar )
|
319
|
+
# end
|
320
|
+
#
|
321
|
+
# end
|
322
|
+
|
446
323
|
=end
|