facets 1.8.49 → 1.8.51

Sign up to get free protection for your applications and to get access to all the features.
Files changed (554) hide show
  1. data/PROJECT +4 -1
  2. data/Rakefile +25 -48
  3. data/VERSION +1 -1
  4. data/doc/AUTHORS +1 -0
  5. data/doc/CHANGES +6 -0
  6. data/lib/facets/core/kernel/tap.rb +33 -3
  7. data/lib/facets/more/command.rb +507 -271
  8. metadata +2 -548
  9. data/test/lib/facets/core/array/test_at_rand.rb +0 -34
  10. data/test/lib/facets/core/array/test_delete_unless.rb +0 -28
  11. data/test/lib/facets/core/array/test_delete_values.rb +0 -28
  12. data/test/lib/facets/core/array/test_delete_values_at.rb +0 -31
  13. data/test/lib/facets/core/array/test_first.rb +0 -46
  14. data/test/lib/facets/core/array/test_head.rb +0 -42
  15. data/test/lib/facets/core/array/test_last_index.rb +0 -26
  16. data/test/lib/facets/core/array/test_merge.rb +0 -35
  17. data/test/lib/facets/core/array/test_mid.rb +0 -33
  18. data/test/lib/facets/core/array/test_middle.rb +0 -29
  19. data/test/lib/facets/core/array/test_op_div.rb +0 -27
  20. data/test/lib/facets/core/array/test_op_fetch.rb +0 -35
  21. data/test/lib/facets/core/array/test_pad.rb +0 -48
  22. data/test/lib/facets/core/array/test_pick.rb +0 -40
  23. data/test/lib/facets/core/array/test_pos.rb +0 -28
  24. data/test/lib/facets/core/array/test_pot.rb +0 -28
  25. data/test/lib/facets/core/array/test_pull.rb +0 -28
  26. data/test/lib/facets/core/array/test_rand_index.rb +0 -29
  27. data/test/lib/facets/core/array/test_rand_subset.rb +0 -29
  28. data/test/lib/facets/core/array/test_range.rb +0 -32
  29. data/test/lib/facets/core/array/test_rotate.rb +0 -36
  30. data/test/lib/facets/core/array/test_select.rb +0 -28
  31. data/test/lib/facets/core/array/test_shuffle.rb +0 -35
  32. data/test/lib/facets/core/array/test_thru.rb +0 -27
  33. data/test/lib/facets/core/array/test_to_b.rb +0 -27
  34. data/test/lib/facets/core/array/test_to_h.rb +0 -33
  35. data/test/lib/facets/core/array/test_to_hash.rb +0 -27
  36. data/test/lib/facets/core/binding/self/test_of_caller.rb +0 -35
  37. data/test/lib/facets/core/binding/test___LINE__.rb +0 -43
  38. data/test/lib/facets/core/binding/test_call_stack.rb +0 -34
  39. data/test/lib/facets/core/binding/test_called.rb +0 -30
  40. data/test/lib/facets/core/binding/test_caller.rb +0 -35
  41. data/test/lib/facets/core/binding/test_defined.rb +0 -34
  42. data/test/lib/facets/core/binding/test_eval.rb +0 -34
  43. data/test/lib/facets/core/binding/test_local_variables.rb +0 -34
  44. data/test/lib/facets/core/binding/test_method_name.rb +0 -34
  45. data/test/lib/facets/core/binding/test_op_fetch.rb +0 -34
  46. data/test/lib/facets/core/binding/test_op_store.rb +0 -35
  47. data/test/lib/facets/core/binding/test_self.rb +0 -34
  48. data/test/lib/facets/core/class/test_cattr.rb +0 -63
  49. data/test/lib/facets/core/class/test_descendents.rb +0 -30
  50. data/test/lib/facets/core/class/test_method_name.rb +0 -26
  51. data/test/lib/facets/core/class/test_remove_descendents.rb +0 -32
  52. data/test/lib/facets/core/class/test_unix_path.rb +0 -26
  53. data/test/lib/facets/core/comparable/test_at_least.rb +0 -34
  54. data/test/lib/facets/core/comparable/test_clip.rb +0 -44
  55. data/test/lib/facets/core/comparable/test_cmp.rb +0 -28
  56. data/test/lib/facets/core/continuation/self/test_create.rb +0 -26
  57. data/test/lib/facets/core/date/test_days_in_month.rb +0 -30
  58. data/test/lib/facets/core/date/test_days_of_month.rb +0 -30
  59. data/test/lib/facets/core/date/test_stamp.rb +0 -38
  60. data/test/lib/facets/core/date/test_to_date.rb +0 -30
  61. data/test/lib/facets/core/date/test_to_s.rb +0 -30
  62. data/test/lib/facets/core/date/test_to_time.rb +0 -30
  63. data/test/lib/facets/core/dir/self/test_ancestor.rb +0 -26
  64. data/test/lib/facets/core/dir/self/test_ascend.rb +0 -41
  65. data/test/lib/facets/core/enumerable/self/test_combinations.rb +0 -46
  66. data/test/lib/facets/core/enumerable/test_cart.rb +0 -49
  67. data/test/lib/facets/core/enumerable/test_collect_with_index.rb +0 -27
  68. data/test/lib/facets/core/enumerable/test_commonality.rb +0 -31
  69. data/test/lib/facets/core/enumerable/test_compact_collect.rb +0 -27
  70. data/test/lib/facets/core/enumerable/test_count.rb +0 -38
  71. data/test/lib/facets/core/enumerable/test_each_by.rb +0 -71
  72. data/test/lib/facets/core/enumerable/test_each_combination.rb +0 -29
  73. data/test/lib/facets/core/enumerable/test_each_pair.rb +0 -29
  74. data/test/lib/facets/core/enumerable/test_each_slice.rb +0 -57
  75. data/test/lib/facets/core/enumerable/test_each_unique_pair.rb +0 -29
  76. data/test/lib/facets/core/enumerable/test_eachn.rb +0 -34
  77. data/test/lib/facets/core/enumerable/test_elementwise.rb +0 -40
  78. data/test/lib/facets/core/enumerable/test_entropy.rb +0 -26
  79. data/test/lib/facets/core/enumerable/test_every.rb +0 -35
  80. data/test/lib/facets/core/enumerable/test_ew.rb +0 -31
  81. data/test/lib/facets/core/enumerable/test_filter_collect.rb +0 -31
  82. data/test/lib/facets/core/enumerable/test_find_collisions.rb +0 -30
  83. data/test/lib/facets/core/enumerable/test_frequency.rb +0 -27
  84. data/test/lib/facets/core/enumerable/test_graph.rb +0 -30
  85. data/test/lib/facets/core/enumerable/test_ideal_entropy.rb +0 -27
  86. data/test/lib/facets/core/enumerable/test_none.rb +0 -33
  87. data/test/lib/facets/core/enumerable/test_occur.rb +0 -30
  88. data/test/lib/facets/core/enumerable/test_one.rb +0 -35
  89. data/test/lib/facets/core/enumerable/test_op_pow.rb +0 -27
  90. data/test/lib/facets/core/enumerable/test_op_tilde_self.rb +0 -40
  91. data/test/lib/facets/core/enumerable/test_partition_by.rb +0 -31
  92. data/test/lib/facets/core/enumerable/test_permutation.rb +0 -29
  93. data/test/lib/facets/core/enumerable/test_probability.rb +0 -27
  94. data/test/lib/facets/core/enumerable/test_to_h.rb +0 -27
  95. data/test/lib/facets/core/enumerable/test_uniq_by.rb +0 -28
  96. data/test/lib/facets/core/file/self/test_create.rb +0 -44
  97. data/test/lib/facets/core/file/self/test_open_as_string.rb +0 -50
  98. data/test/lib/facets/core/file/self/test_read_list.rb +0 -40
  99. data/test/lib/facets/core/file/self/test_sanitize.rb +0 -46
  100. data/test/lib/facets/core/file/self/test_split_all.rb +0 -27
  101. data/test/lib/facets/core/float/test_round_at.rb +0 -46
  102. data/test/lib/facets/core/float/test_round_to.rb +0 -46
  103. data/test/lib/facets/core/hash/self/test_zipnew.rb +0 -28
  104. data/test/lib/facets/core/hash/test_alias.rb +0 -31
  105. data/test/lib/facets/core/hash/test_assert_has_keys.rb +0 -27
  106. data/test/lib/facets/core/hash/test_assert_has_only_keys.rb +0 -27
  107. data/test/lib/facets/core/hash/test_at.rb +0 -28
  108. data/test/lib/facets/core/hash/test_collate.rb +0 -35
  109. data/test/lib/facets/core/hash/test_each_with_index.rb +0 -29
  110. data/test/lib/facets/core/hash/test_each_with_key.rb +0 -29
  111. data/test/lib/facets/core/hash/test_graph.rb +0 -28
  112. data/test/lib/facets/core/hash/test_has_keys.rb +0 -27
  113. data/test/lib/facets/core/hash/test_has_only_keys.rb +0 -27
  114. data/test/lib/facets/core/hash/test_inverse.rb +0 -30
  115. data/test/lib/facets/core/hash/test_normalize_keys.rb +0 -34
  116. data/test/lib/facets/core/hash/test_op_fetch.rb +0 -111
  117. data/test/lib/facets/core/hash/test_op_lshift.rb +0 -29
  118. data/test/lib/facets/core/hash/test_rand_key.rb +0 -27
  119. data/test/lib/facets/core/hash/test_rand_pair.rb +0 -27
  120. data/test/lib/facets/core/hash/test_rand_value.rb +0 -27
  121. data/test/lib/facets/core/hash/test_rekey.rb +0 -52
  122. data/test/lib/facets/core/hash/test_replace_each.rb +0 -29
  123. data/test/lib/facets/core/hash/test_shuffle.rb +0 -32
  124. data/test/lib/facets/core/hash/test_slice.rb +0 -27
  125. data/test/lib/facets/core/hash/test_stringify_keys.rb +0 -34
  126. data/test/lib/facets/core/hash/test_swap.rb +0 -27
  127. data/test/lib/facets/core/hash/test_swapkey.rb +0 -29
  128. data/test/lib/facets/core/hash/test_symbolize_keys.rb +0 -34
  129. data/test/lib/facets/core/hash/test_to_h.rb +0 -27
  130. data/test/lib/facets/core/hash/test_to_ostruct.rb +0 -30
  131. data/test/lib/facets/core/hash/test_to_ostruct_recurse.rb +0 -44
  132. data/test/lib/facets/core/hash/test_traverse.rb +0 -37
  133. data/test/lib/facets/core/hash/test_update_each.rb +0 -29
  134. data/test/lib/facets/core/hash/test_update_keys.rb +0 -28
  135. data/test/lib/facets/core/hash/test_update_values.rb +0 -28
  136. data/test/lib/facets/core/hash/test_weave.rb +0 -29
  137. data/test/lib/facets/core/integer/test_factorial.rb +0 -30
  138. data/test/lib/facets/core/integer/test_multiple.rb +0 -43
  139. data/test/lib/facets/core/integer/test_of.rb +0 -28
  140. data/test/lib/facets/core/integer/test_ordinal.rb +0 -29
  141. data/test/lib/facets/core/integer/test_times_collect.rb +0 -28
  142. data/test/lib/facets/core/kernel/test___class__.rb +0 -26
  143. data/test/lib/facets/core/kernel/test_as.rb +0 -42
  144. data/test/lib/facets/core/kernel/test_assign_from.rb +0 -31
  145. data/test/lib/facets/core/kernel/test_assign_with.rb +0 -31
  146. data/test/lib/facets/core/kernel/test_bool.rb +0 -41
  147. data/test/lib/facets/core/kernel/test_bug.rb +0 -26
  148. data/test/lib/facets/core/kernel/test_call_stack.rb +0 -26
  149. data/test/lib/facets/core/kernel/test_called.rb +0 -26
  150. data/test/lib/facets/core/kernel/test_callee.rb +0 -26
  151. data/test/lib/facets/core/kernel/test_constant.rb +0 -33
  152. data/test/lib/facets/core/kernel/test_copy.rb +0 -40
  153. data/test/lib/facets/core/kernel/test_deep_copy.rb +0 -40
  154. data/test/lib/facets/core/kernel/test_demo.rb +0 -28
  155. data/test/lib/facets/core/kernel/test_fn.rb +0 -26
  156. data/test/lib/facets/core/kernel/test_get_by_id.rb +0 -28
  157. data/test/lib/facets/core/kernel/test_here.rb +0 -26
  158. data/test/lib/facets/core/kernel/test_in.rb +0 -27
  159. data/test/lib/facets/core/kernel/test_instance_class.rb +0 -27
  160. data/test/lib/facets/core/kernel/test_instance_exec.rb +0 -58
  161. data/test/lib/facets/core/kernel/test_maybe.rb +0 -26
  162. data/test/lib/facets/core/kernel/test_meta_class.rb +0 -27
  163. data/test/lib/facets/core/kernel/test_metaclass.rb +0 -27
  164. data/test/lib/facets/core/kernel/test_method.rb +0 -32
  165. data/test/lib/facets/core/kernel/test_methods.rb +0 -50
  166. data/test/lib/facets/core/kernel/test_new.rb +0 -30
  167. data/test/lib/facets/core/kernel/test_object_class.rb +0 -26
  168. data/test/lib/facets/core/kernel/test_object_hexid.rb +0 -27
  169. data/test/lib/facets/core/kernel/test_qua_class.rb +0 -27
  170. data/test/lib/facets/core/kernel/test_require_all.rb +0 -26
  171. data/test/lib/facets/core/kernel/test_require_esc.rb +0 -27
  172. data/test/lib/facets/core/kernel/test_resc.rb +0 -27
  173. data/test/lib/facets/core/kernel/test_send_as.rb +0 -26
  174. data/test/lib/facets/core/kernel/test_set_from.rb +0 -33
  175. data/test/lib/facets/core/kernel/test_set_with.rb +0 -42
  176. data/test/lib/facets/core/kernel/test_silently.rb +0 -28
  177. data/test/lib/facets/core/kernel/test_singleton.rb +0 -40
  178. data/test/lib/facets/core/kernel/test_singleton_class.rb +0 -27
  179. data/test/lib/facets/core/kernel/test_super_at.rb +0 -30
  180. data/test/lib/facets/core/kernel/test_supermethod.rb +0 -33
  181. data/test/lib/facets/core/kernel/test_this.rb +0 -26
  182. data/test/lib/facets/core/kernel/test_to_b.rb +0 -28
  183. data/test/lib/facets/core/kernel/test_to_bool.rb +0 -28
  184. data/test/lib/facets/core/kernel/test_to_data.rb +0 -61
  185. data/test/lib/facets/core/kernel/test_uri.rb +0 -30
  186. data/test/lib/facets/core/kernel/test_val.rb +0 -43
  187. data/test/lib/facets/core/kernel/test_with.rb +0 -30
  188. data/test/lib/facets/core/kernel/test_with_accessor.rb +0 -51
  189. data/test/lib/facets/core/matchdata/test_match.rb +0 -29
  190. data/test/lib/facets/core/matchdata/test_matchtree.rb +0 -37
  191. data/test/lib/facets/core/module/self/test_op_add.rb +0 -50
  192. data/test/lib/facets/core/module/test_abstract.rb +0 -36
  193. data/test/lib/facets/core/module/test_alias_method_chain.rb +0 -46
  194. data/test/lib/facets/core/module/test_alias_module_function.rb +0 -34
  195. data/test/lib/facets/core/module/test_ancestor.rb +0 -26
  196. data/test/lib/facets/core/module/test_attr_tester.rb +0 -39
  197. data/test/lib/facets/core/module/test_basename.rb +0 -26
  198. data/test/lib/facets/core/module/test_by_name.rb +0 -29
  199. data/test/lib/facets/core/module/test_class_extension.rb +0 -70
  200. data/test/lib/facets/core/module/test_clone_using.rb +0 -55
  201. data/test/lib/facets/core/module/test_dirname.rb +0 -26
  202. data/test/lib/facets/core/module/test_equate_on.rb +0 -37
  203. data/test/lib/facets/core/module/test_include_as.rb +0 -45
  204. data/test/lib/facets/core/module/test_initializer.rb +0 -32
  205. data/test/lib/facets/core/module/test_instance_methods.rb +0 -59
  206. data/test/lib/facets/core/module/test_integrate.rb +0 -35
  207. data/test/lib/facets/core/module/test_memoize.rb +0 -50
  208. data/test/lib/facets/core/module/test_modspace.rb +0 -27
  209. data/test/lib/facets/core/module/test_namespace.rb +0 -66
  210. data/test/lib/facets/core/module/test_nesting.rb +0 -36
  211. data/test/lib/facets/core/module/test_new.rb +0 -34
  212. data/test/lib/facets/core/module/test_nodef.rb +0 -30
  213. data/test/lib/facets/core/module/test_on_included.rb +0 -36
  214. data/test/lib/facets/core/module/test_redef.rb +0 -30
  215. data/test/lib/facets/core/module/test_redefine_method.rb +0 -30
  216. data/test/lib/facets/core/module/test_redirect.rb +0 -30
  217. data/test/lib/facets/core/module/test_redirect_method.rb +0 -30
  218. data/test/lib/facets/core/module/test_remove.rb +0 -30
  219. data/test/lib/facets/core/module/test_rename.rb +0 -31
  220. data/test/lib/facets/core/module/test_rename_method.rb +0 -31
  221. data/test/lib/facets/core/module/test_revisal.rb +0 -35
  222. data/test/lib/facets/core/module/test_shadow_method.rb +0 -30
  223. data/test/lib/facets/core/module/test_sort_on.rb +0 -42
  224. data/test/lib/facets/core/module/test_this.rb +0 -31
  225. data/test/lib/facets/core/module/test_wrap.rb +0 -30
  226. data/test/lib/facets/core/module/test_wrap_method.rb +0 -30
  227. data/test/lib/facets/core/nilclass/test_blank.rb +0 -26
  228. data/test/lib/facets/core/nilclass/test_empty.rb +0 -26
  229. data/test/lib/facets/core/nilclass/test_include.rb +0 -26
  230. data/test/lib/facets/core/nilclass/test_op_fetch.rb +0 -28
  231. data/test/lib/facets/core/nilclass/test_size.rb +0 -30
  232. data/test/lib/facets/core/nilclass/test_to_h.rb +0 -26
  233. data/test/lib/facets/core/numeric/test_approx.rb +0 -29
  234. data/test/lib/facets/core/numeric/test_ceil_multiple.rb +0 -31
  235. data/test/lib/facets/core/numeric/test_distance.rb +0 -28
  236. data/test/lib/facets/core/numeric/test_succ.rb +0 -40
  237. data/test/lib/facets/core/numeric/test_to_b.rb +0 -27
  238. data/test/lib/facets/core/ostruct/test___update__.rb +0 -45
  239. data/test/lib/facets/core/ostruct/test_instance_delegate.rb +0 -36
  240. data/test/lib/facets/core/ostruct/test_op_fetch.rb +0 -33
  241. data/test/lib/facets/core/proc/test_compose.rb +0 -29
  242. data/test/lib/facets/core/proc/test_op_mul.rb +0 -34
  243. data/test/lib/facets/core/proc/test_to_method.rb +0 -44
  244. data/test/lib/facets/core/range/test_to_r.rb +0 -27
  245. data/test/lib/facets/core/range/test_to_range.rb +0 -27
  246. data/test/lib/facets/core/range/test_umbrella.rb +0 -34
  247. data/test/lib/facets/core/range/test_within.rb +0 -29
  248. data/test/lib/facets/core/regexp/test_arity.rb +0 -33
  249. data/test/lib/facets/core/regexp/test_to_re.rb +0 -27
  250. data/test/lib/facets/core/regexp/test_to_regexp.rb +0 -27
  251. data/test/lib/facets/core/string/self/test_interpolate.rb +0 -27
  252. data/test/lib/facets/core/string/self/test_patterns.rb +0 -28
  253. data/test/lib/facets/core/string/self/test_rand_letter.rb +0 -26
  254. data/test/lib/facets/core/string/test_align_center.rb +0 -34
  255. data/test/lib/facets/core/string/test_at_rand.rb +0 -35
  256. data/test/lib/facets/core/string/test_basename.rb +0 -41
  257. data/test/lib/facets/core/string/test_blank.rb +0 -27
  258. data/test/lib/facets/core/string/test_bracket.rb +0 -49
  259. data/test/lib/facets/core/string/test_bytes.rb +0 -25
  260. data/test/lib/facets/core/string/test_camelcase.rb +0 -39
  261. data/test/lib/facets/core/string/test_camelize.rb +0 -26
  262. data/test/lib/facets/core/string/test_capitalize_all.rb +0 -26
  263. data/test/lib/facets/core/string/test_capitalized.rb +0 -26
  264. data/test/lib/facets/core/string/test_chars.rb +0 -27
  265. data/test/lib/facets/core/string/test_cleave.rb +0 -43
  266. data/test/lib/facets/core/string/test_cmp.rb +0 -30
  267. data/test/lib/facets/core/string/test_demodulize.rb +0 -38
  268. data/test/lib/facets/core/string/test_divide.rb +0 -29
  269. data/test/lib/facets/core/string/test_downcase.rb +0 -26
  270. data/test/lib/facets/core/string/test_dresner.rb +0 -32
  271. data/test/lib/facets/core/string/test_each_char.rb +0 -29
  272. data/test/lib/facets/core/string/test_each_word.rb +0 -29
  273. data/test/lib/facets/core/string/test_first.rb +0 -43
  274. data/test/lib/facets/core/string/test_fold.rb +0 -34
  275. data/test/lib/facets/core/string/test_humanize.rb +0 -26
  276. data/test/lib/facets/core/string/test_indent.rb +0 -40
  277. data/test/lib/facets/core/string/test_index_all.rb +0 -26
  278. data/test/lib/facets/core/string/test_last.rb +0 -46
  279. data/test/lib/facets/core/string/test_line_wrap.rb +0 -27
  280. data/test/lib/facets/core/string/test_lines.rb +0 -26
  281. data/test/lib/facets/core/string/test_lowercase.rb +0 -26
  282. data/test/lib/facets/core/string/test_margin.rb +0 -117
  283. data/test/lib/facets/core/string/test_methodize.rb +0 -27
  284. data/test/lib/facets/core/string/test_modulize.rb +0 -29
  285. data/test/lib/facets/core/string/test_mscan.rb +0 -30
  286. data/test/lib/facets/core/string/test_natcmp.rb +0 -30
  287. data/test/lib/facets/core/string/test_nchar.rb +0 -29
  288. data/test/lib/facets/core/string/test_pathize.rb +0 -29
  289. data/test/lib/facets/core/string/test_pop.rb +0 -47
  290. data/test/lib/facets/core/string/test_pot.rb +0 -39
  291. data/test/lib/facets/core/string/test_push.rb +0 -40
  292. data/test/lib/facets/core/string/test_quote.rb +0 -49
  293. data/test/lib/facets/core/string/test_rand_byte.rb +0 -35
  294. data/test/lib/facets/core/string/test_rand_index.rb +0 -26
  295. data/test/lib/facets/core/string/test_range.rb +0 -27
  296. data/test/lib/facets/core/string/test_range_all.rb +0 -27
  297. data/test/lib/facets/core/string/test_range_of_line.rb +0 -28
  298. data/test/lib/facets/core/string/test_regesc.rb +0 -28
  299. data/test/lib/facets/core/string/test_shatter.rb +0 -29
  300. data/test/lib/facets/core/string/test_shift.rb +0 -40
  301. data/test/lib/facets/core/string/test_shuffle.rb +0 -27
  302. data/test/lib/facets/core/string/test_similarity.rb +0 -26
  303. data/test/lib/facets/core/string/test_singular.rb +0 -86
  304. data/test/lib/facets/core/string/test_soundex.rb +0 -41
  305. data/test/lib/facets/core/string/test_succ.rb +0 -29
  306. data/test/lib/facets/core/string/test_to_a.rb +0 -27
  307. data/test/lib/facets/core/string/test_to_b.rb +0 -41
  308. data/test/lib/facets/core/string/test_to_const.rb +0 -28
  309. data/test/lib/facets/core/string/test_to_date.rb +0 -30
  310. data/test/lib/facets/core/string/test_to_proc.rb +0 -33
  311. data/test/lib/facets/core/string/test_to_re.rb +0 -28
  312. data/test/lib/facets/core/string/test_to_time.rb +0 -30
  313. data/test/lib/facets/core/string/test_unix_crypt.rb +0 -30
  314. data/test/lib/facets/core/string/test_unpack.rb +0 -34
  315. data/test/lib/facets/core/string/test_unshift.rb +0 -39
  316. data/test/lib/facets/core/string/test_upcase.rb +0 -30
  317. data/test/lib/facets/core/string/test_whitespace.rb +0 -27
  318. data/test/lib/facets/core/string/test_word_filter.rb +0 -34
  319. data/test/lib/facets/core/string/test_word_wrap.rb +0 -51
  320. data/test/lib/facets/core/string/test_words.rb +0 -37
  321. data/test/lib/facets/core/symbol/test_camelcase.rb +0 -26
  322. data/test/lib/facets/core/symbol/test_camelize.rb +0 -27
  323. data/test/lib/facets/core/symbol/test_capitalize.rb +0 -26
  324. data/test/lib/facets/core/symbol/test_capitalized.rb +0 -27
  325. data/test/lib/facets/core/symbol/test_downcase.rb +0 -27
  326. data/test/lib/facets/core/symbol/test_not.rb +0 -29
  327. data/test/lib/facets/core/symbol/test_pad.rb +0 -27
  328. data/test/lib/facets/core/symbol/test_succ.rb +0 -28
  329. data/test/lib/facets/core/symbol/test_to_const.rb +0 -28
  330. data/test/lib/facets/core/symbol/test_to_proc.rb +0 -33
  331. data/test/lib/facets/core/symbol/test_to_str.rb +0 -28
  332. data/test/lib/facets/core/symbol/test_underscore.rb +0 -26
  333. data/test/lib/facets/core/symbol/test_upcase.rb +0 -27
  334. data/test/lib/facets/core/time/test_change.rb +0 -33
  335. data/test/lib/facets/core/time/test_elapse.rb +0 -27
  336. data/test/lib/facets/core/time/test_stamp.rb +0 -39
  337. data/test/lib/facets/core/time/test_to_date.rb +0 -31
  338. data/test/lib/facets/core/time/test_to_s.rb +0 -31
  339. data/test/lib/facets/core/time/test_to_time.rb +0 -31
  340. data/test/lib/facets/more/test_ann.rb +0 -112
  341. data/test/lib/facets/more/test_ann_attr.rb +0 -39
  342. data/test/lib/facets/more/test_ansicode.rb +0 -36
  343. data/test/lib/facets/more/test_arguments.rb +0 -83
  344. data/test/lib/facets/more/test_association.rb +0 -51
  345. data/test/lib/facets/more/test_autoarray.rb +0 -32
  346. data/test/lib/facets/more/test_basicobject.rb +0 -67
  347. data/test/lib/facets/more/test_bbcode.rb +0 -34
  348. data/test/lib/facets/more/test_binaryreader.rb +0 -64
  349. data/test/lib/facets/more/test_bitmask.rb +0 -47
  350. data/test/lib/facets/more/test_buildingblock.rb +0 -48
  351. data/test/lib/facets/more/test_bytes.rb +0 -84
  352. data/test/lib/facets/more/test_classmethods.rb +0 -69
  353. data/test/lib/facets/more/test_command.rb +0 -69
  354. data/test/lib/facets/more/test_coroutine.rb +0 -60
  355. data/test/lib/facets/more/test_crypt.rb +0 -46
  356. data/test/lib/facets/more/test_cut.rb +0 -198
  357. data/test/lib/facets/more/test_dependency.rb +0 -82
  358. data/test/lib/facets/more/test_dictionary.rb +0 -107
  359. data/test/lib/facets/more/test_elementor.rb +0 -52
  360. data/test/lib/facets/more/test_enumerablepass.rb +0 -86
  361. data/test/lib/facets/more/test_floatstring.rb +0 -36
  362. data/test/lib/facets/more/test_functor.rb +0 -39
  363. data/test/lib/facets/more/test_htmlbuilder.rb +0 -38
  364. data/test/lib/facets/more/test_htmlfilter.rb +0 -86
  365. data/test/lib/facets/more/test_infinity.rb +0 -50
  366. data/test/lib/facets/more/test_inheritor.rb +0 -155
  367. data/test/lib/facets/more/test_instance_intercept.rb +0 -50
  368. data/test/lib/facets/more/test_interval.rb +0 -119
  369. data/test/lib/facets/more/test_json.rb +0 -232
  370. data/test/lib/facets/more/test_linkedlist.rb +0 -53
  371. data/test/lib/facets/more/test_lisp.rb +0 -47
  372. data/test/lib/facets/more/test_lisp_format.rb +0 -37
  373. data/test/lib/facets/more/test_lrucache.rb +0 -25
  374. data/test/lib/facets/more/test_mathconstants.rb +0 -18
  375. data/test/lib/facets/more/test_methodfilter.rb +0 -45
  376. data/test/lib/facets/more/test_methodprobe.rb +0 -53
  377. data/test/lib/facets/more/test_multipliers.rb +0 -114
  378. data/test/lib/facets/more/test_multiton.rb +0 -199
  379. data/test/lib/facets/more/test_nackclass.rb +0 -45
  380. data/test/lib/facets/more/test_nilcomparable.rb +0 -47
  381. data/test/lib/facets/more/test_opencascade.rb +0 -75
  382. data/test/lib/facets/more/test_openobject.rb +0 -126
  383. data/test/lib/facets/more/test_overload.rb +0 -54
  384. data/test/lib/facets/more/test_paramix.rb +0 -100
  385. data/test/lib/facets/more/test_pqueue.rb +0 -39
  386. data/test/lib/facets/more/test_preinitialize.rb +0 -49
  387. data/test/lib/facets/more/test_promoteself.rb +0 -45
  388. data/test/lib/facets/more/test_recorder.rb +0 -44
  389. data/test/lib/facets/more/test_snapshot.rb +0 -34
  390. data/test/lib/facets/more/test_statichash.rb +0 -31
  391. data/test/lib/facets/more/test_syncarray.rb +0 -28
  392. data/test/lib/facets/more/test_synchash.rb +0 -28
  393. data/test/lib/facets/more/test_tagiterator.rb +0 -93
  394. data/test/lib/facets/more/test_timer.rb +0 -66
  395. data/test/lib/facets/more/test_times.rb +0 -103
  396. data/test/lib/facets/more/test_tuple.rb +0 -64
  397. data/test/lib/facets/more/test_typecast.rb +0 -68
  398. data/test/lib/facets/more/test_uninheritable.rb +0 -42
  399. data/test/lib/facets/more/test_units.rb +0 -111
  400. data/test/lib/facets/more/test_xmlbuilder.rb +0 -54
  401. data/test/lib/facets/more/test_xmlhelper.rb +0 -40
  402. data/test/lib/facets/more/test_xoxo.rb +0 -288
  403. data/test/lib/facets/more/test_yamlstruct.rb +0 -37
  404. data/test/lib/facets/yore/enumerable/test_cross.rb +0 -44
  405. data/test/lib/facets/yore/kernel/test_require_facet.rb +0 -27
  406. data/test/lib/facets/yore/module/test_namespace.rb +0 -33
  407. data/test/lib/facets/yore/test_annattr.rb +0 -39
  408. data/test/lib/facets/yore/test_annotation.rb +0 -318
  409. data/work/README +0 -42
  410. data/work/TODO +0 -73
  411. data/work/bin/minitar +0 -3
  412. data/work/bin/minitar.rb +0 -814
  413. data/work/core/array/at_rand.rb +0 -95
  414. data/work/core/array/each_slice.rb +0 -23
  415. data/work/core/array/pick_values.rb +0 -32
  416. data/work/core/array/rand_indexes.rb +0 -33
  417. data/work/core/binding/class.rb +0 -11
  418. data/work/core/binding/delegate-binding.rb +0 -19
  419. data/work/core/binding/delegate.rb +0 -15
  420. data/work/core/binding/proc.rb +0 -6
  421. data/work/core/class/to_module.rb +0 -3
  422. data/work/core/enumerable/op_fetch.rb +0 -30
  423. data/work/core/fileutils/cptouch.rb +0 -20
  424. data/work/core/fileutils/nl_convert.rb +0 -133
  425. data/work/core/io/expect.rb +0 -127
  426. data/work/core/join_with.rb +0 -13
  427. data/work/core/kernel/call_line.rb +0 -15
  428. data/work/core/kernel/does.rb +0 -7
  429. data/work/core/kernel/message.rb +0 -6
  430. data/work/core/kernel/query.rb +0 -15
  431. data/work/core/kernel/taint.rb +0 -10
  432. data/work/core/logger/clean_logger.rb +0 -10
  433. data/work/core/module/attr-old.rb +0 -308
  434. data/work/core/module/attr.rb +0 -98
  435. data/work/core/module/attr_xxx.rb +0 -22
  436. data/work/core/module/by_regexp.rb +0 -21
  437. data/work/core/module/cast.rb +0 -64
  438. data/work/core/module/class_attribute_accessors.rb +0 -57
  439. data/work/core/module/inherit.rb +0 -99
  440. data/work/core/module/inherit0.rb +0 -59
  441. data/work/core/module/let.rb +0 -51
  442. data/work/core/module/meta_attr.rb +0 -60
  443. data/work/core/module/module_attribute_accessors.rb +0 -57
  444. data/work/core/module/permissions.rb +0 -32
  445. data/work/core/module/preserved.rb +0 -108
  446. data/work/core/module/sattr_accessor.rb +0 -1
  447. data/work/core/module/sattr_reader.rb +0 -1
  448. data/work/core/module/sattr_setter.rb +0 -1
  449. data/work/core/module/sattr_tester.rb +0 -1
  450. data/work/core/module/sattr_writer.rb +0 -1
  451. data/work/core/module/tc_attr.rb +0 -107
  452. data/work/core/module/to_module.rb +0 -37
  453. data/work/core/module/version.rb +0 -23
  454. data/work/core/string/frequency.rb +0 -40
  455. data/work/core/string/op_add.rb +0 -24
  456. data/work/core/string/op_div.rb +0 -15
  457. data/work/core/string/pred.rb +0 -217
  458. data/work/core/string/probability.rb +0 -35
  459. data/work/core/string/succ_distance.rb +0 -112
  460. data/work/core/string/to_arr.rb +0 -57
  461. data/work/core/string/to_ary.rb +0 -12
  462. data/work/core/string/word_wrap.rb +0 -62
  463. data/work/hash_open.rb +0 -23
  464. data/work/misc/calibre/ProjectInfo.annotation +0 -46
  465. data/work/misc/calibre/ProjectInfo.ansicode +0 -33
  466. data/work/misc/calibre/ProjectInfo.association +0 -34
  467. data/work/misc/calibre/ProjectInfo.basicobject +0 -36
  468. data/work/misc/calibre/ProjectInfo.bbcode +0 -34
  469. data/work/misc/calibre/ProjectInfo.binaryreader +0 -35
  470. data/work/misc/calibre/ProjectInfo.bitmask +0 -33
  471. data/work/misc/calibre/ProjectInfo.classinherit +0 -36
  472. data/work/misc/calibre/ProjectInfo.classmethods +0 -36
  473. data/work/misc/calibre/ProjectInfo.cloneable +0 -33
  474. data/work/misc/calibre/ProjectInfo.consoleapp +0 -35
  475. data/work/misc/calibre/ProjectInfo.coroutine +0 -37
  476. data/work/misc/calibre/ProjectInfo.crypt +0 -33
  477. data/work/misc/calibre/ProjectInfo.dictionary +0 -40
  478. data/work/misc/calibre/ProjectInfo.downloader +0 -39
  479. data/work/misc/calibre/ProjectInfo.enumerablepass +0 -35
  480. data/work/misc/calibre/ProjectInfo.expirable +0 -37
  481. data/work/misc/calibre/ProjectInfo.floatstring +0 -35
  482. data/work/misc/calibre/ProjectInfo.functor +0 -40
  483. data/work/misc/calibre/ProjectInfo.heap +0 -33
  484. data/work/misc/calibre/ProjectInfo.inheritor +0 -36
  485. data/work/misc/calibre/ProjectInfo.interval +0 -36
  486. data/work/misc/calibre/ProjectInfo.lisp +0 -38
  487. data/work/misc/calibre/ProjectInfo.lrucache +0 -34
  488. data/work/misc/calibre/ProjectInfo.mathconstants +0 -41
  489. data/work/misc/calibre/ProjectInfo.methodprobe +0 -38
  490. data/work/misc/calibre/ProjectInfo.mock +0 -34
  491. data/work/misc/calibre/ProjectInfo.multiton +0 -36
  492. data/work/misc/calibre/ProjectInfo.nackclass +0 -33
  493. data/work/misc/calibre/ProjectInfo.nilcomparable +0 -35
  494. data/work/misc/calibre/ProjectInfo.nullclass +0 -35
  495. data/work/misc/calibre/ProjectInfo.one +0 -37
  496. data/work/misc/calibre/ProjectInfo.openobject +0 -39
  497. data/work/misc/calibre/ProjectInfo.paramix +0 -38
  498. data/work/misc/calibre/ProjectInfo.pool +0 -33
  499. data/work/misc/calibre/ProjectInfo.progressbar +0 -37
  500. data/work/misc/calibre/ProjectInfo.reference +0 -36
  501. data/work/misc/calibre/ProjectInfo.semaphore +0 -36
  502. data/work/misc/calibre/ProjectInfo.stateparser +0 -39
  503. data/work/misc/calibre/ProjectInfo.statichash +0 -33
  504. data/work/misc/calibre/ProjectInfo.system +0 -34
  505. data/work/misc/calibre/ProjectInfo.tagiterator +0 -36
  506. data/work/misc/calibre/ProjectInfo.timer +0 -35
  507. data/work/misc/calibre/ProjectInfo.tracepoint +0 -37
  508. data/work/misc/calibre/ProjectInfo.tuple +0 -36
  509. data/work/misc/calibre/ProjectInfo.uniheritable +0 -34
  510. data/work/misc/calibre/ProjectInfo.units +0 -34
  511. data/work/misc/calibre/ProjectInfo.yamlstruct +0 -34
  512. data/work/more/annotation-rw.rb +0 -217
  513. data/work/more/aobject.rb +0 -132
  514. data/work/more/autohash.rb +0 -67
  515. data/work/more/cache.rb +0 -189
  516. data/work/more/class_inheritable_attributes.rb +0 -120
  517. data/work/more/commandrunner.rb +0 -101
  518. data/work/more/daemon.rb +0 -70
  519. data/work/more/debugger.rb +0 -167
  520. data/work/more/detach.rb +0 -423
  521. data/work/more/enumtype.rb +0 -115
  522. data/work/more/ioreactor.rb +0 -671
  523. data/work/more/logger_sing.rb +0 -207
  524. data/work/more/must.rb +0 -37
  525. data/work/more/old-tkxml.rb +0 -189
  526. data/work/more/pairhash.rb +0 -55
  527. data/work/more/password.rb +0 -80
  528. data/work/more/print_exception.rb +0 -35
  529. data/work/more/rand.rb +0 -412
  530. data/work/more/range.rb +0 -383
  531. data/work/more/sanitize.rb +0 -48
  532. data/work/more/superstruct.rb +0 -735
  533. data/work/more/tag.rb +0 -31
  534. data/work/more/timer.rb +0 -164
  535. data/work/op_rshift.rb +0 -87
  536. data/work/openobject-temp.rb +0 -45
  537. data/work/pore/autorequire.rb +0 -83
  538. data/work/pore/basefactory.rb +0 -40
  539. data/work/pore/hash/each.rb +0 -76
  540. data/work/pore/merge3.rb +0 -765
  541. data/work/pore/superann.rb +0 -134
  542. data/work/pore/sys.rb +0 -186
  543. data/work/pore/utils.rb +0 -518
  544. data/work/yore/HashAquisition.rb +0 -36
  545. data/work/yore/Rakefile.old +0 -181
  546. data/work/yore/Reapfile +0 -63
  547. data/work/yore/annotation.rb +0 -489
  548. data/work/yore/annotation2.rb +0 -466
  549. data/work/yore/commandutils.rb +0 -379
  550. data/work/yore/openobject.rb +0 -298
  551. data/work/yore/reap.rb +0 -184
  552. data/work/yore/reap.yml +0 -47
  553. data/work/yore/taskable-old.rb +0 -519
  554. data/work/yore/taskable.rb +0 -482
