facets 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (353) hide show
  1. checksums.yaml +4 -4
  2. data/.index +11 -7
  3. data/CONTRIBUTING.md +112 -0
  4. data/HISTORY.md +38 -0
  5. data/{README.rdoc → README.md} +59 -59
  6. data/demo/core/array/after.md +13 -0
  7. data/demo/core/array/arrange.md +17 -0
  8. data/demo/core/array/before.md +14 -0
  9. data/demo/core/array/collapse.md +15 -0
  10. data/demo/core/array/collisions.md +30 -0
  11. data/demo/core/array/commonality.md +31 -0
  12. data/demo/core/array/conjoin.md +47 -0
  13. data/demo/core/array/contains.md +9 -0
  14. data/demo/core/array/delete_unless.md +13 -0
  15. data/demo/core/array/delete_values.md +10 -0
  16. data/demo/core/array/delete_values_at.md +15 -0
  17. data/demo/core/array/divide.md +14 -0
  18. data/demo/core/array/duplicates.md +14 -0
  19. data/demo/core/array/each_overlap.md +12 -0
  20. data/demo/core/array/each_pair.md +13 -0
  21. data/demo/core/array/each_value.md +12 -0
  22. data/demo/core/array/entropy.md +13 -0
  23. data/demo/core/array/extract_options.md +13 -0
  24. data/demo/core/array/first.md +11 -0
  25. data/demo/core/array/from.md +11 -0
  26. data/demo/core/array/ideal_entropy.md +11 -0
  27. data/demo/core/array/intersection.md +11 -0
  28. data/demo/core/array/last.md +11 -0
  29. data/demo/core/array/median.md +23 -0
  30. data/demo/core/array/merge.md +15 -0
  31. data/demo/core/array/missing.md +10 -0
  32. data/demo/core/array/mode.md +9 -0
  33. data/demo/core/array/nonuniq.md +16 -0
  34. data/demo/core/array/not_empty.md +8 -0
  35. data/demo/core/array/occur.md +18 -0
  36. data/demo/core/array/occurrence.md +13 -0
  37. data/demo/core/array/only.md +9 -0
  38. data/demo/core/array/op_pow.md +10 -0
  39. data/demo/core/array/pad.md +28 -0
  40. data/demo/core/array/peek.md +10 -0
  41. data/demo/core/array/poke.md +15 -0
  42. data/demo/core/array/probability +8 -0
  43. data/demo/core/array/pull.md +10 -0
  44. data/demo/core/array/recurse.md +10 -0
  45. data/demo/core/array/recursively.md +20 -0
  46. data/demo/core/array/reject_values.md +10 -0
  47. data/demo/core/array/splice.md +14 -0
  48. data/demo/core/array/split.md +13 -0
  49. data/demo/core/array/squeeze.md +14 -0
  50. data/demo/core/array/step.md +16 -0
  51. data/demo/core/array/store.md +9 -0
  52. data/demo/core/array/thru.md +12 -0
  53. data/demo/core/array/to_h.md +11 -0
  54. data/demo/core/array/traverse.md +20 -0
  55. data/demo/core/array/uniq_by.md +16 -0
  56. data/demo/core/array/unique_permutation.md +14 -0
  57. data/demo/core/array/zip.md +8 -0
  58. data/demo/core/binding/caller.md +57 -0
  59. data/demo/core/binding/defined.md +10 -0
  60. data/demo/core/binding/opvars.md +16 -0
  61. data/demo/core/binding/self.md +6 -0
  62. data/demo/core/class/descendants.md +13 -0
  63. data/demo/core/class/to_proc.md +11 -0
  64. data/demo/core/comparable/at_least.md +11 -0
  65. data/demo/core/comparable/at_most.md +11 -0
  66. data/demo/core/comparable/bound.md +13 -0
  67. data/demo/core/comparable/cap.md +11 -0
  68. data/demo/core/comparable/clip.md +29 -0
  69. data/demo/core/comparable/cmp.md +18 -0
  70. data/demo/core/comparable/op_get.md +32 -0
  71. data/demo/core/dir/ascend.md +24 -0
  72. data/demo/core/dir/descend.md +16 -0
  73. data/demo/core/dir/multiglob.md +41 -0
  74. data/demo/core/dir/parent.md +6 -0
  75. data/demo/core/dir/recurse.md +41 -0
  76. data/demo/core/exception/detail.md +19 -0
  77. data/demo/core/{facets.rdoc → facets.md} +1 -1
  78. data/demo/core/filetest/root.md +13 -0
  79. data/demo/core/hash/recursively.md +21 -0
  80. data/demo/core/indexable.md +95 -0
  81. data/demo/core/integer/bitmask.md +46 -0
  82. data/demo/core/integer/{factorial.rdoc → factorial.md} +1 -1
  83. data/demo/core/integer/{length.rdoc → length.md} +1 -1
  84. data/demo/core/integer/{multiple.rdoc → multiple.md} +3 -1
  85. data/demo/core/integer/of.md +11 -0
  86. data/demo/core/integer/{ordinal.rdoc → ordinal.md} +3 -1
  87. data/demo/core/integer/{of.rdoc → times_collect.md} +2 -7
  88. data/demo/core/matchdata/match.md +7 -0
  89. data/demo/core/matchdata/matchset.md +7 -0
  90. data/demo/core/matchdata/matchtree.md +10 -0
  91. data/demo/core/module/cattr.md +43 -0
  92. data/demo/core/module/class_extend.md +64 -0
  93. data/demo/core/module/{class_inheritor.rdoc → class_inheritor.md} +2 -2
  94. data/demo/core/module/{copy_inheritor.rdoc → copy_inheritor.md} +4 -4
  95. data/demo/core/module/include_as.md +31 -0
  96. data/demo/core/module/method_space.md +24 -0
  97. data/demo/core/string/acronym.md +9 -0
  98. data/demo/core/string/{align.rdoc → align.md} +10 -10
  99. data/demo/core/string/ascii_only.md +37 -0
  100. data/demo/core/string/{bracket.rdoc → bracket.md} +10 -10
  101. data/demo/core/string/camelcase.md +47 -0
  102. data/demo/core/string/{capitalized.rdoc → capitalized.md} +9 -9
  103. data/demo/core/string/characters.md +11 -0
  104. data/demo/core/string/{cleanlines.rdoc → cleanlines.md} +3 -3
  105. data/demo/core/string/cleave.md +49 -0
  106. data/demo/core/string/compress_lines.md +22 -0
  107. data/demo/core/string/crypt.md +15 -0
  108. data/demo/core/string/divide.md +9 -0
  109. data/demo/core/string/each_word.md +11 -0
  110. data/demo/core/string/edit_distance.md +15 -0
  111. data/demo/core/string/exclude.md +15 -0
  112. data/demo/core/string/expand_tabs.md +69 -0
  113. data/demo/core/string/fold.md +14 -0
  114. data/demo/core/string/indent.md +65 -0
  115. data/demo/core/string/index_all.md +14 -0
  116. data/demo/core/string/interpolate.md +8 -0
  117. data/demo/core/string/lchomp.md +14 -0
  118. data/demo/core/string/line_wrap.md +7 -0
  119. data/demo/core/string/lowercase.md +12 -0
  120. data/demo/core/string/methodize.md +22 -0
  121. data/demo/core/string/modulize.md +22 -0
  122. data/demo/core/string/mscan.md +10 -0
  123. data/demo/core/string/natcmp.md +10 -0
  124. data/demo/core/string/nchar.md +9 -0
  125. data/demo/core/string/{newlines.rdoc → newlines.md} +3 -3
  126. data/demo/core/string/number.md +27 -0
  127. data/demo/core/string/op_div.md +10 -0
  128. data/demo/core/string/op_sub.md +7 -0
  129. data/demo/core/string/pathize.md +22 -0
  130. data/demo/core/string/quote.md +20 -0
  131. data/demo/core/string/random.md +25 -0
  132. data/demo/core/string/range.md +19 -0
  133. data/demo/core/string/remove.md +33 -0
  134. data/demo/core/string/rewrite.md +9 -0
  135. data/demo/core/string/shatter.md +9 -0
  136. data/demo/core/string/similarity.md +12 -0
  137. data/demo/core/string/snakecase.md +14 -0
  138. data/demo/core/string/splice.md +28 -0
  139. data/demo/core/string/squish.md +27 -0
  140. data/demo/core/string/store.md +10 -0
  141. data/demo/core/string/subtract.md +8 -0
  142. data/demo/core/string/titlecase.md +8 -0
  143. data/demo/core/string/to_re.md +22 -0
  144. data/demo/core/string/{margin.rdoc → trim.md} +14 -14
  145. data/demo/core/string/unbracket.md +24 -0
  146. data/demo/core/string/underscore.md +17 -0
  147. data/demo/core/string/unfold.md +9 -0
  148. data/demo/core/string/unindent.md +65 -0
  149. data/demo/core/string/unquote.md +6 -0
  150. data/demo/core/string/uppercase.md +15 -0
  151. data/demo/core/string/variablize.md +7 -0
  152. data/demo/core/string/word_wrap.md +54 -0
  153. data/demo/core/string/words.md +13 -0
  154. data/demo/core/string/xor.md +8 -0
  155. data/lib/core/facets.yml +11 -7
  156. data/lib/core/facets/array.rb +1 -0
  157. data/lib/core/facets/array/average.rb +16 -0
  158. data/lib/core/facets/array/collapse.rb +4 -0
  159. data/lib/core/facets/array/delete_values_at.rb +1 -0
  160. data/lib/core/facets/array/divide.rb +7 -0
  161. data/lib/core/facets/array/duplicates.rb +2 -0
  162. data/lib/core/facets/array/each_pair.rb +1 -4
  163. data/lib/core/facets/array/first.rb +1 -0
  164. data/lib/core/facets/array/from.rb +11 -16
  165. data/lib/core/facets/array/intersection.rb +1 -1
  166. data/lib/core/facets/array/last.rb +1 -0
  167. data/lib/core/facets/array/mode.rb +2 -2
  168. data/lib/core/facets/array/occurrence.rb +4 -3
  169. data/lib/core/facets/array/op_pow.rb +0 -2
  170. data/lib/core/facets/array/probability.rb +1 -1
  171. data/lib/core/facets/array/recursively.rb +2 -2
  172. data/lib/core/facets/array/splice.rb +1 -1
  173. data/lib/core/facets/array/standard_deviation.rb +23 -0
  174. data/lib/core/facets/array/to_h.rb +0 -3
  175. data/lib/core/facets/array/uniq_by.rb +4 -0
  176. data/lib/core/facets/array/variance.rb +20 -0
  177. data/lib/core/facets/binding.rb +0 -1
  178. data/lib/core/facets/enumerable/cluster.rb +6 -4
  179. data/lib/core/facets/enumerable/hashify.rb +27 -31
  180. data/lib/core/facets/enumerable/sum.rb +12 -2
  181. data/lib/core/facets/file/atomic_open.rb +1 -1
  182. data/lib/core/facets/hash/except.rb +13 -1
  183. data/lib/core/facets/indexable.rb +1 -1
  184. data/lib/core/facets/kernel/ergo.rb +3 -3
  185. data/lib/core/facets/kernel/like.rb +1 -1
  186. data/lib/core/facets/matchdata/matchtree.rb +2 -0
  187. data/lib/core/facets/numeric/delimit.rb +20 -0
  188. data/lib/core/facets/range/nudge.rb +29 -0
  189. data/lib/core/facets/string.rb +0 -2
  190. data/lib/core/facets/string/indent.rb +0 -8
  191. data/lib/core/facets/string/margin.rb +0 -4
  192. data/lib/core/facets/string/random.rb +13 -3
  193. data/lib/core/facets/string/similarity.rb +7 -6
  194. data/lib/standard/facets/enumargs.rb +5 -0
  195. data/lib/standard/facets/math/percentile.rb +1 -1
  196. data/lib/standard/facets/net/http.rb +33 -14
  197. data/lib/standard/facets/timer.rb +3 -3
  198. data/test/core/array/test_average.rb +16 -0
  199. data/test/core/array/test_before.rb +21 -0
  200. data/test/core/array/test_collapse.rb +10 -1
  201. data/test/core/array/test_delete_unless.rb +17 -0
  202. data/test/core/array/test_delete_values.rb +31 -0
  203. data/test/core/array/test_divide.rb +10 -0
  204. data/test/core/array/test_each_pair.rb +16 -0
  205. data/test/core/array/test_each_value.rb +16 -0
  206. data/test/core/array/test_from.rb +42 -0
  207. data/test/core/array/test_op_pow.rb +13 -0
  208. data/test/core/array/test_standard_deviation.rb +18 -0
  209. data/test/core/array/test_to_h.rb +14 -0
  210. data/test/core/array/test_uniq_by.rb +7 -0
  211. data/test/core/array/test_variance.rb +17 -0
  212. data/test/core/array/test_zip.rb +13 -0
  213. data/test/core/dir/test_each_child.rb +1 -1
  214. data/test/core/dir/test_multiglob.rb +1 -1
  215. data/test/core/enumerable/test_cluster.rb +36 -0
  216. data/test/core/enumerable/test_hashify.rb +113 -0
  217. data/test/core/hash/test_expect.rb +11 -1
  218. data/test/core/kernel/test_ergo.rb +7 -5
  219. data/test/core/{object/test_replace.rb → kernel/test_instance_replace.rb} +6 -28
  220. data/test/core/numeric/test_delimit.rb +68 -0
  221. data/test/core/numeric/{test_round.rb → test_round_to.rb} +27 -27
  222. data/test/core/range/test_nudge.rb +32 -0
  223. data/test/core/range/{test_to_r.rb → test_to_rng.rb} +3 -3
  224. data/test/core/string/test_acronym.rb +14 -0
  225. data/test/core/string/test_ascii_only.rb +21 -0
  226. data/test/core/string/test_compress_lines.rb +9 -0
  227. data/test/core/string/test_crypt.rb +17 -0
  228. data/test/core/string/test_index_all.rb +4 -0
  229. data/test/core/string/test_random.rb +25 -0
  230. data/test/core/string/test_remove.rb +14 -0
  231. data/test/core/string/test_similarity.rb +9 -1
  232. data/test/core/struct/test_replace.rb +18 -0
  233. data/test/standard/test_enumargs.rb +26 -10
  234. data/test/standard/test_timer.rb +1 -1
  235. metadata +634 -588
  236. data/CONTRIBUTE.md +0 -78
  237. data/demo/core/array/combination.rdoc +0 -19
  238. data/demo/core/array/delete.rdoc +0 -23
  239. data/demo/core/array/index.rdoc +0 -14
  240. data/demo/core/array/merge.rdoc +0 -15
  241. data/demo/core/array/only.rdoc +0 -9
  242. data/demo/core/array/pad.rdoc +0 -28
  243. data/demo/core/array/permutation.rdoc +0 -10
  244. data/demo/core/array/product.rdoc +0 -26
  245. data/demo/core/array/recursively.rdoc +0 -16
  246. data/demo/core/array/rotate.rdoc +0 -30
  247. data/demo/core/array/select.rdoc +0 -8
  248. data/demo/core/array/uniq_by.rdoc +0 -9
  249. data/demo/core/binding/caller.rdoc +0 -57
  250. data/demo/core/binding/defined.rdoc +0 -10
  251. data/demo/core/binding/eval.rdoc +0 -8
  252. data/demo/core/binding/local_variables.rdoc +0 -26
  253. data/demo/core/binding/opvars.rdoc +0 -16
  254. data/demo/core/binding/self.rdoc +0 -6
  255. data/demo/core/class/descendants.rdoc +0 -10
  256. data/demo/core/class/to_proc.rdoc +0 -8
  257. data/demo/core/comparable/cap.rdoc +0 -20
  258. data/demo/core/comparable/clip.rdoc +0 -37
  259. data/demo/core/comparable/cmp.rdoc +0 -18
  260. data/demo/core/comparable/op_get.rdoc +0 -29
  261. data/demo/core/dir/ascend.rdoc +0 -24
  262. data/demo/core/dir/descend.rdoc +0 -14
  263. data/demo/core/dir/multiglob.rdoc +0 -41
  264. data/demo/core/dir/parent.rdoc +0 -6
  265. data/demo/core/dir/recurse.rdoc +0 -41
  266. data/demo/core/exception/detail.rdoc +0 -12
  267. data/demo/core/filetest/root.rdoc +0 -6
  268. data/demo/core/hash/recursively.rdoc +0 -21
  269. data/demo/core/indexable.rdoc +0 -95
  270. data/demo/core/integer/bitmask.rdoc +0 -46
  271. data/demo/core/integer/even.rdoc +0 -12
  272. data/demo/core/integer/odd.rdoc +0 -12
  273. data/demo/core/matchdata/match.rdoc +0 -7
  274. data/demo/core/matchdata/matchset.rdoc +0 -15
  275. data/demo/core/module/cattr.rdoc +0 -43
  276. data/demo/core/module/class_extend.rdoc +0 -64
  277. data/demo/core/module/method_space.rdoc +0 -55
  278. data/demo/core/string/bytes.rdoc +0 -8
  279. data/demo/core/string/camelcase.rdoc +0 -47
  280. data/demo/core/string/characters.rdoc +0 -11
  281. data/demo/core/string/cleave.rdoc +0 -49
  282. data/demo/core/string/divide.rdoc +0 -9
  283. data/demo/core/string/each_char.rdoc +0 -9
  284. data/demo/core/string/each_word.rdoc +0 -9
  285. data/demo/core/string/end_with.rdoc +0 -6
  286. data/demo/core/string/expand_tabs.rdoc +0 -69
  287. data/demo/core/string/fold.rdoc +0 -14
  288. data/demo/core/string/indent.rdoc +0 -65
  289. data/demo/core/string/interpolate.rdoc +0 -7
  290. data/demo/core/string/lchomp.rdoc +0 -14
  291. data/demo/core/string/line_wrap.rdoc +0 -7
  292. data/demo/core/string/lines.rdoc +0 -8
  293. data/demo/core/string/methodize.rdoc +0 -22
  294. data/demo/core/string/modulize.rdoc +0 -22
  295. data/demo/core/string/mscan.rdoc +0 -10
  296. data/demo/core/string/natcmp.rdoc +0 -10
  297. data/demo/core/string/nchar.rdoc +0 -9
  298. data/demo/core/string/op_sub.rdoc +0 -7
  299. data/demo/core/string/pathize.rdoc +0 -22
  300. data/demo/core/string/quote.rdoc +0 -20
  301. data/demo/core/string/range.rdoc +0 -19
  302. data/demo/core/string/rewrite.rdoc +0 -9
  303. data/demo/core/string/shatter.rdoc +0 -9
  304. data/demo/core/string/snakecase.rdoc +0 -10
  305. data/demo/core/string/splice.rdoc +0 -28
  306. data/demo/core/string/start_with.rdoc +0 -7
  307. data/demo/core/string/subtract.rdoc +0 -8
  308. data/demo/core/string/tab.rdoc +0 -16
  309. data/demo/core/string/tabto.rdoc +0 -29
  310. data/demo/core/string/titlecase.rdoc +0 -8
  311. data/demo/core/string/to_re.rdoc +0 -22
  312. data/demo/core/string/unfold.rdoc +0 -9
  313. data/demo/core/string/unindent.rdoc +0 -65
  314. data/demo/core/string/unquote.rdoc +0 -6
  315. data/demo/core/string/variablize.rdoc +0 -7
  316. data/demo/core/string/word_wrap.rdoc +0 -54
  317. data/demo/core/string/words.rdoc +0 -13
  318. data/demo/core/string/xor.rdoc +0 -8
  319. data/lib/core/facets/binding/local_variables.rb +0 -16
  320. data/lib/core/facets/string/tab.rb +0 -2
  321. data/lib/core/facets/string/tabto.rb +0 -2
  322. data/test/core/array/test_after.rb +0 -27
  323. data/test/core/array/test_combination.rb +0 -25
  324. data/test/core/array/test_index.rb +0 -20
  325. data/test/core/array/test_permutation.rb +0 -20
  326. data/test/core/array/test_product.rb +0 -64
  327. data/test/core/array/test_rotate.rb +0 -38
  328. data/test/core/array/test_select.rb +0 -16
  329. data/test/core/binding/test_eval.rb +0 -15
  330. data/test/core/binding/test_local_variables.rb +0 -36
  331. data/test/core/enumerable/test_cluster_by.rb +0 -30
  332. data/test/core/enumerable/test_count.rb +0 -32
  333. data/test/core/enumerable/test_each_with_object.rb +0 -18
  334. data/test/core/enumerable/test_group_by.rb +0 -36
  335. data/test/core/enumerable/test_none.rb +0 -29
  336. data/test/core/enumerable/test_one.rb +0 -34
  337. data/test/core/enumerable/test_take.rb +0 -15
  338. data/test/core/hash/test_select.rb +0 -44
  339. data/test/core/hash/test_url_params.rb +0 -26
  340. data/test/core/integer/test_even.rb +0 -24
  341. data/test/core/integer/test_odd.rb +0 -24
  342. data/test/core/kernel/test_require_relative.rb +0 -12
  343. data/test/core/nilclass/test_to_f.rb +0 -13
  344. data/test/core/proc/test_curry.rb +0 -38
  345. data/test/core/string/test_bytes.rb +0 -13
  346. data/test/core/string/test_each_char.rb +0 -17
  347. data/test/core/string/test_end_with.rb +0 -24
  348. data/test/core/string/test_lines.rb +0 -15
  349. data/test/core/string/test_start_with.rb +0 -24
  350. data/test/core/string/test_tab.rb +0 -16
  351. data/test/core/symbol/test_to_proc.rb +0 -35
  352. data/test/core/to_hash_tc.rb +0 -210
  353. data/test/core/unboundmethod/test_name.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04425cff670267fec297484f50e19edbb8a22fc8
