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
data/setup.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
1
3
|
#
|
2
4
|
# setup.rb
|
3
5
|
#
|
@@ -8,50 +10,21 @@
|
|
8
10
|
# the GNU LGPL, Lesser General Public License version 2.1.
|
9
11
|
#
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
#############################
|
16
|
-
|
17
|
-
# CHANGE - No longer need to support 1.4.6 or 1.6 versions of Ruby.
|
18
|
-
|
19
|
-
# unless Enumerable.method_defined?(:map) # Ruby 1.4.6
|
20
|
-
# module Enumerable
|
21
|
-
# alias map collect
|
22
|
-
# end
|
23
|
-
# end
|
24
|
-
|
25
|
-
# unless File.respond_to?(:read) # Ruby 1.6
|
26
|
-
# def File.read(fname)
|
27
|
-
# open(fname) {|f|
|
28
|
-
# return f.read
|
29
|
-
# }
|
30
|
-
# end
|
31
|
-
# end
|
32
|
-
|
33
|
-
# CHANGE - Needed to install within an abitrary root dir.
|
34
|
-
# This is hack! B/c setup.rb has become spegetti code,
|
35
|
-
# I am forced to do this hack. Setup.rb should be re-writ.
|
36
|
-
# I would use package.rb instead but
|
37
|
-
# it lacks hooks and extension compilation. But we'll keep
|
38
|
-
# an eye on that one for the future. -trans.
|
39
|
-
|
40
|
-
$setup_install_root = nil
|
41
|
-
ARGV.each{ |a|
|
42
|
-
if md = /--root=(.*)/.match( a )
|
43
|
-
$setup_install_root = md[1]
|
44
|
-
end
|
45
|
-
}
|
46
|
-
if $setup_install_root
|
47
|
-
ARGV.delete("--root=#{$setup_install_root}")
|
48
|
-
$setup_install_root = File.expand_path($setup_install_root)
|
49
|
-
puts "(root=#{$setup_install_root})"
|
13
|
+
unless Enumerable.method_defined?(:map) # Ruby 1.4.6
|
14
|
+
module Enumerable
|
15
|
+
alias map collect
|
16
|
+
end
|
50
17
|
end
|
51
18
|
|
52
|
-
#
|
19
|
+
unless File.respond_to?(:read) # Ruby 1.6
|
20
|
+
def File.read(fname)
|
21
|
+
open(fname) {|f|
|
22
|
+
return f.read
|
23
|
+
}
|
24
|
+
end
|
25
|
+
end
|
53
26
|
|
54
|
-
unless Errno.const_defined?(:ENOTEMPTY)
|
27
|
+
unless Errno.const_defined?(:ENOTEMPTY) # Windows?
|
55
28
|
module Errno
|
56
29
|
class ENOTEMPTY
|
57
30
|
# We do not raise this exception, implementation is not needed.
|
@@ -89,11 +62,17 @@ class ConfigTable
|
|
89
62
|
attr_accessor :install_prefix
|
90
63
|
attr_accessor :config_opt
|
91
64
|
|
92
|
-
|
93
|
-
def verbose?() @verbose end
|
65
|
+
attr_writer :verbose
|
94
66
|
|
95
|
-
def
|
96
|
-
|
67
|
+
def verbose?
|
68
|
+
@verbose
|
69
|
+
end
|
70
|
+
|
71
|
+
attr_writer :no_harm
|
72
|
+
|
73
|
+
def no_harm?
|
74
|
+
@no_harm
|
75
|
+
end
|
97
76
|
|
98
77
|
def [](key)
|
99
78
|
lookup(key).resolve(self)
|
@@ -137,7 +116,9 @@ class ConfigTable
|
|
137
116
|
end
|
138
117
|
end
|
139
118
|
|
140
|
-
def savefile
|
119
|
+
def savefile
|
120
|
+
'.config'
|
121
|
+
end
|
141
122
|
|
142
123
|
def load_savefile
|
143
124
|
begin
|
@@ -160,126 +141,124 @@ class ConfigTable
|
|
160
141
|
end
|
161
142
|
|
162
143
|
def load_standard_entries
|
163
|
-
|
164
|
-
standard_entries.each do |ent|
|
144
|
+
standard_entries(@rbconfig).each do |ent|
|
165
145
|
add ent
|
166
146
|
end
|
167
147
|
end
|
168
148
|
|
169
|
-
def standard_entries
|
170
|
-
|
149
|
+
def standard_entries(rbconfig)
|
150
|
+
c = rbconfig
|
171
151
|
|
172
|
-
rubypath = File.join(
|
152
|
+
rubypath = File.join(c['bindir'], c['ruby_install_name'] + c['EXEEXT'])
|
173
153
|
|
174
|
-
major =
|
175
|
-
minor =
|
176
|
-
teeny =
|
154
|
+
major = c['MAJOR'].to_i
|
155
|
+
minor = c['MINOR'].to_i
|
156
|
+
teeny = c['TEENY'].to_i
|
177
157
|
version = "#{major}.#{minor}"
|
178
158
|
|
179
|
-
#
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
# ((minor >= 5) or
|
185
|
-
# ((minor == 4) and (teeny >= 4)))))
|
159
|
+
# ruby ver. >= 1.4.4?
|
160
|
+
newpath_p = ((major >= 2) or
|
161
|
+
((major == 1) and
|
162
|
+
((minor >= 5) or
|
163
|
+
((minor == 4) and (teeny >= 4)))))
|
186
164
|
|
187
|
-
|
165
|
+
if c['rubylibdir']
|
188
166
|
# V > 1.6.3
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
#
|
208
|
-
#
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
# siteruby = c['sitedir']
|
213
|
-
# siterubyver = "$siteruby/#{version}"
|
214
|
-
# siterubyverarch = "$siterubyver/#{c['arch']}"
|
215
|
-
# else
|
216
|
-
# # V < 1.4.4
|
217
|
-
# libruby = "#{c['prefix']}/lib/ruby"
|
218
|
-
# librubyver = "#{c['prefix']}/lib/ruby/#{version}"
|
219
|
-
# librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
|
220
|
-
# siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby"
|
221
|
-
# siterubyver = siteruby
|
222
|
-
# siterubyverarch = "$siterubyver/#{c['arch']}"
|
223
|
-
# end
|
224
|
-
|
167
|
+
libruby = "#{c['prefix']}/lib/ruby"
|
168
|
+
librubyver = c['rubylibdir']
|
169
|
+
librubyverarch = c['archdir']
|
170
|
+
siteruby = c['sitedir']
|
171
|
+
siterubyver = c['sitelibdir']
|
172
|
+
siterubyverarch = c['sitearchdir']
|
173
|
+
elsif newpath_p
|
174
|
+
# 1.4.4 <= V <= 1.6.3
|
175
|
+
libruby = "#{c['prefix']}/lib/ruby"
|
176
|
+
librubyver = "#{c['prefix']}/lib/ruby/#{version}"
|
177
|
+
librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
|
178
|
+
siteruby = c['sitedir']
|
179
|
+
siterubyver = "$siteruby/#{version}"
|
180
|
+
siterubyverarch = "$siterubyver/#{c['arch']}"
|
181
|
+
else
|
182
|
+
# V < 1.4.4
|
183
|
+
libruby = "#{c['prefix']}/lib/ruby"
|
184
|
+
librubyver = "#{c['prefix']}/lib/ruby/#{version}"
|
185
|
+
librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
|
186
|
+
siteruby = "#{c['prefix']}/lib/ruby/#{version}/site_ruby"
|
187
|
+
siterubyver = siteruby
|
188
|
+
siterubyverarch = "$siterubyver/#{c['arch']}"
|
189
|
+
end
|
225
190
|
parameterize = lambda {|path|
|
226
|
-
path.sub(/\A#{Regexp.quote(
|
191
|
+
path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix')
|
227
192
|
}
|
228
193
|
|
229
|
-
if arg =
|
194
|
+
if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg }
|
230
195
|
makeprog = arg.sub(/'/, '').split(/=/, 2)[1]
|
231
196
|
else
|
232
197
|
makeprog = 'make'
|
233
198
|
end
|
234
199
|
|
235
|
-
installdir_lambda = lambda {|val, table|
|
236
|
-
case val
|
237
|
-
when 'std'
|
238
|
-
table['rbdir'] = '$librubyver'
|
239
|
-
table['sodir'] = '$librubyverarch'
|
240
|
-
when 'site'
|
241
|
-
table['rbdir'] = '$siterubyver'
|
242
|
-
table['sodir'] = '$siterubyverarch'
|
243
|
-
when 'home'
|
244
|
-
setup_rb_error '$HOME was not set' unless ENV['HOME']
|
245
|
-
table['prefix'] = ENV['HOME']
|
246
|
-
table['rbdir'] = '$libdir/ruby'
|
247
|
-
table['sodir'] = '$libdir/ruby'
|
248
|
-
end
|
249
|
-
}
|
250
|
-
|
251
200
|
[
|
252
|
-
ExecItem.new('installdirs', 'std/site/home',
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
PathItem.new('
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
201
|
+
ExecItem.new('installdirs', 'std/site/home',
|
202
|
+
'std: install under libruby; site: install under site_ruby; home: install under $HOME')\
|
203
|
+
{|val, table|
|
204
|
+
case val
|
205
|
+
when 'std'
|
206
|
+
table['rbdir'] = '$librubyver'
|
207
|
+
table['sodir'] = '$librubyverarch'
|
208
|
+
when 'site'
|
209
|
+
table['rbdir'] = '$siterubyver'
|
210
|
+
table['sodir'] = '$siterubyverarch'
|
211
|
+
when 'home'
|
212
|
+
setup_rb_error '$HOME was not set' unless ENV['HOME']
|
213
|
+
table['prefix'] = ENV['HOME']
|
214
|
+
table['rbdir'] = '$libdir/ruby'
|
215
|
+
table['sodir'] = '$libdir/ruby'
|
216
|
+
end
|
217
|
+
},
|
218
|
+
PathItem.new('prefix', 'path', c['prefix'],
|
219
|
+
'path prefix of target environment'),
|
220
|
+
PathItem.new('bindir', 'path', parameterize.call(c['bindir']),
|
221
|
+
'the directory for commands'),
|
222
|
+
PathItem.new('libdir', 'path', parameterize.call(c['libdir']),
|
223
|
+
'the directory for libraries'),
|
224
|
+
PathItem.new('datadir', 'path', parameterize.call(c['datadir']),
|
225
|
+
'the directory for shared data'),
|
226
|
+
PathItem.new('mandir', 'path', parameterize.call(c['mandir']),
|
227
|
+
'the directory for man pages'),
|
228
|
+
PathItem.new('sysconfdir', 'path', parameterize.call(c['sysconfdir']),
|
229
|
+
'the directory for system configuration files'),
|
230
|
+
PathItem.new('localstatedir', 'path', parameterize.call(c['localstatedir']),
|
231
|
+
'the directory for local state data'),
|
232
|
+
PathItem.new('libruby', 'path', libruby,
|
233
|
+
'the directory for ruby libraries'),
|
234
|
+
PathItem.new('librubyver', 'path', librubyver,
|
235
|
+
'the directory for standard ruby libraries'),
|
236
|
+
PathItem.new('librubyverarch', 'path', librubyverarch,
|
237
|
+
'the directory for standard ruby extensions'),
|
238
|
+
PathItem.new('siteruby', 'path', siteruby,
|
239
|
+
'the directory for version-independent aux ruby libraries'),
|
240
|
+
PathItem.new('siterubyver', 'path', siterubyver,
|
241
|
+
'the directory for aux ruby libraries'),
|
242
|
+
PathItem.new('siterubyverarch', 'path', siterubyverarch,
|
243
|
+
'the directory for aux ruby binaries'),
|
244
|
+
PathItem.new('rbdir', 'path', '$siterubyver',
|
245
|
+
'the directory for ruby scripts'),
|
246
|
+
PathItem.new('sodir', 'path', '$siterubyverarch',
|
247
|
+
'the directory for ruby extentions'),
|
248
|
+
PathItem.new('rubypath', 'path', rubypath,
|
249
|
+
'the path to set to #! line'),
|
250
|
+
ProgramItem.new('rubyprog', 'name', rubypath,
|
251
|
+
'the ruby program using for installation'),
|
252
|
+
ProgramItem.new('makeprog', 'name', makeprog,
|
253
|
+
'the make program to compile ruby extentions'),
|
254
|
+
SelectItem.new('shebang', 'all/ruby/never', 'ruby',
|
255
|
+
'shebang line (#!) editing mode'),
|
256
|
+
BoolItem.new('without-ext', 'yes/no', 'no',
|
257
|
+
'does not compile/install ruby extentions')
|
274
258
|
]
|
275
259
|
end
|
276
260
|
private :standard_entries
|
277
261
|
|
278
|
-
def paramize( path )
|
279
|
-
path.sub(/\A#{Regexp.quote(@rbconfig['prefix'])}/, '$prefix')
|
280
|
-
end
|
281
|
-
private :paramize
|
282
|
-
|
283
262
|
def load_multipackage_entries
|
284
263
|
multipackage_entries().each do |ent|
|
285
264
|
add ent
|
@@ -288,8 +267,10 @@ class ConfigTable
|
|
288
267
|
|
289
268
|
def multipackage_entries
|
290
269
|
[
|
291
|
-
PackageSelectionItem.new('with',
|
292
|
-
|
270
|
+
PackageSelectionItem.new('with', 'name,name...', '', 'ALL',
|
271
|
+
'package names that you want to install'),
|
272
|
+
PackageSelectionItem.new('without', 'name,name...', '', 'NONE',
|
273
|
+
'package names that you do not want to install')
|
293
274
|
]
|
294
275
|
end
|
295
276
|
private :multipackage_entries
|
@@ -354,8 +335,13 @@ class ConfigTable
|
|
354
335
|
"--#{@name}=#{@template}"
|
355
336
|
end
|
356
337
|
|
357
|
-
def value?
|
358
|
-
|
338
|
+
def value?
|
339
|
+
true
|
340
|
+
end
|
341
|
+
|
342
|
+
def value
|
343
|
+
@value
|
344
|
+
end
|
359
345
|
|
360
346
|
def resolve(table)
|
361
347
|
@value.gsub(%r<\$([^/]+)>) { table[$1] }
|
@@ -374,7 +360,9 @@ class ConfigTable
|
|
374
360
|
end
|
375
361
|
|
376
362
|
class BoolItem < Item
|
377
|
-
def config_type
|
363
|
+
def config_type
|
364
|
+
'bool'
|
365
|
+
end
|
378
366
|
|
379
367
|
def help_opt
|
380
368
|
"--#{@name}"
|
@@ -394,9 +382,12 @@ class ConfigTable
|
|
394
382
|
end
|
395
383
|
|
396
384
|
class PathItem < Item
|
397
|
-
def config_type
|
385
|
+
def config_type
|
386
|
+
'path'
|
387
|
+
end
|
398
388
|
|
399
389
|
private
|
390
|
+
|
400
391
|
def check(path)
|
401
392
|
setup_rb_error "config: --#{@name} requires argument" unless path
|
402
393
|
path[0,1] == '$' ? path : File.expand_path(path)
|
@@ -404,7 +395,9 @@ class ConfigTable
|
|
404
395
|
end
|
405
396
|
|
406
397
|
class ProgramItem < Item
|
407
|
-
def config_type
|
398
|
+
def config_type
|
399
|
+
'program'
|
400
|
+
end
|
408
401
|
end
|
409
402
|
|
410
403
|
class SelectItem < Item
|
@@ -413,9 +406,12 @@ class ConfigTable
|
|
413
406
|
@ok = selection.split('/')
|
414
407
|
end
|
415
408
|
|
416
|
-
def config_type
|
409
|
+
def config_type
|
410
|
+
'select'
|
411
|
+
end
|
417
412
|
|
418
413
|
private
|
414
|
+
|
419
415
|
def check(val)
|
420
416
|
unless @ok.include?(val.strip)
|
421
417
|
setup_rb_error "config: use --#{@name}=#{@template} (#{val})"
|
@@ -542,9 +538,7 @@ end # class ConfigTable
|
|
542
538
|
module FileOperations
|
543
539
|
|
544
540
|
def mkdir_p(dirname, prefix = nil)
|
545
|
-
dirname =
|
546
|
-
dirname = File.join( $setup_install_root, dirname ) if $setup_install_root
|
547
|
-
|
541
|
+
dirname = prefix + File.expand_path(dirname) if prefix
|
548
542
|
$stderr.puts "mkdir -p #{dirname}" if verbose?
|
549
543
|
return if no_harm?
|
550
544
|
|
@@ -628,15 +622,11 @@ module FileOperations
|
|
628
622
|
end
|
629
623
|
|
630
624
|
def install(from, dest, mode, prefix = nil)
|
631
|
-
|
632
|
-
realdest = prefix ? File.join(prefix, File.expand_path(dest)) : dest
|
633
|
-
realdest = File.join($setup_install_root, File.expand_path(realdest)) if $setup_install_root
|
634
|
-
|
635
625
|
$stderr.puts "install #{from} #{dest}" if verbose?
|
636
626
|
return if no_harm?
|
637
627
|
|
628
|
+
realdest = prefix ? prefix + File.expand_path(dest) : dest
|
638
629
|
realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest)
|
639
|
-
|
640
630
|
str = File.binread(from)
|
641
631
|
if diff?(str, realdest)
|
642
632
|
verbose_off {
|
@@ -671,7 +661,7 @@ module FileOperations
|
|
671
661
|
def ruby(*args)
|
672
662
|
command config('rubyprog'), *args
|
673
663
|
end
|
674
|
-
|
664
|
+
|
675
665
|
def make(task = nil)
|
676
666
|
command(*[config('makeprog'), task].compact)
|
677
667
|
end
|
@@ -711,14 +701,33 @@ module HookScriptAPI
|
|
711
701
|
@config[key] = val
|
712
702
|
end
|
713
703
|
|
704
|
+
#
|
714
705
|
# srcdir/objdir (works only in the package directory)
|
706
|
+
#
|
707
|
+
|
708
|
+
def curr_srcdir
|
709
|
+
"#{srcdir_root()}/#{relpath()}"
|
710
|
+
end
|
711
|
+
|
712
|
+
def curr_objdir
|
713
|
+
"#{objdir_root()}/#{relpath()}"
|
714
|
+
end
|
715
|
+
|
716
|
+
def srcfile(path)
|
717
|
+
"#{curr_srcdir()}/#{path}"
|
718
|
+
end
|
715
719
|
|
716
|
-
def
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
def srcdirectory?(path)
|
721
|
-
|
720
|
+
def srcexist?(path)
|
721
|
+
File.exist?(srcfile(path))
|
722
|
+
end
|
723
|
+
|
724
|
+
def srcdirectory?(path)
|
725
|
+
File.dir?(srcfile(path))
|
726
|
+
end
|
727
|
+
|
728
|
+
def srcfile?(path)
|
729
|
+
File.file?(srcfile(path))
|
730
|
+
end
|
722
731
|
|
723
732
|
def srcentries(path = '.')
|
724
733
|
Dir.open("#{curr_srcdir()}/#{path}") {|d|
|
@@ -757,8 +766,8 @@ class ToplevelInstaller
|
|
757
766
|
[ 'distclean',"does `make distclean' for each extention" ]
|
758
767
|
]
|
759
768
|
|
760
|
-
def
|
761
|
-
config = ConfigTable.new(load_rbconfig)
|
769
|
+
def ToplevelInstaller.invoke
|
770
|
+
config = ConfigTable.new(load_rbconfig())
|
762
771
|
config.load_standard_entries
|
763
772
|
config.load_multipackage_entries if multipackage?
|
764
773
|
config.fixup
|
@@ -766,11 +775,11 @@ class ToplevelInstaller
|
|
766
775
|
klass.new(File.dirname($0), config).invoke
|
767
776
|
end
|
768
777
|
|
769
|
-
def
|
778
|
+
def ToplevelInstaller.multipackage?
|
770
779
|
File.dir?(File.dirname($0) + '/packages')
|
771
780
|
end
|
772
781
|
|
773
|
-
def
|
782
|
+
def ToplevelInstaller.load_rbconfig
|
774
783
|
if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg }
|
775
784
|
ARGV.delete(arg)
|
776
785
|
load File.expand_path(arg.split(/=/, 2)[1])
|
@@ -781,7 +790,6 @@ class ToplevelInstaller
|
|
781
790
|
::Config::CONFIG
|
782
791
|
end
|
783
792
|
|
784
|
-
|
785
793
|
def initialize(ardir_root, config)
|
786
794
|
@ardir = File.expand_path(ardir_root)
|
787
795
|
@config = config
|
@@ -820,7 +828,7 @@ class ToplevelInstaller
|
|
820
828
|
__send__ "exec_#{task}"
|
821
829
|
end
|
822
830
|
end
|
823
|
-
|
831
|
+
|
824
832
|
def run_metaconfigs
|
825
833
|
@config.load_script "#{@ardir}/metaconfig"
|
826
834
|
end
|
@@ -833,9 +841,17 @@ class ToplevelInstaller
|
|
833
841
|
# Hook Script API bases
|
834
842
|
#
|
835
843
|
|
836
|
-
def srcdir_root
|
837
|
-
|
838
|
-
|
844
|
+
def srcdir_root
|
845
|
+
@ardir
|
846
|
+
end
|
847
|
+
|
848
|
+
def objdir_root
|
849
|
+
'.'
|
850
|
+
end
|
851
|
+
|
852
|
+
def relpath
|
853
|
+
'.'
|
854
|
+
end
|
839
855
|
|
840
856
|
#
|
841
857
|
# Option Parsing
|
@@ -965,7 +981,6 @@ class ToplevelInstaller
|
|
965
981
|
out.puts
|
966
982
|
out.puts 'Options for INSTALL:'
|
967
983
|
out.printf fmt, '--no-harm', 'only display what to do if given', 'off'
|
968
|
-
out.printf fmt, '--root=path', 'install root directory (effects all paths)', '/'
|
969
984
|
out.printf fmt, '--prefix=path', 'install path prefix', ''
|
970
985
|
out.puts
|
971
986
|
end
|
@@ -1160,15 +1175,24 @@ class Installer
|
|
1160
1175
|
"#<#{self.class} #{File.basename(@srcdir)}>"
|
1161
1176
|
end
|
1162
1177
|
|
1163
|
-
def noop(rel)
|
1178
|
+
def noop(rel)
|
1179
|
+
end
|
1164
1180
|
|
1165
1181
|
#
|
1166
1182
|
# Hook Script API base methods
|
1167
1183
|
#
|
1168
1184
|
|
1169
|
-
def srcdir_root
|
1170
|
-
|
1171
|
-
|
1185
|
+
def srcdir_root
|
1186
|
+
@srcdir
|
1187
|
+
end
|
1188
|
+
|
1189
|
+
def objdir_root
|
1190
|
+
@objdir
|
1191
|
+
end
|
1192
|
+
|
1193
|
+
def relpath
|
1194
|
+
@currdir
|
1195
|
+
end
|
1172
1196
|
|
1173
1197
|
#
|
1174
1198
|
# Config Access
|
@@ -1351,7 +1375,6 @@ class Installer
|
|
1351
1375
|
|
1352
1376
|
def install_files(list, dest, mode)
|
1353
1377
|
mkdir_p dest, @config.install_prefix
|
1354
|
-
#mkdir_p dest, offset_dir
|
1355
1378
|
list.each do |fname|
|
1356
1379
|
install fname, dest, mode, @config.install_prefix
|
1357
1380
|
end
|