facets 1.7.0 → 1.7.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (456) hide show
  1. data/{meta/projectinfo → PROJECT} +1 -3
  2. data/README +114 -47
  3. data/VERSION +1 -0
  4. data/doc/{ChangeLog → CHANGELOG} +30 -0
  5. data/doc/{ChangeLog.pre1.5 → CHANGELOG.1} +0 -0
  6. data/{COPYING → doc/COPYING} +0 -0
  7. data/lib/facet/cache.rb +1 -0
  8. data/lib/facet/doublemetaphone.rb +1 -0
  9. data/lib/facet/enumerable/eachn.rb +1 -0
  10. data/lib/facet/file/self/null.rb +1 -0
  11. data/lib/facet/filesystem.rb +1 -0
  12. data/lib/facet/filetest/self/root.rb +1 -0
  13. data/lib/facet/hash/delete_at.rb +1 -0
  14. data/lib/facet/hash/delete_values.rb +1 -0
  15. data/lib/facet/hash/delete_values_at.rb +1 -0
  16. data/lib/facet/kernel/load_local.rb +1 -0
  17. data/lib/facet/main_as_module.rb +1 -0
  18. data/lib/facet/nilclass/to_path.rb +1 -0
  19. data/lib/facet/symbol/to_s.rb +1 -0
  20. data/lib/facets.rb +1 -0
  21. data/lib/facets/core/array/delete_values_at.rb +2 -0
  22. data/lib/facets/core/array/op_fetch.rb +27 -0
  23. data/lib/facets/core/array/op_store.rb +2 -47
  24. data/lib/facets/core/enumerable/each_by.rb +91 -2
  25. data/lib/facets/core/enumerable/eachn.rb +41 -0
  26. data/lib/facets/core/file/self/null.rb +17 -0
  27. data/lib/facets/core/filetest/self/root.rb +13 -0
  28. data/lib/facets/core/hash/delete_at.rb +10 -0
  29. data/lib/facets/core/hash/delete_values.rb +20 -0
  30. data/lib/facets/core/hash/delete_values_at.rb +24 -0
  31. data/lib/facets/core/hash/each.rb +26 -11
  32. data/lib/facets/core/kernel/load_local.rb +26 -0
  33. data/lib/facets/core/nilclass/to_path.rb +18 -0
  34. data/lib/facets/core/symbol/to_s.rb +10 -0
  35. data/lib/facets/more/association.rb +1 -1
  36. data/lib/facets/more/cache.rb +81 -0
  37. data/lib/facets/more/command.rb +11 -1
  38. data/lib/facets/more/doublemetaphone.rb +371 -0
  39. data/lib/facets/more/filesystem.rb +43 -0
  40. data/lib/facets/more/main_as_module.rb +42 -0
  41. data/lib/facets/more/taskable.rb +89 -212
  42. data/setup.rb +204 -181
  43. data/test/lib/facets/core/array/test_at_rand.rb +1 -1
  44. data/test/lib/facets/core/array/test_delete_unless.rb +1 -1
  45. data/test/lib/facets/core/array/test_delete_values.rb +1 -1
  46. data/test/lib/facets/core/array/test_delete_values_at.rb +1 -1
  47. data/test/lib/facets/core/array/test_first.rb +1 -1
  48. data/test/lib/facets/core/array/test_head.rb +1 -1
  49. data/test/lib/facets/core/array/test_last_index.rb +1 -1
  50. data/test/lib/facets/core/array/test_merge.rb +1 -1
  51. data/test/lib/facets/core/array/test_mid.rb +1 -1
  52. data/test/lib/facets/core/array/test_middle.rb +1 -1
  53. data/test/lib/facets/core/array/test_op_fetch.rb +9 -1
  54. data/test/lib/facets/core/array/test_op_store.rb +1 -1
  55. data/test/lib/facets/core/array/test_pick.rb +1 -1
  56. data/test/lib/facets/core/array/test_pos.rb +1 -1
  57. data/test/lib/facets/core/array/test_pot.rb +1 -1
  58. data/test/lib/facets/core/array/test_pull.rb +1 -1
  59. data/test/lib/facets/core/array/test_rand_index.rb +1 -1
  60. data/test/lib/facets/core/array/test_rand_subset.rb +1 -1
  61. data/test/lib/facets/core/array/test_range.rb +1 -1
  62. data/test/lib/facets/core/array/test_rotate.rb +1 -1
  63. data/test/lib/facets/core/array/test_select.rb +1 -1
  64. data/test/lib/facets/core/array/test_shuffle.rb +1 -1
  65. data/test/lib/facets/core/array/test_thru.rb +1 -1
  66. data/test/lib/facets/core/array/test_to_b.rb +1 -1
  67. data/test/lib/facets/core/array/test_to_h.rb +1 -1
  68. data/test/lib/facets/core/array/test_to_hash.rb +1 -1
  69. data/test/lib/facets/core/binding/self/test_of_caller.rb +1 -1
  70. data/test/lib/facets/core/binding/test___LINE__.rb +1 -1
  71. data/test/lib/facets/core/binding/test_call_stack.rb +1 -1
  72. data/test/lib/facets/core/binding/test_called.rb +1 -1
  73. data/test/lib/facets/core/binding/test_caller.rb +1 -1
  74. data/test/lib/facets/core/binding/test_defined.rb +1 -1
  75. data/test/lib/facets/core/binding/test_eval.rb +1 -1
  76. data/test/lib/facets/core/binding/test_local_variables.rb +1 -1
  77. data/test/lib/facets/core/binding/test_method_name.rb +1 -1
  78. data/test/lib/facets/core/binding/test_op_fetch.rb +1 -1
  79. data/test/lib/facets/core/binding/test_op_store.rb +1 -1
  80. data/test/lib/facets/core/binding/test_self.rb +1 -1
  81. data/test/lib/facets/core/class/test_cattr.rb +1 -1
  82. data/test/lib/facets/core/class/test_descendents.rb +1 -1
  83. data/test/lib/facets/core/class/test_method_name.rb +1 -1
  84. data/test/lib/facets/core/class/test_remove_descendents.rb +1 -1
  85. data/test/lib/facets/core/class/test_unix_path.rb +1 -1
  86. data/test/lib/facets/core/comparable/test_at_least.rb +1 -1
  87. data/test/lib/facets/core/comparable/test_clip.rb +1 -1
  88. data/test/lib/facets/core/comparable/test_cmp.rb +1 -1
  89. data/test/lib/facets/core/continuation/self/test_create.rb +1 -1
  90. data/test/lib/facets/core/date/test_days_in_month.rb +1 -1
  91. data/test/lib/facets/core/date/test_days_of_month.rb +1 -1
  92. data/test/lib/facets/core/date/test_stamp.rb +1 -1
  93. data/test/lib/facets/core/date/test_to_date.rb +1 -1
  94. data/test/lib/facets/core/date/test_to_s.rb +1 -1
  95. data/test/lib/facets/core/date/test_to_time.rb +1 -1
  96. data/test/lib/facets/core/dir/self/test_ancestor.rb +1 -1
  97. data/test/lib/facets/core/dir/self/test_ascend.rb +1 -1
  98. data/test/lib/facets/core/enumerable/self/test_combinations.rb +1 -1
  99. data/test/lib/facets/core/enumerable/self/test_cross.rb +1 -1
  100. data/test/lib/facets/core/enumerable/test_collect_with_index.rb +1 -1
  101. data/test/lib/facets/core/enumerable/test_commonality.rb +1 -1
  102. data/test/lib/facets/core/enumerable/test_compact_collect.rb +1 -1
  103. data/test/lib/facets/core/enumerable/test_count.rb +1 -1
  104. data/test/lib/facets/core/enumerable/test_cross.rb +1 -1
  105. data/test/lib/facets/core/enumerable/test_each_by.rb +71 -0
  106. data/test/lib/facets/core/enumerable/test_each_combination.rb +1 -1
  107. data/test/lib/facets/core/enumerable/test_each_pair.rb +1 -1
  108. data/test/lib/facets/core/enumerable/test_each_unique_pair.rb +1 -1
  109. data/test/lib/facets/core/enumerable/test_eachn.rb +34 -0
  110. data/test/lib/facets/core/enumerable/test_entropy.rb +1 -1
  111. data/test/lib/facets/core/enumerable/test_every.rb +1 -1
  112. data/test/lib/facets/core/enumerable/test_ew.rb +1 -1
  113. data/test/lib/facets/core/enumerable/test_filter_collect.rb +1 -1
  114. data/test/lib/facets/core/enumerable/test_find_collisions.rb +1 -1
  115. data/test/lib/facets/core/enumerable/test_frequency.rb +1 -1
  116. data/test/lib/facets/core/enumerable/test_graph.rb +1 -1
  117. data/test/lib/facets/core/enumerable/test_ideal_entropy.rb +1 -1
  118. data/test/lib/facets/core/enumerable/test_none.rb +1 -1
  119. data/test/lib/facets/core/enumerable/test_occur.rb +1 -1
  120. data/test/lib/facets/core/enumerable/test_one.rb +1 -1
  121. data/test/lib/facets/core/enumerable/test_op_pow.rb +1 -1
  122. data/test/lib/facets/core/enumerable/test_partition_by.rb +1 -1
  123. data/test/lib/facets/core/enumerable/test_permute.rb +1 -1
  124. data/test/lib/facets/core/enumerable/test_probability.rb +1 -1
  125. data/test/lib/facets/core/enumerable/test_to_h.rb +1 -1
  126. data/test/lib/facets/core/enumerable/test_uniq_by.rb +1 -1
  127. data/test/lib/facets/core/file/self/test_create.rb +1 -1
  128. data/test/lib/facets/core/file/self/test_open_as_string.rb +1 -1
  129. data/test/lib/facets/core/file/self/test_read_list.rb +1 -1
  130. data/test/lib/facets/core/file/self/test_sanitize.rb +1 -1
  131. data/test/lib/facets/core/file/self/test_split_all.rb +1 -1
  132. data/test/lib/facets/core/float/test_round_at.rb +1 -1
  133. data/test/lib/facets/core/float/test_round_to.rb +1 -1
  134. data/test/lib/facets/core/hash/self/test_zipnew.rb +1 -1
  135. data/test/lib/facets/core/hash/test_alias.rb +1 -1
  136. data/test/lib/facets/core/hash/test_assert_has_keys.rb +1 -1
  137. data/test/lib/facets/core/hash/test_assert_has_only_keys.rb +1 -1
  138. data/test/lib/facets/core/hash/test_at.rb +1 -1
  139. data/test/lib/facets/core/hash/test_collate.rb +1 -1
  140. data/test/lib/facets/core/hash/test_each.rb +1 -1
  141. data/test/lib/facets/core/hash/test_each_with_index.rb +1 -1
  142. data/test/lib/facets/core/hash/test_each_with_key.rb +1 -1
  143. data/test/lib/facets/core/hash/test_graph.rb +1 -1
  144. data/test/lib/facets/core/hash/test_has_keys.rb +1 -1
  145. data/test/lib/facets/core/hash/test_has_only_keys.rb +1 -1
  146. data/test/lib/facets/core/hash/test_inverse.rb +1 -1
  147. data/test/lib/facets/core/hash/test_normalize_keys.rb +1 -1
  148. data/test/lib/facets/core/hash/test_op_fetch.rb +1 -1
  149. data/test/lib/facets/core/hash/test_op_lshift.rb +1 -1
  150. data/test/lib/facets/core/hash/test_rand_key.rb +1 -1
  151. data/test/lib/facets/core/hash/test_rand_pair.rb +1 -1
  152. data/test/lib/facets/core/hash/test_rand_value.rb +1 -1
  153. data/test/lib/facets/core/hash/test_replace_each.rb +1 -1
  154. data/test/lib/facets/core/hash/test_shuffle.rb +1 -1
  155. data/test/lib/facets/core/hash/test_slice.rb +1 -1
  156. data/test/lib/facets/core/hash/test_stringify_keys.rb +1 -1
  157. data/test/lib/facets/core/hash/test_swap.rb +1 -1
  158. data/test/lib/facets/core/hash/test_swapkey.rb +1 -1
  159. data/test/lib/facets/core/hash/test_symbolize_keys.rb +1 -1
  160. data/test/lib/facets/core/hash/test_to_h.rb +1 -1
  161. data/test/lib/facets/core/hash/test_to_ostruct.rb +1 -1
  162. data/test/lib/facets/core/hash/test_to_ostruct_recurse.rb +1 -1
  163. data/test/lib/facets/core/hash/test_traverse.rb +1 -1
  164. data/test/lib/facets/core/hash/test_update_each.rb +1 -1
  165. data/test/lib/facets/core/hash/test_update_keys.rb +1 -1
  166. data/test/lib/facets/core/hash/test_update_values.rb +1 -1
  167. data/test/lib/facets/core/hash/test_weave.rb +1 -1
  168. data/test/lib/facets/core/integer/test_factorial.rb +1 -1
  169. data/test/lib/facets/core/integer/test_multiple.rb +1 -1
  170. data/test/lib/facets/core/integer/test_of.rb +1 -1
  171. data/test/lib/facets/core/integer/test_ordinal.rb +1 -1
  172. data/test/lib/facets/core/integer/test_times_collect.rb +1 -1
  173. data/test/lib/facets/core/kernel/test___class__.rb +1 -1
  174. data/test/lib/facets/core/kernel/test_as.rb +1 -1
  175. data/test/lib/facets/core/kernel/test_assign_from.rb +1 -1
  176. data/test/lib/facets/core/kernel/test_assign_with.rb +1 -1
  177. data/test/lib/facets/core/kernel/test_bool.rb +1 -1
  178. data/test/lib/facets/core/kernel/test_bug.rb +1 -1
  179. data/test/lib/facets/core/kernel/test_call_stack.rb +1 -1
  180. data/test/lib/facets/core/kernel/test_called.rb +1 -1
  181. data/test/lib/facets/core/kernel/test_callee.rb +1 -1
  182. data/test/lib/facets/core/kernel/test_constant.rb +1 -1
  183. data/test/lib/facets/core/kernel/test_copy.rb +1 -1
  184. data/test/lib/facets/core/kernel/test_deep_copy.rb +1 -1
  185. data/test/lib/facets/core/kernel/test_demo.rb +1 -1
  186. data/test/lib/facets/core/kernel/test_fn.rb +1 -1
  187. data/test/lib/facets/core/kernel/test_get_by_id.rb +1 -1
  188. data/test/lib/facets/core/kernel/test_here.rb +1 -1
  189. data/test/lib/facets/core/kernel/test_in.rb +1 -1
  190. data/test/lib/facets/core/kernel/test_instance_exec.rb +1 -1
  191. data/test/lib/facets/core/kernel/test_maybe.rb +1 -1
  192. data/test/lib/facets/core/kernel/test_metaclass.rb +1 -1
  193. data/test/lib/facets/core/kernel/test_method.rb +1 -1
  194. data/test/lib/facets/core/kernel/test_methods.rb +1 -1
  195. data/test/lib/facets/core/kernel/test_new.rb +1 -1
  196. data/test/lib/facets/core/kernel/test_object_class.rb +1 -1
  197. data/test/lib/facets/core/kernel/test_object_hexid.rb +1 -1
  198. data/test/lib/facets/core/kernel/test_quaclass.rb +1 -1
  199. data/test/lib/facets/core/kernel/test_require_all.rb +1 -1
  200. data/test/lib/facets/core/kernel/test_require_esc.rb +1 -1
  201. data/test/lib/facets/core/kernel/test_require_facet.rb +1 -1
  202. data/test/lib/facets/core/kernel/test_resc.rb +1 -1
  203. data/test/lib/facets/core/kernel/test_returning.rb +1 -1
  204. data/test/lib/facets/core/kernel/test_send_as.rb +1 -1
  205. data/test/lib/facets/core/kernel/test_set_from.rb +1 -1
  206. data/test/lib/facets/core/kernel/test_set_with.rb +1 -1
  207. data/test/lib/facets/core/kernel/test_silently.rb +1 -1
  208. data/test/lib/facets/core/kernel/test_singleton.rb +1 -1
  209. data/test/lib/facets/core/kernel/test_singleton_class.rb +1 -1
  210. data/test/lib/facets/core/kernel/test_superior.rb +1 -1
  211. data/test/lib/facets/core/kernel/test_supermethod.rb +1 -1
  212. data/test/lib/facets/core/kernel/test_this.rb +1 -1
  213. data/test/lib/facets/core/kernel/test_to_b.rb +1 -1
  214. data/test/lib/facets/core/kernel/test_to_bool.rb +1 -1
  215. data/test/lib/facets/core/kernel/test_to_data.rb +1 -1
  216. data/test/lib/facets/core/kernel/test_uri.rb +1 -1
  217. data/test/lib/facets/core/kernel/test_val.rb +1 -1
  218. data/test/lib/facets/core/kernel/test_with_accessor.rb +1 -1
  219. data/test/lib/facets/core/matchdata/test_match.rb +1 -1
  220. data/test/lib/facets/core/matchdata/test_matchtree.rb +1 -1
  221. data/test/lib/facets/core/module/test_abstract.rb +1 -1
  222. data/test/lib/facets/core/module/test_alias_module_function.rb +1 -1
  223. data/test/lib/facets/core/module/test_ancestor.rb +1 -1
  224. data/test/lib/facets/core/module/test_basename.rb +1 -1
  225. data/test/lib/facets/core/module/test_by_name.rb +1 -1
  226. data/test/lib/facets/core/module/test_class_extension.rb +1 -1
  227. data/test/lib/facets/core/module/test_clone_using.rb +1 -1
  228. data/test/lib/facets/core/module/test_dirname.rb +1 -1
  229. data/test/lib/facets/core/module/test_equate_on.rb +1 -1
  230. data/test/lib/facets/core/module/test_include_as.rb +1 -1
  231. data/test/lib/facets/core/module/test_initializer.rb +1 -1
  232. data/test/lib/facets/core/module/test_instance_methods.rb +1 -1
  233. data/test/lib/facets/core/module/test_integrate.rb +1 -1
  234. data/test/lib/facets/core/module/test_memoize.rb +1 -1
  235. data/test/lib/facets/core/module/test_modspace.rb +1 -1
  236. data/test/lib/facets/core/module/test_namespace.rb +1 -1
  237. data/test/lib/facets/core/module/test_nesting.rb +1 -1
  238. data/test/lib/facets/core/module/test_nodef.rb +1 -1
  239. data/test/lib/facets/core/module/test_on_included.rb +1 -1
  240. data/test/lib/facets/core/module/test_redef.rb +1 -1
  241. data/test/lib/facets/core/module/test_redefine_method.rb +1 -1
  242. data/test/lib/facets/core/module/test_redirect.rb +1 -1
  243. data/test/lib/facets/core/module/test_redirect_method.rb +1 -1
  244. data/test/lib/facets/core/module/test_remove.rb +1 -1
  245. data/test/lib/facets/core/module/test_rename.rb +1 -1
  246. data/test/lib/facets/core/module/test_rename_method.rb +1 -1
  247. data/test/lib/facets/core/module/test_revisal.rb +1 -1
  248. data/test/lib/facets/core/module/test_shadow_method.rb +1 -1
  249. data/test/lib/facets/core/module/test_sort_on.rb +1 -1
  250. data/test/lib/facets/core/module/test_this.rb +1 -1
  251. data/test/lib/facets/core/module/test_wrap.rb +1 -1
  252. data/test/lib/facets/core/module/test_wrap_method.rb +1 -1
  253. data/test/lib/facets/core/nilclass/test_blank.rb +1 -1
  254. data/test/lib/facets/core/nilclass/test_empty.rb +1 -1
  255. data/test/lib/facets/core/nilclass/test_include.rb +1 -1
  256. data/test/lib/facets/core/nilclass/test_op_fetch.rb +1 -1
  257. data/test/lib/facets/core/nilclass/test_size.rb +1 -1
  258. data/test/lib/facets/core/nilclass/test_to_h.rb +1 -1
  259. data/test/lib/facets/core/numeric/test_approx.rb +1 -1
  260. data/test/lib/facets/core/numeric/test_ceil_multiple.rb +1 -1
  261. data/test/lib/facets/core/numeric/test_distance.rb +1 -1
  262. data/test/lib/facets/core/numeric/test_succ.rb +1 -1
  263. data/test/lib/facets/core/numeric/test_to_b.rb +1 -1
  264. data/test/lib/facets/core/ostruct/test___merge__.rb +1 -1
  265. data/test/lib/facets/core/ostruct/test___update__.rb +1 -1
  266. data/test/lib/facets/core/ostruct/test_op_fetch.rb +1 -1
  267. data/test/lib/facets/core/ostruct/test_op_store.rb +1 -1
  268. data/test/lib/facets/core/proc/test_compose.rb +1 -1
  269. data/test/lib/facets/core/proc/test_op_mul.rb +1 -1
  270. data/test/lib/facets/core/proc/test_to_method.rb +1 -1
  271. data/test/lib/facets/core/range/test_to_r.rb +1 -1
  272. data/test/lib/facets/core/range/test_to_range.rb +1 -1
  273. data/test/lib/facets/core/range/test_umbrella.rb +1 -1
  274. data/test/lib/facets/core/range/test_within.rb +1 -1
  275. data/test/lib/facets/core/regexp/test_arity.rb +1 -1
  276. data/test/lib/facets/core/regexp/test_to_re.rb +1 -1
  277. data/test/lib/facets/core/regexp/test_to_regexp.rb +1 -1
  278. data/test/lib/facets/core/string/self/test_interpolate.rb +1 -1
  279. data/test/lib/facets/core/string/self/test_patterns.rb +1 -1
  280. data/test/lib/facets/core/string/self/test_rand_letter.rb +1 -1
  281. data/test/lib/facets/core/string/test_align_center.rb +1 -1
  282. data/test/lib/facets/core/string/test_at_rand.rb +1 -1
  283. data/test/lib/facets/core/string/test_basename.rb +1 -1
  284. data/test/lib/facets/core/string/test_blank.rb +1 -1
  285. data/test/lib/facets/core/string/test_bracket.rb +1 -1
  286. data/test/lib/facets/core/string/test_camelcase.rb +1 -1
  287. data/test/lib/facets/core/string/test_camelize.rb +1 -1
  288. data/test/lib/facets/core/string/test_capitalized.rb +1 -1
  289. data/test/lib/facets/core/string/test_chars.rb +1 -1
  290. data/test/lib/facets/core/string/test_cmp.rb +1 -1
  291. data/test/lib/facets/core/string/test_demodulize.rb +1 -1
  292. data/test/lib/facets/core/string/test_divide.rb +1 -1
  293. data/test/lib/facets/core/string/test_downcase.rb +1 -1
  294. data/test/lib/facets/core/string/test_dresner.rb +1 -1
  295. data/test/lib/facets/core/string/test_each_char.rb +1 -1
  296. data/test/lib/facets/core/string/test_each_word.rb +1 -1
  297. data/test/lib/facets/core/string/test_first.rb +1 -1
  298. data/test/lib/facets/core/string/test_fold.rb +1 -1
  299. data/test/lib/facets/core/string/test_humanize.rb +1 -1
  300. data/test/lib/facets/core/string/test_indent.rb +1 -1
  301. data/test/lib/facets/core/string/test_index_all.rb +1 -1
  302. data/test/lib/facets/core/string/test_last.rb +1 -1
  303. data/test/lib/facets/core/string/test_line_wrap.rb +1 -1
  304. data/test/lib/facets/core/string/test_lines.rb +1 -1
  305. data/test/lib/facets/core/string/test_lowercase.rb +1 -1
  306. data/test/lib/facets/core/string/test_margin.rb +1 -1
  307. data/test/lib/facets/core/string/test_methodize.rb +1 -1
  308. data/test/lib/facets/core/string/test_modulize.rb +1 -1
  309. data/test/lib/facets/core/string/test_mscan.rb +1 -1
  310. data/test/lib/facets/core/string/test_natcmp.rb +1 -1
  311. data/test/lib/facets/core/string/test_nchar.rb +1 -1
  312. data/test/lib/facets/core/string/test_pathize.rb +1 -1
  313. data/test/lib/facets/core/string/test_pop.rb +1 -1
  314. data/test/lib/facets/core/string/test_pot.rb +1 -1
  315. data/test/lib/facets/core/string/test_push.rb +1 -1
  316. data/test/lib/facets/core/string/test_quote.rb +1 -1
  317. data/test/lib/facets/core/string/test_rand_byte.rb +1 -1
  318. data/test/lib/facets/core/string/test_rand_index.rb +1 -1
  319. data/test/lib/facets/core/string/test_range.rb +1 -1
  320. data/test/lib/facets/core/string/test_range_all.rb +1 -1
  321. data/test/lib/facets/core/string/test_range_of_line.rb +1 -1
  322. data/test/lib/facets/core/string/test_regesc.rb +1 -1
  323. data/test/lib/facets/core/string/test_shatter.rb +1 -1
  324. data/test/lib/facets/core/string/test_shift.rb +1 -1
  325. data/test/lib/facets/core/string/test_shuffle.rb +1 -1
  326. data/test/lib/facets/core/string/test_similarity.rb +1 -1
  327. data/test/lib/facets/core/string/test_singular.rb +1 -1
  328. data/test/lib/facets/core/string/test_soundex.rb +1 -1
  329. data/test/lib/facets/core/string/test_succ.rb +1 -1
  330. data/test/lib/facets/core/string/test_to_a.rb +1 -1
  331. data/test/lib/facets/core/string/test_to_b.rb +1 -1
  332. data/test/lib/facets/core/string/test_to_const.rb +1 -1
  333. data/test/lib/facets/core/string/test_to_date.rb +1 -1
  334. data/test/lib/facets/core/string/test_to_proc.rb +1 -1
  335. data/test/lib/facets/core/string/test_to_re.rb +1 -1
  336. data/test/lib/facets/core/string/test_to_time.rb +1 -1
  337. data/test/lib/facets/core/string/test_unix_crypt.rb +1 -1
  338. data/test/lib/facets/core/string/test_unpack.rb +1 -1
  339. data/test/lib/facets/core/string/test_unshift.rb +1 -1
  340. data/test/lib/facets/core/string/test_upcase.rb +1 -1
  341. data/test/lib/facets/core/string/test_whitespace.rb +1 -1
  342. data/test/lib/facets/core/string/test_word_filter.rb +1 -1
  343. data/test/lib/facets/core/string/test_word_wrap.rb +1 -1
  344. data/test/lib/facets/core/string/test_words.rb +1 -1
  345. data/test/lib/facets/core/symbol/test_camelcase.rb +1 -1
  346. data/test/lib/facets/core/symbol/test_camelize.rb +1 -1
  347. data/test/lib/facets/core/symbol/test_capitalize.rb +1 -1
  348. data/test/lib/facets/core/symbol/test_capitalized.rb +1 -1
  349. data/test/lib/facets/core/symbol/test_downcase.rb +1 -1
  350. data/test/lib/facets/core/symbol/test_not.rb +1 -1
  351. data/test/lib/facets/core/symbol/test_pad.rb +1 -1
  352. data/test/lib/facets/core/symbol/test_succ.rb +1 -1
  353. data/test/lib/facets/core/symbol/test_to_const.rb +1 -1
  354. data/test/lib/facets/core/symbol/test_to_proc.rb +1 -1
  355. data/test/lib/facets/core/symbol/test_to_str.rb +1 -1
  356. data/test/lib/facets/core/symbol/test_underscore.rb +1 -1
  357. data/test/lib/facets/core/symbol/test_upcase.rb +1 -1
  358. data/test/lib/facets/core/time/test_change.rb +1 -1
  359. data/test/lib/facets/core/time/test_elapse.rb +1 -1
  360. data/test/lib/facets/core/time/test_stamp.rb +1 -1
  361. data/test/lib/facets/core/time/test_to_date.rb +1 -1
  362. data/test/lib/facets/core/time/test_to_s.rb +1 -1
  363. data/test/lib/facets/core/time/test_to_time.rb +1 -1
  364. data/test/lib/facets/more/test_annattr.rb +1 -1
  365. data/test/lib/facets/more/test_annotation.rb +1 -1
  366. data/test/lib/facets/more/test_ansicode.rb +1 -1
  367. data/test/lib/facets/more/test_association.rb +1 -1
  368. data/test/lib/facets/more/test_autoarray.rb +1 -1
  369. data/test/lib/facets/more/test_basicobject.rb +1 -1
  370. data/test/lib/facets/more/test_bbcode.rb +1 -1
  371. data/test/lib/facets/more/test_binaryreader.rb +1 -1
  372. data/test/lib/facets/more/test_bitmask.rb +1 -1
  373. data/test/lib/facets/more/test_bytes.rb +1 -1
  374. data/test/lib/facets/more/test_classmethods.rb +1 -1
  375. data/test/lib/facets/more/test_command.rb +1 -1
  376. data/test/lib/facets/more/test_coroutine.rb +1 -1
  377. data/test/lib/facets/more/test_crypt.rb +1 -1
  378. data/test/lib/facets/more/test_cut.rb +1 -1
  379. data/test/lib/facets/more/test_dictionary.rb +1 -1
  380. data/test/lib/facets/more/test_elementor.rb +1 -1
  381. data/test/lib/facets/more/test_enumerablepass.rb +1 -1
  382. data/test/lib/facets/more/test_floatstring.rb +1 -1
  383. data/test/lib/facets/more/test_functor.rb +1 -1
  384. data/test/lib/facets/more/test_htmlbuilder.rb +1 -1
  385. data/test/lib/facets/more/test_infinity.rb +1 -1
  386. data/test/lib/facets/more/test_inheritor.rb +1 -1
  387. data/test/lib/facets/more/test_instance_intercept.rb +1 -1
  388. data/test/lib/facets/more/test_interval.rb +1 -1
  389. data/test/lib/facets/more/test_json.rb +1 -1
  390. data/test/lib/facets/more/test_lisp.rb +1 -1
  391. data/test/lib/facets/more/test_lisp_format.rb +1 -1
  392. data/test/lib/facets/more/test_lrucache.rb +1 -1
  393. data/test/lib/facets/more/test_mathconstants.rb +1 -1
  394. data/test/lib/facets/more/test_methodfilter.rb +1 -1
  395. data/test/lib/facets/more/test_methodprobe.rb +1 -1
  396. data/test/lib/facets/more/test_multipliers.rb +1 -1
  397. data/test/lib/facets/more/test_multiton.rb +1 -1
  398. data/test/lib/facets/more/test_nackclass.rb +1 -1
  399. data/test/lib/facets/more/test_nilcomparable.rb +1 -1
  400. data/test/lib/facets/more/test_opencascade.rb +1 -1
  401. data/test/lib/facets/more/test_openobject.rb +1 -1
  402. data/test/lib/facets/more/test_overload.rb +1 -1
  403. data/test/lib/facets/more/test_paramix.rb +1 -1
  404. data/test/lib/facets/more/test_pqueue.rb +1 -1
  405. data/test/lib/facets/more/test_predicate.rb +1 -1
  406. data/test/lib/facets/more/test_preinitialize.rb +1 -1
  407. data/test/lib/facets/more/test_promoteself.rb +1 -1
  408. data/test/lib/facets/more/test_recorder.rb +1 -1
  409. data/test/lib/facets/more/test_snapshot.rb +1 -1
  410. data/test/lib/facets/more/test_statichash.rb +1 -1
  411. data/test/lib/facets/more/test_syncarray.rb +1 -1
  412. data/test/lib/facets/more/test_synchash.rb +1 -1
  413. data/test/lib/facets/more/test_tagiterator.rb +1 -1
  414. data/test/lib/facets/more/test_taskable.rb +28 -7
  415. data/test/lib/facets/more/test_timer.rb +1 -1
  416. data/test/lib/facets/more/test_times.rb +1 -1
  417. data/test/lib/facets/more/test_tuple.rb +1 -1
  418. data/test/lib/facets/more/test_typecast.rb +1 -1
  419. data/test/lib/facets/more/test_uninheritable.rb +1 -1
  420. data/test/lib/facets/more/test_units.rb +1 -1
  421. data/test/lib/facets/more/test_xmlbuilder.rb +1 -1
  422. data/test/lib/facets/more/test_xmlhelper.rb +1 -1
  423. data/test/lib/facets/more/test_xoxo.rb +1 -1
  424. data/test/lib/facets/more/test_yamlstruct.rb +1 -1
  425. data/util/announce +20 -0
  426. data/util/changelog +8 -0
  427. data/util/count +8 -0
  428. data/util/extest +8 -0
  429. data/util/list +38 -0
  430. data/util/package +9 -0
  431. data/util/prepare +12 -0
  432. data/util/redirect +34 -0
  433. data/util/release +13 -0
  434. data/util/setup +7 -0
  435. data/util/test +7 -0
  436. data/util/version +8 -0
  437. metadata +1514 -1491
  438. data/doc/CAUTION +0 -55
  439. data/doc/IMPORTANT +0 -8
  440. data/doc/LATEST +0 -41
  441. data/doc/history/ANN-0.6.0 +0 -40
  442. data/doc/history/ANN-0.6.1 +0 -36
  443. data/doc/history/ANN-0.6.3 +0 -43
  444. data/doc/history/ANN-0.7.0 +0 -59
  445. data/doc/history/ANN-0.8.1 +0 -127
  446. data/doc/history/INTRO +0 -172
  447. data/doc/history/README +0 -223
  448. data/doc/history/README-OLD +0 -180
  449. data/doc/manifest +0 -1209
  450. data/doc/scrap/Rakefile.old +0 -181
  451. data/lib/facet/enumerable/each_slice.rb +0 -1
  452. data/lib/facets/core/enumerable/each_slice.rb +0 -131
  453. data/meta/reapfile +0 -184
  454. data/meta/task +0 -74
  455. data/meta/tasks/calibre.rb +0 -16
  456. 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