@@ -1,134 +0,0 @@
1
- #require 'roll/metadsl'
2
-
3
- require 'yaml'
4
-
5
- class Library
6
-
7
- #
8
-
9
- class Annotation
10
-
11
- def initialize( name, *args, &func )
12
- @name = name
13
- @args = args
14
- @func = func
15
- end
16
-
17
- end
18
-
19
- #
20
-
21
- module Annotate
22
-
23
- def annotations
24
- @annotations ||= []
25
- end
26
-
27
- def define_annotation( sym, *args, &yld )
28
- if args.empty? and not block_given?
29
- if sym == :default
30
- @annotation_modes = nil
31
- else
32
- @annotation_modes = *sym.to_s.split('_and_')
33
- end
34
- else
35
- annotations << Annotation.new( sym, *args, &yld )
36
- if @annotation_modes
37
- @annotation_modes.each do |mode|
38
- annotations << Annotation.new( mode, *args, &yld )
39
- end
40
- end
41
- end
42
- end
43
-
44
- def attr( *args, &yld )
45
- define_annotation( :attr, *args, &yld )
46
- end
47
-
48
- def type( *args, &yld )
49
- define_annotation( :type, *args, &yld )
50
- end
51
-
52
- def method_missing( sym, *args, &yld )
53
- define_annotation( sym, *args, &yld )
54
- end
55
-
56
- end
57
-
58
-
59
- class Metadata
60
- extend Annotate
61
-
62
- attr :date
63
- attr :title
64
- attr :contact
65
- attr :license
66
- attr :status
67
- attr :arch
68
- attr :author
69
- attr :email
70
- attr :homepage
71
- attr :created
72
- attr :scope
73
- attr :rules # should be in sow package?
74
- attr :description
75
-
76
- type :rubyforge, :Rubyforge
77
- type :revision , :Revision
78
-
79
- refer :authors , :author
80
- refer :architecture , :arch
81
- refer :platform , :arch
82
-
83
- default :license , 'Ruby/GPL'
84
- default :status , 'alpha'
85
- default :arch , 'any'
86
- default :data do Time.now.strftime("%Y-%m-%d") end
87
- default :title do name.capitalize end
88
- default :contact do author end
89
-
90
- needs
91
-
92
- attr :name
93
- attr :version # , :require => true #, :default => lambda { default_version }
94
- attr :license
95
- attr :summary
96
-
97
- end
98
-
99
-
100
- y Metadata.annotations
101
-
102
- #
103
-
104
- class Rubyforge
105
-
106
-
107
- belongs_to :Metadata
108
-
109
- needs
110
-
111
- attr :project
112
- attr :username
113
- attr :groupid
114
-
115
- end
116
-
117
- #
118
-
119
- class Revision
120
-
121
- belongs_to :Metadata
122
-
123
- needs
124
-
125
- attr :type
126
-
127
- normal
128
-
129
- attr :include
130
- attr :exclude
131
-
132
- end
133
-
134
- end
@@ -1,186 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- #--
4
- # Copyright (c) 2003, 2004 Jim Weirich
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining
7
- # a copy of this software and associated documentation files (the
8
- # "Software"), to deal in the Software without restriction, including
9
- # without limitation the rights to use, copy, modify, merge, publish,
10
- # distribute, sublicense, and/or sell copies of the Software, and to
11
- # permit persons to whom the Software is furnished to do so, subject to
12
- # the following conditions:
13
- #
14
- # The above copyright notice and this permission notice shall be
15
- # included in all copies or substantial portions of the Software.
16
- #
17
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
- #++
25
- #
26
- require 'ftools'
27
- require 'rbconfig'
28
-
29
- ######################################################################
30
- # Sys provides a number of file manipulation tools for the convenience
31
- # of writing Rakefiles. All commands in this module will announce
32
- # their activity on standard output if the $verbose flag is set
33
- # ($verbose = true is the default). You can control this by globally
34
- # setting $verbose or by using the +verbose+ and +quiet+ methods.
35
- #
36
- # Sys has been deprecated in favor of the FileUtils module available
37
- # in Ruby 1.8.
38
- #
39
- module Sys
40
- RUBY = Config::CONFIG['ruby_install_name']
41
-
42
- # Install all the files matching +wildcard+ into the +dest_dir+
43
- # directory. The permission mode is set to +mode+.
44
- def install(wildcard, dest_dir, mode)
45
- Dir[wildcard].each do |fn|
46
- File.install(fn, dest_dir, mode, $verbose)
47
- end
48
- end
49
-
50
- # Run the system command +cmd+.
51
- def run(cmd)
52
- log cmd
53
- system(cmd) or fail "Command Failed: [#{cmd}]"
54
- end
55
-
56
- # Run a Ruby interpreter with the given arguments.
57
- def ruby(*args)
58
- run "#{RUBY} #{args.join(' ')}"
59
- end
60
-
61
- # Copy a single file from +file_name+ to +dest_file+.
62
- def copy(file_name, dest_file)
63
- log "Copying file #{file_name} to #{dest_file}"
64
- File.copy(file_name, dest_file)
65
- end
66
-
67
- # Copy all files matching +wildcard+ into the directory +dest_dir+.
68
- def copy_files(wildcard, dest_dir)
69
- for_matching_files(wildcard, dest_dir) { |from, to| copy(from, to) }
70
- end
71
-
72
- # Link +file_name+ to +dest_file+.
73
- def link(file_name, dest_file)
74
- log "Linking file #{file_name} to #{dest_file}"
75
- File.link(file_name, dest_file)
76
- end
77
-
78
- # Link all files matching +wildcard+ into the directory +dest_dir+.
79
- def link_files(wildcard, dest_dir)
80
- for_matching_files(wildcard, dest_dir) { |from, to| link(from, to) }
81
- end
82
-
83
- # Symlink +file_name+ to +dest_file+.
84
- def symlink(file_name, dest_file)
85
- log "Symlinking file #{file_name} to #{dest_file}"
86
- File.symlink(file_name, dest_file)
87
- end
88
-
89
- # Symlink all files matching +wildcard+ into the directory +dest_dir+.
90
- def symlink_files(wildcard, dest_dir)
91
- for_matching_files(wildcard, dest_dir) { |from, to| link(from, to) }
92
- end
93
-
94
- # Remove all files matching +wildcard+. If a matching file is a
95
- # directory, it must be empty to be removed. used +delete_all+ to
96
- # recursively delete directories.
97
- def delete(*wildcards)
98
- wildcards.each do |wildcard|
99
- Dir[wildcard].each do |fn|
100
- if File.directory?(fn)
101
- log "Deleting directory #{fn}"
102
- Dir.delete(fn)
103
- else
104
- log "Deleting file #{fn}"
105
- File.delete(fn)
106
- end
107
- end
108
- end
109
- end
110
-
111
- # Recursively delete all files and directories matching +wildcard+.
112
- def delete_all(*wildcards)
113
- wildcards.each do |wildcard|
114
- Dir[wildcard].each do |fn|
115
- next if ! File.exist?(fn)
116
- if File.directory?(fn)
117
- Dir["#{fn}/*"].each do |subfn|
118
- next if subfn=='.' || subfn=='..'
119
- delete_all(subfn)
120
- end
121
- log "Deleting directory #{fn}"
122
- Dir.delete(fn)
123
- else
124
- log "Deleting file #{fn}"
125
- File.delete(fn)
126
- end
127
- end
128
- end
129
- end
130
-
131
- # Make the directories given in +dirs+.
132
- def makedirs(*dirs)
133
- dirs.each do |fn|
134
- log "Making directory #{fn}"
135
- File.makedirs(fn)
136
- end
137
- end
138
-
139
- # Write a message to standard out if $verbose is enabled.
140
- def log(msg)
141
- print " " if $trace && $verbose
142
- puts msg if $verbose
143
- end
144
-
145
- # Perform a block with $verbose disabled.
146
- def quiet(&block)
147
- with_verbose(false, &block)
148
- end
149
-
150
- # Perform a block with $verbose enabled.
151
- def verbose(&block)
152
- with_verbose(true, &block)
153
- end
154
-
155
- # Perform a block with each file matching a set of wildcards.
156
- def for_files(*wildcards)
157
- wildcards.each do |wildcard|
158
- Dir[wildcard].each do |fn|
159
- yield(fn)
160
- end
161
- end
162
- end
163
-
164
- extend(self)
165
-
166
- private # ----------------------------------------------------------
167
-
168
- def for_matching_files(wildcard, dest_dir)
169
- Dir[wildcard].each do |fn|
170
- dest_file = File.join(dest_dir, fn)
171
- parent = File.dirname(dest_file)
172
- makedirs(parent) if ! File.directory?(parent)
173
- yield(fn, dest_file)
174
- end
175
- end
176
-
177
- def with_verbose(v)
178
- oldverbose = $verbose
179
- $verbose = v
180
- yield
181
- ensure
182
- $verbose = oldverbose
183
- end
184
-
185
- end
186
-
@@ -1,518 +0,0 @@
1
- =begin
2
-
3
- = Utils
4
-
5
- Utils is simply a plethora of functions that one might use for degugging, testing,
6
- finding certain files, etc. It's really a place to put methods related to progrmming task,
7
- that while useful simply don't have a specifc home elsehwere. It is possible that they will
8
- evetnually find said home and go live there.
9
-
10
- Most of this was shamelessly ripped form the CrossCase distribution labeled
11
- 'Install/distribution utility functions'. But this will evolove over time.
12
-
13
- == Authors
14
-
15
- * Michael Granger <ged@FaerieMUD.org>
16
-
17
- == Version
18
-
19
- $Id: utils.rb,v 1.1.1.1 2003/07/25 15:43:29 deveiant Exp $
20
-
21
- == Legal
22
-
23
- Parital Copyright (c) 2001-2003, The FaerieMUD Consortium.
24
-
25
- This is free software. You may use, modify, and/or redistribute this
26
- software under the terms of the Perl Artistic License. (See
27
- http://language.perl.com/misc/Artistic.html)
28
-
29
- =end
30
-
31
- =begin
32
- BEGIN {
33
- begin
34
- require 'readline'
35
- include Readline
36
- rescue LoadError => e
37
- $stderr.puts "Faking readline..."
38
- def readline( prompt )
39
- $stderr.print prompt.chomp
40
- return $stdin.gets.chomp
41
- end
42
- end
43
-
44
- begin
45
- require 'yaml'
46
- $yaml = true
47
- rescue LoadError => e
48
- $stderr.puts "No YAML; try() will use .inspect instead."
49
- $yaml = false
50
- end
51
- }
52
- =end
53
-
54
- module UtilityFunctions
55
-
56
- # The list of regexen that eliminate files from the MANIFEST
57
- ANTIMANIFEST = [
58
- /makedist\.rb/,
59
- /\bCVS\b/,
60
- /~$/,
61
- /^#/,
62
- %r{docs/html},
63
- %r{docs/man},
64
- /^TEMPLATE/,
65
- /\.cvsignore/,
66
- /\.s?o$/
67
- ]
68
-
69
- # Set some ANSI escape code constants (Shamelessly stolen from Perl's
70
- # Term::ANSIColor by Russ Allbery <rra@stanford.edu> and Zenin <zenin@best.com>
71
- AnsiAttributes = {
72
- 'clear' => 0,
73
- 'reset' => 0,
74
- 'bold' => 1,
75
- 'dark' => 2,
76
- 'underline' => 4,
77
- 'underscore' => 4,
78
- 'blink' => 5,
79
- 'reverse' => 7,
80
- 'concealed' => 8,
81
-
82
- 'black' => 30, 'on_black' => 40,
83
- 'red' => 31, 'on_red' => 41,
84
- 'green' => 32, 'on_green' => 42,
85
- 'yellow' => 33, 'on_yellow' => 43,
86
- 'blue' => 34, 'on_blue' => 44,
87
- 'magenta' => 35, 'on_magenta' => 45,
88
- 'cyan' => 36, 'on_cyan' => 46,
89
- 'white' => 37, 'on_white' => 47
90
- }
91
-
92
- ErasePreviousLine = "\033[A\033[K"
93
-
94
-
95
- ###############
96
- module_function
97
- ###############
98
-
99
- # Create a string that contains the ANSI codes specified and return it
100
- def ansiCode( *attributes )
101
- return '' unless /(?:vt10[03]|xterm(?:-color)?|linux)/i =~ ENV['TERM']
102
- attr = attributes.collect {|a| AnsiAttributes[a] ? AnsiAttributes[a] : nil}.compact.join(';')
103
- if attr.empty?
104
- return ''
105
- else
106
- return "\e[%sm" % attr
107
- end
108
- end
109
-
110
- # Test for the presence of the specified <tt>library</tt>, and output a
111
- # message describing the test using <tt>nicename</tt>. If <tt>nicename</tt>
112
- # is <tt>nil</tt>, the value in <tt>library</tt> is used to build a default.
113
- def testForLibrary( library, nicename=nil )
114
- nicename ||= library
115
- message( "Testing for the #{nicename} library..." )
116
- if $:.detect{ |dir|
117
- File.exists?(File.join(dir,"#{library}.rb")) || File.exists?(File.join(dir,"#{library}.so"))
118
- }
119
- message( "found.\n" )
120
- return true
121
- else
122
- message( "not found.\n" )
123
- return false
124
- end
125
- end
126
-
127
- # Test for the presence of the specified <tt>library</tt>, and output a
128
- # message describing the problem using <tt>nicename</tt>. If
129
- # <tt>nicename</tt> is <tt>nil</tt>, the value in <tt>library</tt> is used
130
- # to build a default. If <tt>raaUrl</tt> and/or <tt>downloadUrl</tt> are
131
- # specified, they are also use to build a message describing how to find the
132
- # required library. If <tt>fatal</tt> is <tt>true</tt>, a missing library
133
- # will cause the program to abort.
134
- def testForRequiredLibrary( library, nicename=nil, raaUrl=nil, downloadUrl=nil, fatal=true )
135
- nicename ||= library
136
- unless testForLibrary( library, nicename )
137
- msgs = [ "You are missing the required #{nicename} library.\n" ]
138
- msgs << "RAA: #{raaUrl}\n" if raaUrl
139
- msgs << "Download: #{downloadUrl}\n" if downloadUrl
140
- if fatal
141
- abort msgs.join('')
142
- else
143
- errorMessage msgs.join('')
144
- end
145
- end
146
- return true
147
- end
148
-
149
- ### Output <tt>msg</tt> as a ANSI-colored program/section header (white on
150
- ### blue).
151
- def header( msg )
152
- msg.chomp!
153
- $stderr.puts ansiCode( 'bold', 'white', 'on_blue' ) + msg + ansiCode( 'reset' )
154
- $stderr.flush
155
- end
156
-
157
- ### Output <tt>msg</tt> to STDERR and flush it.
158
- def message( msg )
159
- $stderr.print ansiCode( 'cyan' ) + msg + ansiCode( 'reset' )
160
- $stderr.flush
161
- end
162
-
163
- ### Output the specified <tt>msg</tt> as an ANSI-colored error message
164
- ### (white on red).
165
- def errorMessage( msg )
166
- message ansiCode( 'bold', 'white', 'on_red' ) + msg + ansiCode( 'reset' )
167
- end
168
-
169
- ### Output the specified <tt>msg</tt> as an ANSI-colored debugging message
170
- ### (yellow on blue).
171
- def debugMsg( msg )
172
- return unless $DEBUG
173
- msg.chomp!
174
- $stderr.puts ansiCode( 'bold', 'yellow', 'on_blue' ) + ">>> #{msg}" + ansiCode( 'reset' )
175
- $stderr.flush
176
- end
177
-
178
- ### Erase the previous line (if supported by your terminal) and output the
179
- ### specified <tt>msg</tt> instead.
180
- def replaceMessage( msg )
181
- print ErasePreviousLine
182
- message( msg )
183
- end
184
-
185
- ### Output a divider made up of <tt>length</tt> hyphen characters.
186
- def divider( length=75 )
187
- puts "\r" + ("-" * length )
188
- end
189
- alias :writeLine :divider
190
-
191
- ### Output the specified <tt>msg</tt> colored in ANSI red and exit with a
192
- ### status of 1.
193
- def abort( msg )
194
- print ansiCode( 'bold', 'red' ) + "Aborted: " + msg.chomp + ansiCode( 'reset' ) + "\n\n"
195
- Kernel.exit!( 1 )
196
- end
197
-
198
- ### Output the specified <tt>promptString</tt> as a prompt (in green) and
199
- ### return the user's input with leading and trailing spaces removed.
200
- def prompt( promptString )
201
- promptString.chomp!
202
- return readline( ansiCode('bold', 'green') + "#{promptString}: " + ansiCode('reset') ).strip
203
- end
204
-
205
- ### Prompt the user with the given <tt>promptString</tt> via #prompt,
206
- ### substituting the given <tt>default</tt> if the user doesn't input
207
- ### anything.
208
- def promptWithDefault( promptString, default )
209
- response = prompt( "%s [%s]" % [ promptString, default ] )
210
- if response.empty?
211
- return default
212
- else
213
- return response
214
- end
215
- end
216
-
217
- ### Search for the program specified by the given <tt>progname</tt> in the
218
- ### user's <tt>PATH</tt>, and return the full path to it, or <tt>nil</tt> if
219
- ### no such program is in the path.
220
- def findProgram( progname )
221
- ENV['PATH'].split(File::PATH_SEPARATOR).each {|d|
222
- file = File.join( d, progname )
223
- return file if File.executable?( file )
224
- }
225
- return nil
226
- end
227
-
228
- ### Using the CVS log for the given <tt>file</tt> attempt to guess what the
229
- ### next release version might be. This only works if releases are tagged
230
- ### with tags like 'RELEASE_x_y'.
231
- def extractNextVersionFromTags( file )
232
- message "Attempting to extract next release version from CVS tags for #{file}...\n"
233
- raise RuntimeError, "No such file '#{file}'" unless File.exists?( file )
234
- cvsPath = findProgram( 'cvs' ) or
235
- raise RuntimeError, "Cannot find the 'cvs' program. Aborting."
236
-
237
- output = %x{#{cvsPath} log #{file}}
238
- release = [ 0, 0 ]
239
- output.scan( /RELEASE_(\d+)_(\d+)/ ) {|match|
240
- if $1.to_i > release[0] || $2.to_i > release[1]
241
- release = [ $1.to_i, $2.to_i ]
242
- replaceMessage( "Found %d.%02d...\n" % release )
243
- end
244
- }
245
-
246
- if release[1] >= 99
247
- release[0] += 1
248
- release[1] = 1
249
- else
250
- release[1] += 1
251
- end
252
-
253
- return "%d.%02d" % release
254
- end
255
-
256
- ### Extract the project name (CVS Repository name) for the given directory.
257
- def extractProjectName
258
- File.open( "CVS/Repository", "r").readline.chomp
259
- end
260
-
261
- ### Read the specified <tt>manifestFile</tt>, which is a text file
262
- ### describing which files to package up for a distribution. The manifest
263
- ### should consist of one or more lines, each containing one filename or
264
- ### shell glob pattern.
265
- def readManifest( manifestFile="MANIFEST" )
266
- message "Building manifest..."
267
- raise "Missing #{manifestFile}, please remake it" unless File.exists? manifestFile
268
-
269
- manifest = IO::readlines( manifestFile ).collect{ |line|
270
- line.chomp
271
- }.select{ |line|
272
- line !~ /^(\s*(#.*)?)?$/
273
- }
274
-
275
- filelist = []
276
- for pat in manifest
277
- $stderr.puts "Adding files that match '#{pat}' to the file list" if $VERBOSE
278
- filelist |= Dir.glob( pat ).find_all {|f| FileTest.file?(f)}
279
- end
280
-
281
- message "found #{filelist.length} files.\n"
282
- return filelist
283
- end
284
-
285
- ### Given a <tt>filelist</tt> like that returned by #readManifest, remove
286
- ### the entries therein which match the Regexp objects in the given
287
- ### <tt>antimanifest</tt> and return the resultant Array.
288
- def vetManifest( filelist, antimanifest=ANITMANIFEST )
289
- origLength = filelist.length
290
- message "Vetting manifest..."
291
-
292
- for regex in antimanifest
293
- if $VERBOSE
294
- message "\n\tPattern /#{regex.source}/ removed: " +
295
- filelist.find_all {|file| regex.match(file)}.join(', ')
296
- end
297
- filelist.delete_if {|file| regex.match(file)}
298
- end
299
-
300
- message "removed #{origLength - filelist.length} files from the list.\n"
301
- return filelist
302
- end
303
-
304
- ### Combine a call to #readManifest with one to #vetManifest.
305
- def getVettedManifest( manifestFile="MANIFEST", antimanifest=ANTIMANIFEST )
306
- vetManifest( readManifest(manifestFile), antimanifest )
307
- end
308
-
309
- ### Given a documentation <tt>catalogFile</tt>, which is in the same format
310
- ### as that described by #readManifest, read and expand it, and then return
311
- ### a list of those files which appear to have RDoc documentation in
312
- ### them. If <tt>catalogFile</tt> is nil or does not exist, the MANIFEST
313
- ### file is used instead.
314
- def findRdocableFiles( catalogFile="docs/CATALOG" )
315
- startlist = []
316
- if File.exists? catalogFile
317
- message "Using CATALOG file (%s).\n" % catalogFile
318
- startlist = getVettedManifest( catalogFile )
319
- else
320
- message "Using default MANIFEST\n"
321
- startlist = getVettedManifest()
322
- end
323
-
324
- message "Looking for RDoc comments in:\n" if $VERBOSE
325
- startlist.select {|fn|
326
- message " #{fn}: " if $VERBOSE
327
- found = false
328
- File::open( fn, "r" ) {|fh|
329
- fh.each {|line|
330
- if line =~ /^(\s*#)?\s*=/ || line =~ /:\w+:/ || line =~ %r{/\*}
331
- found = true
332
- break
333
- end
334
- }
335
- }
336
-
337
- message( (found ? "yes" : "no") + "\n" ) if $VERBOSE
338
- found
339
- }
340
- end
341
-
342
- ### Open a file and filter each of its lines through the given block a
343
- ### <tt>line</tt> at a time. The return value of the block is used as the
344
- ### new line, or omitted if the block returns <tt>nil</tt> or
345
- ### <tt>false</tt>.
346
- def editInPlace( file ) # :yields: line
347
- raise "No block specified for editing operation" unless block_given?
348
-
349
- tempName = "#{file}.#{$$}"
350
- File::open( tempName, File::RDWR|File::CREAT, 0600 ) {|tempfile|
351
- File::unlink( tempName )
352
- File::open( file, File::RDONLY ) {|fh|
353
- fh.each {|line|
354
- newline = yield( line ) or next
355
- tempfile.print( newline )
356
- }
357
- }
358
-
359
- tempfile.seek(0)
360
-
361
- File::open( file, File::TRUNC|File::WRONLY, 0644 ) {|newfile|
362
- newfile.print( tempfile.read )
363
- }
364
- }
365
- end
366
-
367
- ### Execute the specified shell <tt>command</tt>, read the results, and
368
- ### return them. Like a %x{} that returns an Array instead of a String.
369
- def shellCommand( *command )
370
- raise "Empty command" if command.empty?
371
-
372
- cmdpipe = IO::popen( command.join(' '), 'r' )
373
- return cmdpipe.readlines
374
- end
375
-
376
- ### Execute a block with $VERBOSE set to +false+, restoring it to its
377
- ### previous value before returning.
378
- def verboseOff
379
- raise LocalJumpError, "No block given" unless block_given?
380
-
381
- thrcrit = Thread.critical
382
- oldverbose = $VERBOSE
383
- begin
384
- Thread.critical = true
385
- $VERBOSE = false
386
- yield
387
- ensure
388
- $VERBOSE = oldverbose
389
- Thread.critical = false
390
- end
391
- end
392
-
393
-
394
- ### Try the specified code block, printing the given
395
- def try( msg, bind=nil ) #:yield:
396
- result = nil
397
- message "Trying #{msg}..."
398
-
399
- begin
400
- rval = nil
401
- if block_given?
402
- rval = yield
403
- else
404
- file, line = caller(1)[0].split(/:/,2)
405
- rval = eval( msg, bind, file, line.to_i )
406
- end
407
-
408
- if $yaml
409
- result = rval.to_yaml
410
- else
411
- result = rval.inspect
412
- end
413
- rescue Exception => err
414
- nicetrace = err.backtrace.delete_if {|frame|
415
- /in `(try|eval)'/ =~ frame
416
- }.join("\n\t")
417
- result = err.message + "\n\t" + nicetrace
418
- ensure
419
- puts result
420
- end
421
- end
422
-
423
-
424
- # Run a block, with $VERBOSE set to v. No other threads will
425
- # run while this block is being executed.
426
- def verbose_block(v = true, &block)
427
- Thread.critical = true
428
- tmp = $VERBOSE
429
- $VERBOSE = v
430
- begin
431
- yield
432
- ensure
433
- $VERBOSE = tmp
434
- Thread.critical = false
435
- end
436
- end
437
-
438
- # Run a block, with $VERBOSE set to false. No other threads will
439
- # run while this block is being executed.
440
- def terse_block(&block)
441
- verbose_block(false, &block)
442
- end
443
-
444
-
445
- # Ensures that the version number of the installed ruby
446
- # is greater than or equal to the version string supplied.
447
- # Credit to Robert Klemme for posting this on ruby-talk.
448
- #
449
- # ensure_version "1.7.0"
450
- # ensure_version "1.8.0"
451
- # ensure_version "1.8.1"
452
- def ensure_version( ver )
453
- if ( RUBY_VERSION.split(/\./).map{|x|x.to_i} <=> ver.split(/\./).map{|x|x.to_i} ) < 0
454
- throw "Version error: should be #{ver} but is #{RUBY_VERSION}"
455
- end
456
- end
457
-
458
-
459
-
460
- # Adapted from Minero Aoki's rubyloader.rb
461
-
462
- require 'rbconfig'
463
-
464
- module RubyLoader
465
-
466
- ###############
467
- module_function
468
- ###############
469
-
470
- def find_feature( feature )
471
- with_ext( feature ) do |fname|
472
- $LOAD_PATH.each do |dir|
473
- path = dir + '/' + fname
474
- if File.file? path then
475
- return path
476
- end
477
- end
478
- end
479
- nil
480
- end
481
-
482
- def provided?( feature )
483
- with_ext( feature ) do |fn|
484
- $".index fn and return true
485
- end
486
-
487
- false
488
- end
489
- alias required? provided?
490
-
491
- def provide( feature )
492
- $".push feature
493
- end
494
-
495
- def with_ext( feature )
496
- if /\.(?:rb|#{Config::CONFIG['DLEXT']})\z/o === feature then
497
- yield feature
498
- else
499
- [ 'rb', Config::CONFIG['DLEXT'] ].each do |ext|
500
- yield feature + '.' + ext
501
- end
502
- end
503
- end
504
-
505
- end
506
-
507
-
508
- end
509
-
510
-
511
- # --- test ---
512
-
513
- if $0 == __FILE__
514
-
515
- p Utils::RubyLoader.find_feature("enumerator")
516
-
517
- end
518
-