4
- data.tar.gz: 19b9480ec202b072704267dc8760209cb6648338
3
+ metadata.gz: 6968b01e3ed3e46be3265a381de7443ec38bb966
4
+ data.tar.gz: 4668e23ad2f1e44a65cf8ba895f0daccbf65c175
5
5
  SHA512:
6
- metadata.gz: e36beb518158636837793bcab25e5c004cfd904d8e78f865099ff5b904ee562f04078d3d6ff5e10a7ab02b225de49d3ba51365fdc3538d50725855b0a5830baf
7
- data.tar.gz: 13b826e5a84e8c7b91562c2df850eb16972a843dc6f6546f7f0aaf34a548d9db2c3d27935ea39a98573700d65cfe3bbdac183f8df2cdb1b66b68ee4faa9d8e54
6
+ metadata.gz: 6deb1971ac97f93bb75d4c144fabb91d6e9f6424867e4be70a2b99623d35080a49cf774c18e36236877c3f35d3549ca5563eb6a6c18912beccd3e67b1a414ec0
7
+ data.tar.gz: 4fefcae7db154ac8b054aa4d5fc293653ea2376a1a36a59968bbad9a70763a06ca8bde410c1c3bb1c89d10e455420feee977264bfd8d1f4e49494bf90a16b9cf
data/.index CHANGED
@@ -12,24 +12,28 @@ organizations:
12
12
  requirements:
13
13
  - groups:
14
14
  - test
15
- version: '>= 0'
15
+ version: ">= 0"
16
16
  name: lemon
17
17
  - groups:
18
18
  - test
19
- version: '>= 0'
19
+ version: ">= 0"
20
20
  name: qed
21
21
  - groups:
22
22
  - test
23
- version: '>= 0'
23
+ version: ">= 0"
24
24
  name: rubytest-cli
25
25
  - groups:
26
26
  - test
27
- version: '>= 0'
27
+ version: ">= 0"
28
28
  name: rake
29
29
  - groups:
30
30
  - test
31
- version: '>= 0'
31
+ version: ">= 0"
32
32
  name: simplecov
33
+ - groups:
34
+ - guard
35
+ version: ">= 0"
36
+ name: guard
33
37
  conflicts: []
34
38
  alternatives: []
35
39
  resources:
@@ -63,7 +67,7 @@ paths:
63
67
  - lib/standard
64
68
  name: facets
65
69
  title: Ruby Facets
66
- version: 3.0.0
70
+ version: 3.1.0
67
71
  summary: The orginal well curated collection of extension methods for Ruby.
68
72
  slogan: ALL YOUR BASE ARE BELONG TO RUBY!
69
73
  description: Facets is the premier collection of extension methods for the Ruby programming