- # Forked from version 3.2.1 #
13
- # #
14
- # -trans #
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
- # Windows?
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
- def verbose=(x) @verbose = x end
93
- def verbose?() @verbose end
65
+ attr_writer :verbose
94
66
 
95
- def no_harm=(x) @no_harm = x end
96
- def no_harm?() @no_harm end
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() '.config' end
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
- #standard_entries(@rbconfig).each do |ent|
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 #(rbconfig)
170
- rbconfig = @rbconfig
149
+ def standard_entries(rbconfig)
150
+ c = rbconfig
171
151
 
172
- rubypath = File.join(rbconfig['bindir'], rbconfig['ruby_install_name'] + rbconfig['EXEEXT'])
152
+ rubypath = File.join(c['bindir'], c['ruby_install_name'] + c['EXEEXT'])
173
153
 
174
- major = rbconfig['MAJOR'].to_i
175
- minor = rbconfig['MINOR'].to_i
176
- teeny = rbconfig['TEENY'].to_i
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
- # CHANGE Do not need to support these old versions any more.
180
-
181
- # # ruby ver. >= 1.4.4?
182
- # newpath_p = ((major >= 2) or
183
- # ((major == 1) and
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
- #if c['rubylibdir']
165
+ if c['rubylibdir']
188
166
  # V > 1.6.3
