facets 1.7.30 → 1.7.38
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/doc/CHANGELOG +17 -1
- data/lib/facet/enumerable/each_slice.rb +1 -0
- data/lib/facet/module/inject.rb +1 -0
- data/lib/facet/module/self/op_add.rb +1 -0
- data/lib/facet/module/self/op_sub.rb +1 -0
- data/lib/facets/core/enumerable/each_slice.rb +119 -0
- data/lib/facets/core/module/clone_using.rb +7 -7
- data/lib/facets/core/module/inject.rb +8 -0
- data/lib/facets/core/module/integrate.rb +2 -2
- data/lib/facets/core/module/self/op_add.rb +81 -0
- data/lib/facets/core/module/self/op_sub.rb +3 -0
- data/lib/facets/more/annotation.rb +1 -1
- data/lib/facets/more/command.rb +1 -1
- data/lib/facets/more/openobject.rb +8 -0
- 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 +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 +1 -1
- 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_slice.rb +14 -31
- data/test/lib/facets/core/enumerable/test_each_unique_pair.rb +1 -1
- data/test/lib/facets/core/enumerable/test_eachn.rb +1 -1
- 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_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/self/test_op_add.rb +48 -0
- 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 +1 -1
- 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/package +2 -2
- data/util/redirect +1 -1
- data/util/release +1 -1
- data/util/version +1 -1
- metadata +100 -93
- data/lib/facet/hash/each.rb +0 -1
- data/lib/facets/core/hash/each.rb +0 -76
- data/test/lib/facets/core/array/test_op_store.rb +0 -30
- data/test/lib/facets/core/hash/test_each.rb +0 -36
- data/test/lib/facets/core/kernel/test___method__.rb +0 -26
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.7.
|
1
|
+
1.7.38 (2006-08-31)
|
data/doc/CHANGELOG
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
* [removed] hash/each.rb, this variation of Hash#each is too "dangerous" in practice
|
2
|
+
* [update] module/self/op_add.rb: fixed inclusion order
|
3
|
+
* annotation.rb, return annotations of self when key is :self [updated]
|
4
|
+
* module/self/op_add.rb and op_sub.rb - traits like features [added]
|
5
|
+
* minor improvemtns to module/clone_using and integrate
|
6
|
+
* command.rb: minor change to docs [update]
|
7
|
+
* openobject.rb (added NilClass#to_openobject) [update]
|
8
|
+
* enumerable/each_slice.rb [replace]
|
9
|
+
Ruby already has #each_slice if you require 'enumerator'. And for 1.9,
|
10
|
+
I believe, this will be present automatically. So Facets' each_slice
|
11
|
+
has been replaced with a simple redirection to require 'enumerator'.
|
12
|
+
Ruby's version is slightly different in that it won't check arity if
|
13
|
+
a slice count is not given. For this, use enumerable/each_by.
|
14
|
+
* array/delete_at.rb [removed]
|
15
|
+
Ruby's Array class already has a #delete_at method,
|
16
|
+
although this is another method at odds with Hash.
|
17
|
+
Use #delete_values_at instead.
|
1
18
|
* moved File.bitbucket to File.null (but bitbucket was so "fun"! ;)
|
2
19
|
* added nilclass/to_path
|
3
20
|
* added kernel/load_local
|
@@ -17,7 +34,6 @@
|
|
17
34
|
* added Dir.bitbucket
|
18
35
|
* update to array/op_fetch to include op_store
|
19
36
|
* updated docs and util tasks
|
20
|
-
* ice
|
21
37
|
* minor changes
|
22
38
|
* added filesystem.rb
|
23
39
|
* taskable should now work at the toplevel too
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'facets/core/enumerable/each_slice.rb'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'facets/core/module/inject.rb'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'facets/core/module/self/op_add.rb'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'facets/core/module/self/op_sub.rb'
|
@@ -0,0 +1,119 @@
|
|
1
|
+
require 'enumerator'
|
2
|
+
|
3
|
+
=begin
|
4
|
+
|
5
|
+
module Enumerable
|
6
|
+
|
7
|
+
# Iterate through slices. If slicing _step_ is not
|
8
|
+
# given, the the arity if the block is used.
|
9
|
+
#
|
10
|
+
# x = []
|
11
|
+
# [1,2,3,4].each_slice(2){ |a,b| x << [a,b] }
|
12
|
+
# x #=> [ [1,2], [3,4] ]
|
13
|
+
#
|
14
|
+
# x = []
|
15
|
+
# [1,2,3,4,5,6].each_slice(3){ |a| x << a }
|
16
|
+
# x #=> [ [1,2,3], [4,5,6] ]
|
17
|
+
#
|
18
|
+
def each_slice(step=nil, &yld)
|
19
|
+
if step
|
20
|
+
cnt = step
|
21
|
+
n = length / cnt
|
22
|
+
n += 1 if length % cnt > 0
|
23
|
+
n.times { |i|
|
24
|
+
yld.call(*self.slice(i*cnt,cnt))
|
25
|
+
}
|
26
|
+
return cnt
|
27
|
+
else
|
28
|
+
cnt = yld.arity.abs
|
29
|
+
n = length / cnt
|
30
|
+
n += 1 if length % cnt > 0
|
31
|
+
n.times { |i|
|
32
|
+
yld.call(*self.slice(i*cnt,cnt))
|
33
|
+
}
|
34
|
+
return cnt
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
alias_method( :each_by, :each_slice )
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
class Array
|
44
|
+
|
45
|
+
# Iterates over +n+ elements at a time. If +n+ is
|
46
|
+
# not given then the arity of the block determines the
|
47
|
+
# slicing quantity.
|
48
|
+
#
|
49
|
+
# [1, 2, 3, 4].each_slice(2){ |a,b| ... }
|
50
|
+
#
|
51
|
+
# This is a specialized version Enumerable#each_slice
|
52
|
+
# but optimized specifically for Array.
|
53
|
+
def each_slice(n=nil, &yld)
|
54
|
+
n = yld.arity.abs unless n
|
55
|
+
i=0
|
56
|
+
while i < self.length
|
57
|
+
yld.call(*self.slice(i,n))
|
58
|
+
i+=n
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
alias_method( :each_by, :each_slice )
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
=end
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
# _____ _
|
71
|
+
# |_ _|__ ___| |_
|
72
|
+
# | |/ _ \/ __| __|
|
73
|
+
# | | __/\__ \ |_
|
74
|
+
# |_|\___||___/\__|
|
75
|
+
#
|
76
|
+
=begin test
|
77
|
+
|
78
|
+
require 'test/unit'
|
79
|
+
|
80
|
+
class TCEnumerable < Test::Unit::TestCase
|
81
|
+
|
82
|
+
def test_01
|
83
|
+
x = []
|
84
|
+
[1,2,3,4].each_slice(2){ |a,b| x << [a,b] }
|
85
|
+
o = [[1,2],[3,4]]
|
86
|
+
assert_equal( o, x )
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_02
|
90
|
+
x = []
|
91
|
+
[1,2,3,4,5,6,7,8].each_slice(4){ |*a| x << a }
|
92
|
+
o = [[[1,2,3,4]],[[5,6,7,8]]]
|
93
|
+
assert_equal( o, x )
|
94
|
+
end
|
95
|
+
|
96
|
+
def test_03
|
97
|
+
x = []
|
98
|
+
[1,2,3,4,5,6].each_slice(3){ |a| x << a }
|
99
|
+
o = [[1,2,3],[4,5,6]]
|
100
|
+
assert_equal( o, x )
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_04
|
104
|
+
a = [1,2,3,4,5,6]
|
105
|
+
r = []
|
106
|
+
a.each_slice(2){ |x,y| r << [x,y] }
|
107
|
+
assert_equal( [[1,2],[3,4],[5,6]], r )
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_05
|
111
|
+
a = [1,2,3,4,5,6]
|
112
|
+
r = []
|
113
|
+
a.each_slice(3){ |e| r << e }
|
114
|
+
assert_equal( [[1,2,3],[4,5,6]], r )
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
=end
|
@@ -5,8 +5,8 @@ class Module
|
|
5
5
|
# of the receiving module renamed.
|
6
6
|
def clone_renaming( pairs )
|
7
7
|
mod = self.dup
|
8
|
-
pairs.each_pair
|
9
|
-
mod.class_eval
|
8
|
+
pairs.each_pair{ |to_sym, from_sym|
|
9
|
+
mod.class_eval{
|
10
10
|
alias_method( to_sym, from_sym )
|
11
11
|
undef_method( from_sym )
|
12
12
|
}
|
@@ -19,17 +19,17 @@ class Module
|
|
19
19
|
def clone_removing( *meths )
|
20
20
|
mod = self.dup
|
21
21
|
methods_to_remove = meths
|
22
|
-
methods_to_remove.each
|
22
|
+
methods_to_remove.each{ |m| mod.class_eval{ remove_method m } }
|
23
23
|
return mod
|
24
24
|
end
|
25
25
|
|
26
26
|
# Returns an anonymous module with only the specified methods
|
27
27
|
# of the receiving module intact.
|
28
|
-
def clone_using( *
|
29
|
-
|
30
|
-
methods_to_remove =
|
28
|
+
def clone_using( *methods )
|
29
|
+
methods.collect!{ |m| m.to_s }
|
30
|
+
methods_to_remove = instance_methods - methods
|
31
31
|
mod = self.dup
|
32
|
-
mod.class_eval
|
32
|
+
mod.class_eval{ methods_to_remove.each{ |m| undef_method m } }
|
33
33
|
return mod
|
34
34
|
end
|
35
35
|
|
@@ -8,8 +8,8 @@ require 'facet/module/nodef'
|
|
8
8
|
require 'facet/module/wrap'
|
9
9
|
|
10
10
|
# Using integrate is just like using include except the
|
11
|
-
# module included is a reconstruction of the one
|
12
|
-
#
|
11
|
+
# module included is a reconstruction of the one given
|
12
|
+
# altered by the commands given in the block.
|
13
13
|
#
|
14
14
|
# Convenient commands available are: #rename, #redef,
|
15
15
|
# #remove, #nodef and #wrap. But any module method
|
@@ -0,0 +1,81 @@
|
|
1
|
+
|
2
|
+
class Module
|
3
|
+
|
4
|
+
def +( other )
|
5
|
+
mod1 = other.clone
|
6
|
+
mod2 = clone
|
7
|
+
|
8
|
+
mod1.module_eval{
|
9
|
+
include mod2
|
10
|
+
}
|
11
|
+
|
12
|
+
#methods = other.instance_methods(false)
|
13
|
+
#methods.each{ |name|
|
14
|
+
# method = other.instance_method(name)
|
15
|
+
# mod.module_eval {
|
16
|
+
# define_method( name, &method )
|
17
|
+
# }
|
18
|
+
#}
|
19
|
+
|
20
|
+
mod1
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
def -( other )
|
25
|
+
mod = clone
|
26
|
+
|
27
|
+
case other
|
28
|
+
when Array
|
29
|
+
subtract = instance_methods & other.collect{|m| m.to_s}
|
30
|
+
when Module
|
31
|
+
subtract = instance_methods & other.instance_methods(false)
|
32
|
+
when String, Symbol
|
33
|
+
subtract = instance_methods & [ other.to_s ]
|
34
|
+
end
|
35
|
+
|
36
|
+
mod.module_eval do
|
37
|
+
subtract.each{|x| remove_method x }
|
38
|
+
end
|
39
|
+
|
40
|
+
mod
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
=begin test
|
47
|
+
|
48
|
+
class TraitsTest < Test::Unit::TestCase
|
49
|
+
|
50
|
+
module A
|
51
|
+
def x; "x"; end
|
52
|
+
def z; "zA"; end
|
53
|
+
end
|
54
|
+
|
55
|
+
module B
|
56
|
+
def y; "y"; end
|
57
|
+
def z; "zB"; end
|
58
|
+
end
|
59
|
+
|
60
|
+
Q = A + B
|
61
|
+
R = A - B
|
62
|
+
|
63
|
+
def test_add
|
64
|
+
assert( Q )
|
65
|
+
Q.extend Q
|
66
|
+
assert_equal( "x", Q.x )
|
67
|
+
assert_equal( "y", Q.y )
|
68
|
+
assert_equal( "zB", Q.z )
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_minus
|
72
|
+
assert(R)
|
73
|
+
R.extend R
|
74
|
+
assert_equal( "x", R.x )
|
75
|
+
assert_raises( NoMethodError ){ R.z }
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
=end
|
81
|
+
|
@@ -193,7 +193,7 @@ class Module
|
|
193
193
|
def ann( name=nil, *options )
|
194
194
|
return annotations unless name
|
195
195
|
return name.each{|k,v| ann k,*v} if Hash === name
|
196
|
-
return annotations[name] if options.empty?
|
196
|
+
return annotations[(name == :self ? self : name)] if options.empty?
|
197
197
|
opt = {}
|
198
198
|
opt.update options.pop if Hash === options.last
|
199
199
|
opt[:class] = options.pop if Class === options.last
|
data/lib/facets/more/command.rb
CHANGED