@@ -73,4 +77,4 @@ description: Facets is the premier collection of extension methods for the Ruby
73
77
  applications.
74
78
  scm_uri: https://github.com/rubyworks/facets/tree/master
75
79
  created: '2004-12-16'
76
- date: '2014-12-20'
80
+ date: '2016-05-09'
@@ -0,0 +1,112 @@
1
+ # CONTRIBUTING TO FACETS
2
+
3
+ ## General Rules
4
+
5
+ * Facets methods must have no external dependencies. (The only possible
6
+ exception to this is if the functor gets spun-off as a separate gem along
7
+ with related methods, but for now that hasn't happened.)
8
+
9
+ * Each method must be in it's own file of the same name. If the method ends
10
+ with `=` or `?` just leave it off the file name.
11
+
12
+ * On rare occasion two or more methods can be very tightly related. In these
13
+ cases the methods can all go in a single file under the name of the method
14
+ considered most significant. Usually files for the other methods should
15
+ still be created that simply require the main file.
16
+
17
+ * Methods must be tested both via a Lemon unit test and as a QED demo.
18
+ The Lemon unit tests are for testing a method in detail whereas the QED
19
+ demos are for demonstrating usage.
20
+
21
+ * Facets is divided into two parts, *core* and *standard* libraries.
22
+ Almost all of the core library can be loaded at once using `require 'facets'`
23
+ The standard library (also called the *more* library) must be required
24
+ per-script.
25
+
26
+ * Some core methods are included on a *trial* basis, and these are not
27
+ necessary loaded automatically with `require 'facets'`. These should be
28
+ documented as such in the method comments.
29
+
30
+ * Standard libraries that are not extensions of existing standard libraries
31
+ do not have to be divvied up into individual method files. But note that
32
+ full classes and/or modules are less likely to make it into Facets, as
33
+ these sorts of additions to Facets are only for very basic sorts of things.
34
+ Otherwise they'd deserve their own gem.
35
+
36
+ * When submitting new methods for consideration, it is best if each method
37
+ (or *tightly related* set of methods) is in it's own pull request. If you
38
+ have only one method to submit then a simple commit will do the trick. If
39
+ you have more than one it best to use separate branches. Let me emphasizes
40
+ this point because it makes it *much more likely* that your pull request
41
+ will be merged. If you submit a bunch of methods in a single pull request,
42
+ it is very likely that it will not be merged even if methods you submitted
43
+ are accepted!!!
44
+
45
+ * Don't be discouraged when you get feedback about a method that isn't
46
+ all sunshine and roses. Facets has been around long enough now that
47
+ it needs to maintain a certain degree of quality control, and that means
48
+ serious discernment about what goes into the library. That includes
49
+ having in depth discussions the merits of methods, even about the best
50
+ name for a method --even if the functionality has been accepted the name
51
+ may not.
52
+
53
+
54
+ ## Versioning
55
+
56
+ Facets tries to follow a semantic versioning system, but with a slightly
57
+ differt scheme than most projects. For Facets the version number represents:
58
+
59
+ gestault.major.minor
60
+
61
+ Techinically there can be a fouth `build` number, but we never use it for
62
+ releases.
63
+
64
+
65
+ ## Commit Tags
66
+
67
+ When making a commit, it is helpful to add a *commit tag* to the end of the
68
+ first line of commit message. Commit tags are single words wrapped in colons.
69
+
70
+ * If the commit is only a documentation change, then and `:doc:`.
71
+ * If it is only a change to tests then add `:test:`.
72
+ * If the change only effects project build or config files then add `:admin:`.
73
+ * If the change fixes a bug that was reported via the issue system be sure
74
+ to reference the issue number in the message using `#` and add a `:bug:` tag.
75
+ * For actual code changes, if the change is *very minor* and not something
76
+ anyone would notice, you can use `:tweak:`, if you want.
77
+ * If the change would require a minor version change than use `:minor:`.
78
+ * But if a change is a significant change to the API, and thus will require
79
+ a major version change, then end the message with `:major:`.
80
+
81
+ These are all rules of thumb, and no one expects them to be applied perfectly.
82
+
83
+
84
+ ## Documentation
85
+
86
+ Facets started when the only choice for API documentation was RDoc. So originally
87
+ that's how methods were documented. Since then both YARD and Tomdoc have come
88
+ along. And some of these documentation styles have crept into a number of
89
+ methods. So right now, things are a bit messy. But going forward it looks like we
90
+ are going to settle on Tomdoc as the official documentation style (but using
91
+ the tomparse gem's extensions). Using Tomdoc will give us reasonable
92
+ interoperability with both RDoc and YARD, both of which now have support for
93
+ Tomdoc (albeit support is not 100% the same, but hopefully it's close enough).
94
+
95
+ Officially we publish documentation via rubydoc.info, which is the YARD server,
96
+ and via the Facets website in Shomen JSON format.
97
+
98
+ When writing documentation for a method it is best to give a simple summary
99
+ explanation, followed by some basic examples. Follow that up with deeper
100
+ explanation if needed, including *when* and *why* the method could be useful.
101
+
102
+
103
+ ## Testing
104
+
105
+ * Methods in `lib/core/facets/{class}/{method}.rb` will be tested in `test/foo/{class}/test_{method}.rb`.
106
+ * If `lib/core/facets/{class}/{method}.rb` consists only of a require statement, no test file is expected.
107
+ * If `lib/core/facets/{class}/{method}.rb` consists only of a require and an alias, then `test/foo/{class}/{method}.rb`, only needs to test the existence of the alias and not the underlying code. But it's okay if the alias is tested further.
108
+ * Methods in `lib/core/facets/{class}/{method}.rb` will be demoed in `demo/core/{class}/{method}.md`.
109
+ * Require only files will have a full demo of it's method or methods. Code in a single file may be split into multiple demos, named after the method. This is to promote discoverability in the documentation.
110
+ * Demos of aliases will have a simple demo, and a reference to the file it aliases
111
+
112
+
data/HISTORY.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Facets Release History
2
2
 
3
+ ## 3.1.0 / 2016-05-10
4
+
5
+ More or less a minor release, but there are some backward incompatabilites
6
+ such as `Hash#except!` which no longer returns the rejected entries (use
7
+ `Hash#remove!` for old behavior).
8
+
9
+ Special thanks to Scott Parrish for all his help getting Facets in tip-top
10
+ shape.
11
+
12
+ Changes:
13
+
14
+ * New Features
15
+
16
+ * Add `Hash#remove!` for old `except!` behavior.
17
+ * Add `Array#standard_deviation`.
18
+ * Add `Array#variance`.
19
+ * Add `Array#average`.
20
+ * Add `Numeric#delimit`.
21
+
22
+ * Improved Features
23
+
24
+ * Change `Hash#except!` to not return rejected entries.
25
+ * Improve definition of Character Set in `String.random`.
26
+ * Add one to denominator of `String#similarity` score.
27
+ * Enhanced download methods.
28
+ * Improvements on compatability with ActiveSupport.
29
+ * Enumerable#from and #thru return empty set when index is out of bounds.
30
+
31
+ * Bug Fixes
32
+
33
+ * Fix `Enumerable#key_by`.
34
+ * Fix `Enumerable#sum` to take initial value.
35
+
36
+
3
37
  ## 3.0.0 / 2014-11-11
4
38
 
5
39
  This major release has been a long time in coming --too long in fact. As with
@@ -21,8 +55,10 @@ Changes:
21
55
  * Add Dir.lookup method
22
56
  * Add Enumerator::Lazy#squeeze
23
57
  * Add Hash#fetch_nested
58
+ * Add Hash#deep_rekey and Hash#deep_rekey!
24
59
  * Add Kernel#instance_extract
25
60
  * Add Math#EC for Euler's constant
61
+ * Add Module#alias_class_method
26
62
  * Add Pathname#chdir
27
63
  * Add Pathname#readline
28
64
  * Add Proc.wrap (may become `Kernel#Proc()`)
@@ -34,6 +70,7 @@ Changes:
34
70
  * Improved Features
35
71
 
36
72
  * Enumerable#sum argument is initial value.
73
+ * Generalize Enumerable#sum to duck-type on `#+`.
37
74
  * Hash#collate can take multiple arguments.
38
75
  * Hash#collate no longer flattens automatically.
39
76
  * Time#past? and #future? use Time.current.
@@ -43,6 +80,7 @@ Changes:
43
80
 
44
81
  * Rename Object#replace to Object#instance_replace.
45
82
  * Rename Range#to_r to Range#to_rng, since #to_r is now for Rational.
83
+ * Rename Kernel#eigen to #meta.
46
84
 
47
85
  * Bug Fixes
48
86
 
@@ -1,9 +1,14 @@
1
- = Ruby Facets
1
+ # Ruby Facets
2
2
 
3
- "ALL YOUR BASE ARE BELONG TO RUBY"
3
+ [![Gem Version](https://badge.fury.io/rb/facets.png)](http://badge.fury.io/rb/facets)
4
+ [![Build Status](https://secure.travis-ci.org/rubyworks/facets.png)](http://travis-ci.org/rubyworks/facets)    
5
+ [![Flattr Me](http://api.flattr.com/button/flattr-badge-large.png)](http://flattr.com/thing/324911/Rubyworks-Ruby-Development-Fund)
4
6
 
5
7
 
6
- == Introduction
8
+ *"ALL YOUR BASE ARE BELONG TO RUBY"*
9
+
10
+
11
+ ## Introduction
7
12
 
8
13
  Ruby Facets is the premiere collection of general purpose method
9
14
  extensions and standard additions for the Ruby programming language.
@@ -21,7 +26,7 @@ libraries constitute an reliable source of reusable components, suitable
21
26
  to a wide variety of usecases.
22
27
 
23
28
 
24
- == Resources
29
+ ## Resources
25
30
 
26
31
  * Homepage: http://rubyworks.github.com/facets
27
32
  * Report Bugs: http://github.com/rubyworks/facets/issues
@@ -30,7 +35,7 @@ to a wide variety of usecases.
30
35
  * Source Code: http://github.com/rubyworks/facets
31
36
 
32
37
 
33
- == Documentation
38
+ ## Documentation
34
39
 
35
40
  Facets has special documentation needs due to its extensive breadth.
36
41
  The documentation generated when installing via RubyGems, or the YARD
@@ -40,13 +45,12 @@ it is important to remain aware of the source location of particular
40
45
  methods.
41
46
 
42
47
  For better organized online documentation, generated to separate core
43
- extensions from standard libraries, see the {Learn Facets}[http://rubyworks.github.com/facets/learn.html] page
44
- on the website for links to available documentation.
48
+ extensions from standard libraries, see the [Learn Facets](http://rubyworks.github.com/facets/learn.html) page on the website for links to available documentation.
45
49
 
46
50
 
47
- == Installation
51
+ ## Installation
48
52
 
49
- === Bundler
53
+ ### Bundler
50
54
 
51
55
  If you are using Bundler with your project, add the facets gem to the project's
52
56
  Gemfile. Unless you want all of facets loaded be sure to add the `:require => false`
@@ -54,25 +58,25 @@ option.
54
58
 
55
59
  gem "facets", require: false
56
60
 
57
- === RubyGems
61
+ ### RubyGems
58
62
 
59
63
  The easiest way to install is via RubyGems.
60
64
 
61
65
  $ gem install facets
62
66
 
63
- === Setup.rb
67
+ ### Setup.rb
64
68
 
65
- Facets can be installed the old-fashioned way using Ruby Setup (http://rubyworks.github.com/setup).
69
+ Facets can be installed the old-fashioned way using [Setup.rb](http://rubyworks.github.com/setup).
66
70
  Download and unpack the .tar.gz package and run setup.rb, like so:
67
71
 
68
72
  $ tar -xvzf facets-2.x.x.tar.gz
69
73
  $ cd facets-2.x.x
70
74
  $ sudo setup.rb
71
75
 
72
- Facets 2.8+ requires Ruby 1.8.7 or higher.
76
+ Facets 2.8+ requires Ruby 1.8.7 or higher. Facets 3.0+ requires Ruby 2.0.0 or higher.
73
77
 
74
78
 
75
- == Mission
79
+ ## Mission
76
80
 
77
81
  Facets holds to the notion that the more we can *reasonably* integrate into
78
82
  a common foundation, directed toward general needs, the better that foundation
@@ -84,9 +88,9 @@ will be able to serve the community. There are a number of advantages here:
84
88
  * One-stop Shop and Installation
85
89
 
86
90
 
87
- == Usage
91
+ ## Usage
88
92
 
89
- === CORE Library
93
+ ### CORE Library
90
94
 
91
95
  At the heart of Ruby Facets is the CORE extensions library. CORE provides
92
96
  a sizable collection of generally useful methods, along with a few supporting
@@ -95,7 +99,7 @@ classes, that extend the functionality of Ruby's core classes and modules.
95
99
  With the exception of a few *uncommon* extensions, CORE contains anything that
96
100
  will load automatically when issuing:
97
101
 
98
- require 'facets'
102
+ require 'facets'
99
103
 
100
104
  This loads all the CORE functionality at once. If you plan to use more then a
101
105
  handful of Facets core methods it is recommended that you require the library in
@@ -103,11 +107,11 @@ this way. However, you can also "cherry pick" the CORE library as you prefer.
103
107
  And for uncommon extensions this must be done. The general require statement for
104
108
  a core extension library is:
105
109
 
106
- require 'facets/<class|module>/<method>'
110
+ require 'facets/<class|module>/<method>'
107
111
 
108
112
  For example:
109
113
 
110
- require 'facets/time/stamp'
114
+ require 'facets/time/stamp'
111
115
 
112
116
  Most "atoms" contain only one method, but exceptions occur when methods
113
117
  are closely tied together.
@@ -115,7 +119,7 @@ are closely tied together.
115
119
  You can load per-class or per-module groups of core methods by requiring the
116
120
  class or module by name. For example"
117
121
 
118
- require 'facets/time'
122
+ require 'facets/time'
119
123
 
120
124
  Will require all the core Time method extensions.
121
125
 
@@ -124,7 +128,7 @@ of MORE libraries. A good example is 'random.rb'. There were separated because
124
128
  they had more specialized use cases, where as CORE extensions are intended as
125
129
  general purpose.
126
130
 
127
- ==== Method File Names
131
+ #### Method File Names
128
132
 
129
133
  Operator method redirect files are stored using English names. For instance
130
134
  `Proc#*` is `proc/op_mul`.
@@ -160,36 +164,34 @@ Facets simply takes the '*' and translates it into a string acceptable to all
160
164
  file systems. Also, if a method ends in '=', '?' or '!' it is simply removed.
161
165
 
162
166
 
163
- === MORE Library (aka Standard Library)
167
+ ### MORE Library (aka Standard Library)
164
168
 
165
169
  On top of the extensive CORE library, Facets provides extensions for Ruby's
166
- standard library, as well as very small collection of additional modules and
170
+ standard library, as well as a small collection of additional modules and
167
171
  classes to supplement it.
168
172
 
169
173
  Use this library like you would any other 3rd party library.
170
174
  The only difference between Facet's Standard library and other libraries
171
- is the lack of any enclosing @Facets::@ namespace. This is because
172
- the libraries provided by Facets are fairly low-level and very general
173
- purpose.
175
+ is the lack of any enclosing `Facets::` namespace.
174
176
 
175
177
  When using Facets extended versions of Ruby's standard libraries,
176
- the libraries have to loaded manually, of course. However you
177
- do not need to load Ruby's library first, as the Facets' library
178
- will do that automatically.
178
+ the libraries have to loaded individually. However you do not need
179
+ to load Ruby's library first, as the Facets' library will do that
180
+ automatically.
179
181
 
180
182
  For example, normally one load Ruby's OpenStruct class via:
181
183
 
182
- require 'ostruct'
184
+ require 'ostruct'
183
185
 
184
186
  To load 'ostruct.rb' plus Facets extensions for it simply use:
185
187
 
186
- require 'facets/ostruct'
188
+ require 'facets/ostruct'
187
189
 
188
190
  For details pertaining to the functionality of each feature,
189
191
  please see the API documentation.
190
192
 
191
193
 
192
- == Contribute
194
+ ## Contribute
193
195
 
194
196
  This project thrives on contribution!
195
197
 
@@ -200,48 +202,46 @@ of any thing already included or simply have a patch, they are more than
200
202
  welcome. We want Ruby Facets to be of the highest quality.
201
203
 
202
204
 
203
- == Development
204
-
205
- Facets uses the {Lemon}[http://rubyworks.github.com/lemon] testing framework
206
- to handle unit testing. And uses QED specifications to provide a higher level
207
- of testing along wth documentation. It is most important to provide Lemon
208
- tests when contributing, but feel free to provide QED specs if you are feeling
209
- particularly verbose!
205
+ ## Development
210
206
 
211
- Facets uses {Detroit}[http://detroit.github.com] and {Fire}[http://rubyworks.github.com/fire]
212
- build tools. Detroit is a life-cycle tool and Fire is something of a cross between Rake and
213
- Watchr. The build scripts (the Assembly and the `Rulefile` respectively), sometimes used other
214
- tools such as `mast` and `vclog`.
207
+ Facets uses the [Lemon](http://rubyworks.github.com/lemon) testing framework
208
+ to handle unit testing, while [QED](http://rubyworks.github.com/qed) specifications
209
+ provide tested documentation.
215
210
 
211
+ Facets uses [Detroit](http://detroit.github.com) and [Rulebow](http://rubyworks.github.com/rulebow)
212
+ build tools. Detroit is a life-cycle tool and Rulebow is continuous integrations tool. The build
213
+ scripts (`Assembly` and `Rulebook` respectively), sometimes use other tools such as
214
+ [Mast](http://rubyworks.github.com/mast) and [Indexer](http://rubyworks.github.com/indexer).
216
215
 
217
- == Authors
218
216
 
219
- This collection was put together by, and largely written by Trans. He can be
220
- reached via email at transfire at gmail.com.
217
+ ## Authors
221
218
 
222
- Some parts of this collection were written and/or inspired by other persons.
223
- Fortunately nearly all were copyrighted under the same open license, the Ruby
224
- License, or the more liberal BSD and MIT licenses. In the one or two exceptions
225
- I have included the copyright notice with the source code. Any code file not
226
- specifically labeled othewise shall fall under the Ruby License.
219
+ Much of this collection was written and/or inspired by a variety of great Ruby
220
+ developers. Fortunately nearly all utilized works were copyrighted under the same
221
+ open licenses, the Ruby License or the more liberal BSD and MIT licenses. In the
222
+ one or two exceptions the copyright notice has been included with the source code.
223
+ Any code file not specifically labeled othewise shall fall under the current Ruby
224
+ License (which is BSD 2-clause).
227
225
 
228
- In all cases, I have made every effort to give credit where credit is due.
226
+ In all cases, every effort has been made to give credit where credit is due.
229
227
  You will find these acknowledgments embedded in the source code. You can see
230
228
  them in "CREDIT:" and/or "@author" lines.
231
-
232
- Also see the {Contibutors page}[https://github.com/rubyworks/facets/wiki/Contributors]
229
+ Also see the [Contibutors page](https://github.com/rubyworks/facets/wiki/Contributors)
233
230
  on the Wiki for a list of all contributing Rubyists. If anyone is missing from
234
- the list, please let me know and I will correct right away. Thanks.
231
+ the list, please let us know so we can correct right away. Thanks.
232
+
233
+ This collection was put together by, and much of it written by [trans](https://github.com/trans).
234
+ If need be, he can be reached via email at transfire at gmail.com.
235
235
 
236
236
 
237
- == License
237
+ ## License
238
238
 
239
239
  The collection PER COLLECTION is licensed as follows:
240
240
 
241
- Ruby Facets
242
- Copyright (c) 2004,2010 Rubyworks
241
+ Ruby Facets
242
+ Copyright (c) 2004,2010 Rubyworks
243
243
 
244
- Distributed under the terms of the Ruby license.
244
+ Distributed under the terms of the Ruby license.
245
245
 
246
246
  The Ruby license is a dual license that also provides for use of the GPL.
247
247
  Complete texts of both licenses accompany this document (see LICENSE).