189
-
190
- root = '/'
191
- prefix = rbconfig['prefix']
192
-
193
- libruby = "#{prefix}/lib/ruby"
194
- librubyver = rbconfig['rubylibdir']
195
- librubyverarch = rbconfig['archdir']
196
- siteruby = rbconfig['sitedir']
197
- siterubyver = rbconfig['sitelibdir']
198
- siterubyverarch = rbconfig['sitearchdir']
199
-
200
- bindir = paramize(rbconfig['bindir'])
201
- libdir = paramize(rbconfig['libdir'])
202
- datadir = paramize(rbconfig['datadir'])
203
- mandir = paramize(rbconfig['mandir'])
204
- sysconfdir = paramize(rbconfig['sysconfdir'])
205
- localstatedir = paramize(rbconfig['localstatedir'])
206
-
207
- # elsif newpath_p
208
- # # 1.4.4 <= V <= 1.6.3
209
- # libruby = "#{c['prefix']}/lib/ruby"
210
- # librubyver = "#{c['prefix']}/lib/ruby/#{version}"
211
- # librubyverarch = "#{c['prefix']}/lib/ruby/#{version}/#{c['arch']}"
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(rbconfig['prefix'])}/, '$prefix')
191
+ path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix')
227
192
  }
228
193
 
229
- if arg = rbconfig['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ 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', 'install under libruby, site_ruby or $HOME respectively', &installdir_lambda),
253
- PathItem.new('root', 'path', root, 'root destination directory'),
254
- PathItem.new('prefix', 'path', prefix, 'path prefix of target environment'),
255
- PathItem.new('bindir', 'path', bindir, 'the directory for commands'),
256
- PathItem.new('libdir', 'path', libdir, 'the directory for libraries'),
257
- PathItem.new('datadir', 'path', datadir, 'the directory for shared data'),
258
- PathItem.new('mandir', 'path', mandir, 'the directory for man pages'),
259
- PathItem.new('sysconfdir', 'path', sysconfdir, 'the directory for system configuration files'),
260
- PathItem.new('localstatedir', 'path', localstatedir, 'the directory for local state data'),
261
- PathItem.new('libruby', 'path', libruby, 'the directory for ruby libraries'),
262
- PathItem.new('librubyver', 'path', librubyver, 'the directory for standard ruby libraries'),
263
- PathItem.new('librubyverarch', 'path', librubyverarch, 'the directory for standard ruby extensions'),
264
- PathItem.new('siteruby', 'path', siteruby, 'the directory for version-independent aux ruby libraries'),
265
- PathItem.new('siterubyver', 'path', siterubyver, 'the directory for aux ruby libraries'),
266
- PathItem.new('siterubyverarch', 'path', siterubyverarch, 'the directory for aux ruby binaries'),
267
- PathItem.new('rbdir', 'path', '$siterubyver', 'the directory for ruby scripts'),
268
- PathItem.new('sodir', 'path', '$siterubyverarch', 'the directory for ruby extentions'),
269
- PathItem.new('rubypath', 'path', rubypath, 'the path to set to #! line'),
270
- ProgramItem.new('rubyprog', 'name', rubypath, 'the ruby program using for installation'),
271
- ProgramItem.new('makeprog', 'name', makeprog, 'the make program to compile ruby extentions'),
272
- SelectItem.new('shebang', 'all/ruby/never', 'ruby', 'shebang line (#!) editing mode'),
273
- BoolItem.new('without-ext', 'yes/no', 'no', 'does not compile/install ruby extentions')
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', 'name,name...', '', 'ALL', 'package names that you want to install'),
292
- PackageSelectionItem.new('without', 'name,name...', '', 'NONE', 'package names that you do not want to install')
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? ; true ; end
358
- def value ; @value ; end
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() 'bool' end
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() 'path' end
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() 'program' end
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() 'select' end
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 = File.join(prefix, File.expand_path(dirname)) if prefix
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 curr_srcdir() "#{srcdir_root()}/#{relpath()}" end
717
- def curr_objdir() "#{objdir_root()}/#{relpath()}" end
718
- def srcfile(path) "#{curr_srcdir()}/#{path}" end
719
- def srcexist?(path) File.exist?(srcfile(path)) end
720
- def srcdirectory?(path) File.dir?(srcfile(path)) end
721
- def srcfile?(path) File.file?(srcfile(path)) end
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 self.invoke
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 self.multipackage?
778
+ def ToplevelInstaller.multipackage?
770
779
  File.dir?(File.dirname($0) + '/packages')
771
780
  end
772
781
 
773
- def self.load_rbconfig
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() @ardir end
837
- def objdir_root() '.' end
838
- def relpath() '.' end
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) ; end
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() @srcdir end
1170
- def objdir_root() @objdir end
1171
- def relpath() @currdir end
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