facets 2.4.2 → 2.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (293) hide show
  1. data/AUTHORS +1 -1
  2. data/CHANGES +25 -5
  3. data/MANIFEST +67 -34
  4. data/METADATA +2 -2
  5. data/NEWS +54 -46
  6. data/doc/news/NEWS-2.4.0 +52 -0
  7. data/doc/rdoc/core/classes/Array.html +198 -198
  8. data/doc/rdoc/core/classes/Binding.html +86 -192
  9. data/doc/rdoc/core/classes/Class.html +136 -136
  10. data/doc/rdoc/core/classes/Comparable.html +45 -45
  11. data/doc/rdoc/core/classes/Dir.html +64 -64
  12. data/doc/rdoc/core/classes/Enumerable.html +287 -281
  13. data/doc/rdoc/core/classes/Exception.html +16 -16
  14. data/doc/rdoc/core/classes/FalseClass.html +8 -8
  15. data/doc/rdoc/core/classes/File.html +100 -100
  16. data/doc/rdoc/core/classes/FileTest.html +8 -8
  17. data/doc/rdoc/core/classes/Float.html +32 -32
  18. data/doc/rdoc/core/classes/Friend.html +8 -8
  19. data/doc/rdoc/core/classes/Functor.html +12 -12
  20. data/doc/rdoc/core/classes/Hash.html +439 -847
  21. data/doc/rdoc/{more → core}/classes/Indexable.html +115 -115
  22. data/doc/rdoc/core/classes/InstanceVariables.html +88 -88
  23. data/doc/rdoc/core/classes/Integer.html +142 -142
  24. data/doc/rdoc/core/classes/Kernel.html +602 -600
  25. data/doc/rdoc/core/classes/Lazy/Promise.html +1 -1
  26. data/doc/rdoc/core/classes/MatchData.html +30 -30
  27. data/doc/rdoc/core/classes/Module.html +379 -327
  28. data/doc/rdoc/core/classes/NilClass.html +32 -32
  29. data/doc/rdoc/core/classes/Numeric.html +46 -46
  30. data/doc/rdoc/core/classes/Object.html +4 -4
  31. data/doc/rdoc/core/classes/Proc.html +46 -134
  32. data/doc/rdoc/core/classes/Range.html +60 -60
  33. data/doc/rdoc/core/classes/Regexp.html +28 -28
  34. data/doc/rdoc/{more → core}/classes/Stackable.html +38 -38
  35. data/doc/rdoc/core/classes/String.html +844 -504
  36. data/doc/rdoc/core/classes/Symbol.html +62 -62
  37. data/doc/rdoc/core/classes/Time.html +112 -112
  38. data/doc/rdoc/core/classes/TrueClass.html +8 -8
  39. data/doc/rdoc/core/classes/UnboundMethod.html +22 -22
  40. data/doc/rdoc/core/created.rid +1 -1
  41. data/doc/rdoc/core/files/lib/core/facets/array_rb.html +4 -1
  42. data/doc/rdoc/core/files/lib/core/facets/binding_rb.html +1 -1
  43. data/doc/rdoc/core/files/lib/core/facets/boolean_rb.html +2 -2
  44. data/doc/rdoc/core/files/lib/core/facets/class/methodize_rb.html +96 -0
  45. data/doc/rdoc/core/files/lib/core/facets/class/pathize_rb.html +96 -0
  46. data/doc/rdoc/core/files/lib/core/facets/class_rb.html +5 -1
  47. data/doc/rdoc/core/files/lib/core/facets/dir_rb.html +1 -1
  48. data/doc/rdoc/core/files/lib/core/facets/{class/to_methodname_rb.html → enumerable/commonality_rb.html} +4 -4
  49. data/doc/rdoc/core/files/lib/core/facets/enumerable/entropy_rb.html +96 -0
  50. data/doc/rdoc/core/files/lib/core/facets/{class/to_pathname_rb.html → enumerable/frequency_rb.html} +4 -4
  51. data/doc/rdoc/core/files/lib/core/facets/enumerable/probability_rb.html +1 -1
  52. data/doc/rdoc/core/files/lib/core/facets/enumerable_rb.html +6 -2
  53. data/doc/rdoc/core/files/lib/core/facets/file_rb.html +2 -1
  54. data/doc/rdoc/core/files/lib/core/facets/hash_rb.html +7 -1
  55. data/doc/rdoc/{more/files/lib/more → core/files/lib/core}/facets/indexable_rb.html +2 -2
  56. data/doc/rdoc/core/files/lib/core/facets/kernel/require_all_rb.html +92 -0
  57. data/doc/rdoc/core/files/lib/core/facets/kernel/require_local_rb.html +92 -0
  58. data/doc/rdoc/core/files/lib/core/facets/kernel_rb.html +15 -2
  59. data/doc/rdoc/core/files/lib/core/facets/module/integrate_rb.html +96 -0
  60. data/doc/rdoc/core/files/lib/core/facets/module/methodize_rb.html +96 -0
  61. data/doc/rdoc/core/files/lib/core/facets/module/module_load_rb.html +1 -1
  62. data/doc/rdoc/core/files/lib/core/facets/module/pathize_rb.html +5 -1
  63. data/doc/rdoc/core/files/lib/core/facets/module/redefine_method_rb.html +92 -0
  64. data/doc/rdoc/core/files/lib/core/facets/module/redirect_method_rb.html +92 -0
  65. data/doc/rdoc/core/files/lib/core/facets/module/rename_method_rb.html +92 -0
  66. data/doc/rdoc/core/files/lib/core/facets/module/revise_rb.html +8 -1
  67. data/doc/rdoc/core/files/lib/core/facets/module/wrap_method_rb.html +92 -0
  68. data/doc/rdoc/core/files/lib/core/facets/module_rb.html +8 -5
  69. data/doc/rdoc/core/files/lib/core/facets/numeric_rb.html +2 -1
  70. data/doc/rdoc/core/files/lib/core/facets/proc_rb.html +3 -5
  71. data/doc/rdoc/{more/files/lib/more → core/files/lib/core}/facets/stackable_rb.html +3 -4
  72. data/doc/rdoc/core/files/lib/core/facets/string/each_word_rb.html +96 -0
  73. data/doc/rdoc/core/files/lib/core/facets/{module/clone_rb.html → string/methodize_rb.html} +4 -4
  74. data/doc/rdoc/core/files/lib/core/facets/{kernel/load_rb.html → string/pathize_rb.html} +4 -4
  75. data/doc/rdoc/core/files/lib/core/facets/string/word_wrap_rb.html +92 -0
  76. data/doc/rdoc/core/files/lib/core/facets/string/words_rb.html +1 -5
  77. data/doc/rdoc/core/files/lib/core/facets/string_rb.html +8 -3
  78. data/doc/rdoc/core/files/lib/core/facets/symbol_rb.html +2 -1
  79. data/doc/rdoc/core/fr_class_index.html +2 -3
  80. data/doc/rdoc/core/fr_file_index.html +36 -16
  81. data/doc/rdoc/core/fr_method_index.html +778 -784
  82. data/doc/rdoc/lore/created.rid +1 -1
  83. data/doc/rdoc/more/classes/ANSICode.html +66 -66
  84. data/doc/rdoc/more/classes/Advisable.html +37 -37
  85. data/doc/rdoc/more/classes/Advisable/Method.html +20 -20
  86. data/doc/rdoc/more/classes/Archive/Tar/Minitar.html +27 -27
  87. data/doc/rdoc/more/classes/Archive/Tar/Minitar/Input.html +28 -28
  88. data/doc/rdoc/more/classes/Archive/Tar/Minitar/Output.html +19 -19
  89. data/doc/rdoc/more/classes/Archive/Tar/Minitar/Reader.html +31 -31
  90. data/doc/rdoc/more/classes/Archive/Tar/Minitar/Writer.html +33 -33
  91. data/doc/rdoc/more/classes/Association.html +28 -28
  92. data/doc/rdoc/more/classes/Association/Kernel.html +8 -8
  93. data/doc/rdoc/more/classes/Autoarray.html +12 -12
  94. data/doc/rdoc/more/classes/BBCode.html +34 -34
  95. data/doc/rdoc/more/classes/BaseX.html +16 -16
  96. data/doc/rdoc/more/classes/BiCrypt.html +67 -67
  97. data/doc/rdoc/more/classes/BigDuration.html +30 -30
  98. data/doc/rdoc/more/classes/BinReadable.html +85 -85
  99. data/doc/rdoc/more/classes/BinReadable/ByteOrder.html +25 -25
  100. data/doc/rdoc/more/classes/Binding.html +201 -0
  101. data/doc/rdoc/more/classes/Buildable.html +4 -4
  102. data/doc/rdoc/more/classes/BuildingBlock.html +32 -32
  103. data/doc/rdoc/more/classes/CLI.html +108 -0
  104. data/doc/rdoc/more/classes/CLI/Arguments.html +76 -76
  105. data/doc/rdoc/more/classes/CLI/Command.html +22 -22
  106. data/doc/rdoc/more/classes/CLI/NoCommandError.html +4 -4
  107. data/doc/rdoc/more/classes/CLI/NoOptionError.html +4 -4
  108. data/doc/rdoc/more/classes/CacheDecorator.html +21 -21
  109. data/doc/rdoc/more/classes/Capsule.html +41 -41
  110. data/doc/rdoc/more/classes/Chain.html +17 -17
  111. data/doc/rdoc/more/classes/Cloneable.html +4 -4
  112. data/doc/rdoc/more/classes/ConsoleUtils.html +18 -18
  113. data/doc/rdoc/more/classes/Coroutine.html +28 -28
  114. data/doc/rdoc/more/classes/Crypt.html +16 -16
  115. data/doc/rdoc/more/classes/CssFilter.html +45 -45
  116. data/doc/rdoc/more/classes/CssTree.html +8 -8
  117. data/doc/rdoc/more/classes/Dictionary.html +228 -228
  118. data/doc/rdoc/more/classes/DictionaryMatcher.html +38 -38
  119. data/doc/rdoc/more/classes/DictionaryMatcher/MatchData.html +4 -4
  120. data/doc/rdoc/more/classes/Downloader.html +56 -56
  121. data/doc/rdoc/more/classes/Duration.html +68 -68
  122. data/doc/rdoc/more/classes/Enumerable.html +44 -44
  123. data/doc/rdoc/more/classes/Enumerable/Elementor.html +16 -16
  124. data/doc/rdoc/more/classes/Enumerable/Enumerator.html +4 -4
  125. data/doc/rdoc/more/classes/EnumerablePass.html +15 -15
  126. data/doc/rdoc/more/classes/Equatable.html +16 -16
  127. data/doc/rdoc/more/classes/EventHook.html +8 -8
  128. data/doc/rdoc/more/classes/Expirable.html +17 -17
  129. data/doc/rdoc/more/classes/FileList.html +125 -125
  130. data/doc/rdoc/more/classes/FileShell.html +147 -147
  131. data/doc/rdoc/more/classes/Fileable.html +14 -14
  132. data/doc/rdoc/more/classes/Fileable/DSL.html +41 -41
  133. data/doc/rdoc/more/classes/Hash.html +306 -14
  134. data/doc/rdoc/more/classes/Hash2Xml.html +4 -4
  135. data/doc/rdoc/more/classes/HtmlFilter.html +9 -9
  136. data/doc/rdoc/more/classes/IORedirect.html +19 -19
  137. data/doc/rdoc/more/classes/InfinityClass.html +36 -36
  138. data/doc/rdoc/more/classes/InfinityClass/Numeric.html +23 -23
  139. data/doc/rdoc/more/classes/Ini.html +37 -37
  140. data/doc/rdoc/more/classes/Instantiable.html +9 -9
  141. data/doc/rdoc/more/classes/Instantise.html +8 -8
  142. data/doc/rdoc/more/classes/Interval.html +187 -187
  143. data/doc/rdoc/more/classes/It.html +12 -12
  144. data/doc/rdoc/more/classes/Kernel.html +77 -77
  145. data/doc/rdoc/more/classes/LRUCache.html +38 -38
  146. data/doc/rdoc/more/classes/LinkedList.html +68 -68
  147. data/doc/rdoc/more/classes/LinkedList/Node.html +4 -4
  148. data/doc/rdoc/{core → more}/classes/MissingArgument.html +1 -2
  149. data/doc/rdoc/more/classes/Module.html +171 -171
  150. data/doc/rdoc/more/classes/Multiton.html +12 -12
  151. data/doc/rdoc/more/classes/Multiton/MetaMethods.html +28 -28
  152. data/doc/rdoc/more/classes/Net/SMTP.html +19 -19
  153. data/doc/rdoc/more/classes/NullClass.html +24 -24
  154. data/doc/rdoc/more/classes/ObjectReflection.html +12 -12
  155. data/doc/rdoc/more/classes/OpEsc.html +5 -5
  156. data/doc/rdoc/more/classes/OpenCascade.html +4 -4
  157. data/doc/rdoc/more/classes/OpenCollection.html +8 -8
  158. data/doc/rdoc/more/classes/OpenHash.html +9 -9
  159. data/doc/rdoc/more/classes/OpenObject.html +95 -95
  160. data/doc/rdoc/more/classes/PQueue.html +84 -84
  161. data/doc/rdoc/more/classes/Paramix.html +11 -11
  162. data/doc/rdoc/more/classes/Paramix/Delegator.html +16 -16
  163. data/doc/rdoc/more/classes/PathList.html +8 -8
  164. data/doc/rdoc/more/classes/PathList/Finder.html +8 -8
  165. data/doc/rdoc/more/classes/Platform.html +46 -46
  166. data/doc/rdoc/more/classes/Pool.html +18 -18
  167. data/doc/rdoc/more/classes/Proc.html +48 -4
  168. data/doc/rdoc/more/classes/ProgressBar.html +52 -52
  169. data/doc/rdoc/more/classes/Prototype.html +28 -28
  170. data/doc/rdoc/more/classes/RWDelegator.html +16 -16
  171. data/doc/rdoc/more/classes/Random.html +9 -9
  172. data/doc/rdoc/more/classes/Random/Array.html +37 -37
  173. data/doc/rdoc/more/classes/Random/Hash.html +52 -52
  174. data/doc/rdoc/more/classes/Random/Object.html +4 -4
  175. data/doc/rdoc/more/classes/Random/String.html +34 -34
  176. data/doc/rdoc/more/classes/Random/String/Self.html +9 -9
  177. data/doc/rdoc/more/classes/Recorder.html +16 -16
  178. data/doc/rdoc/more/classes/Reference.html +19 -19
  179. data/doc/rdoc/more/classes/Registerable.html +13 -13
  180. data/doc/rdoc/more/classes/Semaphore.html +36 -36
  181. data/doc/rdoc/more/classes/Settings.html +28 -28
  182. data/doc/rdoc/more/classes/Settings/Setting.html +13 -13
  183. data/doc/rdoc/more/classes/Settings/SettingCollection.html +4 -4
  184. data/doc/rdoc/more/classes/SimpleStringIO.html +8 -8
  185. data/doc/rdoc/more/classes/Snapshot.html +16 -16
  186. data/doc/rdoc/more/classes/Snapshot/ValueHolder.html +12 -12
  187. data/doc/rdoc/more/classes/String/Style.html +113 -113
  188. data/doc/rdoc/{core → more}/classes/String/Words.html +78 -78
  189. data/doc/rdoc/more/classes/Struct.html +8 -8
  190. data/doc/rdoc/more/classes/SyncArray.html +4 -4
  191. data/doc/rdoc/more/classes/SyncHash.html +4 -4
  192. data/doc/rdoc/more/classes/SyncHash/Delegator.html +28 -28
  193. data/doc/rdoc/more/classes/SyncHash/Inheritor.html +28 -28
  194. data/doc/rdoc/more/classes/System.html +253 -253
  195. data/doc/rdoc/more/classes/Timer.html +48 -48
  196. data/doc/rdoc/more/classes/Timer/Dummy.html +9 -9
  197. data/doc/rdoc/more/classes/TracePoint.html +64 -62
  198. data/doc/rdoc/more/classes/Tuple.html +170 -170
  199. data/doc/rdoc/more/classes/TypeCast/Class.html +4 -4
  200. data/doc/rdoc/more/classes/TypeCast/Object.html +4 -4
  201. data/doc/rdoc/more/classes/Uninheritable.html +6 -6
  202. data/doc/rdoc/more/classes/UploadUtils.html +49 -49
  203. data/doc/rdoc/more/classes/VersionNumber.html +53 -53
  204. data/doc/rdoc/more/classes/Weekdays.html +28 -28
  205. data/doc/rdoc/more/classes/XOXO.html +9 -9
  206. data/doc/rdoc/more/classes/ZipUtils.html +58 -58
  207. data/doc/rdoc/more/classes/ZipUtils/DryRun.html +28 -28
  208. data/doc/rdoc/more/classes/ZipUtils/NoWrite.html +28 -28
  209. data/doc/rdoc/more/classes/ZipUtils/Verbose.html +28 -28
  210. data/doc/rdoc/more/created.rid +1 -1
  211. data/doc/rdoc/more/files/lib/more/facets/ansicode_rb.html +1 -1
  212. data/doc/rdoc/{core/files/lib/core → more/files/lib/more}/facets/binding/opvars_rb.html +2 -2
  213. data/doc/rdoc/{core/files/lib/core → more/files/lib/more}/facets/hash/stringify_keys_rb.html +2 -2
  214. data/doc/rdoc/{core/files/lib/core → more/files/lib/more}/facets/hash/symbolize_keys_rb.html +2 -2
  215. data/doc/rdoc/{core/files/lib/core/facets/proc → more/files/lib/more/facets}/partial_rb.html +8 -7
  216. data/doc/rdoc/more/files/lib/more/facets/snapshot_rb.html +2 -2
  217. data/doc/rdoc/more/files/lib/more/facets/string/words_rb.html +96 -0
  218. data/doc/rdoc/more/files/lib/more/facets/tracepoint_rb.html +13 -8
  219. data/doc/rdoc/more/fr_class_index.html +4 -2
  220. data/doc/rdoc/more/fr_file_index.html +9 -2
  221. data/doc/rdoc/more/fr_method_index.html +1013 -1009
  222. data/doc/ri/CLI/cdesc-CLI.yaml +7 -2
  223. data/doc/ri/Enumerable/probability-i.yaml +1 -1
  224. data/doc/ri/Module/append_features-i.yaml +4 -3
  225. data/doc/ri/Module/cdesc-Module.yaml +4 -3
  226. data/doc/ri/Module/methodize-i.yaml +14 -0
  227. data/doc/ri/Module/redefine_method-i.yaml +1 -1
  228. data/doc/ri/Module/redirect_method-i.yaml +3 -1
  229. data/doc/ri/Module/rename_method-i.yaml +1 -1
  230. data/doc/ri/created.rid +1 -1
  231. data/lib/core/facets/array.rb +3 -0
  232. data/lib/core/facets/binding.rb +0 -1
  233. data/lib/core/facets/class.rb +4 -4
  234. data/lib/core/facets/class/{to_methodname.rb → methodize.rb} +5 -2
  235. data/lib/core/facets/class/pathize.rb +14 -0
  236. data/lib/core/facets/enumerable.rb +5 -2
  237. data/lib/core/facets/enumerable/commonality.rb +33 -0
  238. data/lib/core/facets/enumerable/entropy.rb +37 -0
  239. data/lib/core/facets/enumerable/frequency.rb +18 -0
  240. data/lib/core/facets/enumerable/probability.rb +1 -98
  241. data/lib/core/facets/file.rb +1 -1
  242. data/lib/core/facets/hash.rb +6 -0
  243. data/lib/{more → core}/facets/indexable.rb +0 -0
  244. data/lib/core/facets/kernel.rb +15 -1
  245. data/lib/core/facets/kernel/require_all.rb +21 -0
  246. data/lib/core/facets/kernel/{load.rb → require_local.rb} +6 -23
  247. data/lib/core/facets/module.rb +7 -3
  248. data/lib/core/facets/module/integrate.rb +2 -0
  249. data/lib/core/facets/module/methodize.rb +14 -0
  250. data/lib/core/facets/module/pathize.rb +10 -7
  251. data/lib/core/facets/module/redefine_method.rb +35 -0
  252. data/lib/core/facets/module/redirect_method.rb +45 -0
  253. data/lib/core/facets/module/rename_method.rb +20 -0
  254. data/lib/core/facets/module/revise.rb +7 -113
  255. data/lib/core/facets/module/wrap_method.rb +28 -0
  256. data/lib/core/facets/numeric.rb +1 -1
  257. data/lib/core/facets/proc.rb +2 -3
  258. data/lib/{more → core}/facets/stackable.rb +0 -0
  259. data/lib/core/facets/string.rb +8 -6
  260. data/lib/core/facets/string/each_word.rb +13 -0
  261. data/lib/core/facets/string/methodize.rb +12 -0
  262. data/lib/core/facets/string/pathize.rb +12 -0
  263. data/lib/core/facets/string/word_wrap.rb +34 -0
  264. data/lib/core/facets/string/words.rb +6 -167
  265. data/lib/core/facets/symbol.rb +1 -0
  266. data/lib/more/facets/ansicode.rb +4 -4
  267. data/lib/{core → more}/facets/binding/opvars.rb +0 -0
  268. data/lib/{core → more}/facets/hash/stringify_keys.rb +0 -0
  269. data/lib/{core → more}/facets/hash/symbolize_keys.rb +5 -6
  270. data/lib/{core/facets/proc → more/facets}/partial.rb +0 -0
  271. data/lib/more/facets/string/words.rb +173 -0
  272. data/test/core/dir/test_multiglob.rb +1 -0
  273. data/test/core/dir/test_recurse.rb +1 -0
  274. data/test/core/enumerable/test_commonality.rb +15 -0
  275. data/test/core/enumerable/test_entropy.rb +15 -0
  276. data/test/core/enumerable/test_frequency.rb +11 -0
  277. data/test/core/enumerable/test_probability.rb +1 -34
  278. data/test/core/string/test_each_word.rb +14 -0
  279. data/test/core/string/test_fold.rb +1 -1
  280. data/test/core/string/test_word_wrap.rb +35 -0
  281. data/test/core/string/test_words.rb +12 -61
  282. data/test/more/test_command.rb +7 -9
  283. data/test/more/test_paramix.rb +4 -1
  284. data/test/{core/proc → more}/test_partial.rb +1 -1
  285. metadata +75 -38
  286. data/doc/rdoc/core/classes/Module/CloneExtensions.html +0 -287
  287. data/doc/ri/Module/CloneExtensions/cdesc-CloneExtensions.yaml +0 -20
  288. data/doc/ri/Module/CloneExtensions/clone_removing-i.yaml +0 -14
  289. data/doc/ri/Module/CloneExtensions/clone_renaming-i.yaml +0 -14
  290. data/doc/ri/Module/CloneExtensions/clone_using-i.yaml +0 -14
  291. data/lib/core/facets/class/to_pathname.rb +0 -12
  292. data/lib/core/facets/module/clone.rb +0 -57
  293. data/test/core/module/test_clone.rb +0 -45
@@ -4,8 +4,13 @@ attributes: []
4
4
  class_methods: []
5
5
 
6
6
  comment:
7
- constants: []
8
-
7
+ constants:
8
+ - !ruby/object:RI::Constant
9
+ comment:
10
+ - !ruby/struct:SM::Flow::P
11
+ body: Temporary backward compatability.
12
+ name: MasterCommand
13
+ value: Command
9
14
  full_name: CLI
10
15
  includes: []
11
16
 
@@ -4,7 +4,7 @@ aliases: []
4
4
  block_params:
5
5
  comment:
6
6
  - !ruby/struct:SM::Flow::P
7
- body: Generates a hash mapping each unique symbol in the array to the relative frequency, i.e. the probablity, of it appearence.
7
+ body: Generates a hash mapping each unique element in the array to the relative frequency, i.e. the probablity, of it appearence.
8
8
  - !ruby/struct:SM::Flow::VERB
9
9
  body: " CREDIT: Brian Schr\xC3\xB6der\n"
10
10
  full_name: Enumerable#probability
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:RI::MethodDescription
2
- aliases: []
3
-
2
+ aliases:
3
+ - !ruby/object:RI::AliasName
4
+ name: append_features_without_class_extension
4
5
  block_params:
5
6
  comment:
6
7
  full_name: Module#append_features
7
8
  is_singleton: false
8
9
  name: append_features
9
- params: (mod)
10
+ params: ( base )
10
11
  visibility: public
@@ -9,9 +9,8 @@ comment: []
9
9
  constants: []
10
10
 
11
11
  full_name: Module
12
- includes:
13
- - !ruby/object:RI::IncludedModule
14
- name: CloneExtensions
12
+ includes: []
13
+
15
14
  instance_methods:
16
15
  - !ruby/object:RI::MethodSummary
17
16
  name: "*"
@@ -135,6 +134,8 @@ instance_methods:
135
134
  name: method_overloads
136
135
  - !ruby/object:RI::MethodSummary
137
136
  name: method_space
137
+ - !ruby/object:RI::MethodSummary
138
+ name: methodize
138
139
  - !ruby/object:RI::MethodSummary
139
140
  name: mixin_parameters
140
141
  - !ruby/object:RI::MethodSummary
@@ -0,0 +1,14 @@
1
+ --- !ruby/object:RI::MethodDescription
2
+ aliases: []
3
+
4
+ block_params:
5
+ comment:
6
+ - !ruby/struct:SM::Flow::P
7
+ body: Translate a module name to a suitable method name.
8
+ - !ruby/struct:SM::Flow::VERB
9
+ body: " My::CoolClass.methodize => "my__cool_class"\n"
10
+ full_name: Module#methodize
11
+ is_singleton: false
12
+ name: methodize
13
+ params: ()
14
+ visibility: public
@@ -9,7 +9,7 @@ comment:
9
9
  - !ruby/struct:SM::Flow::P
10
10
  body: If <em>aka</em> is given, then the method being redefined will first be aliased to this name.
11
11
  - !ruby/struct:SM::Flow::VERB
12
- body: " class Greeter\n def hello ; &quot;Hello&quot; ; end\n end\n\n Greeter.new.hello #=&gt; &quot;Hello&quot;\n\n class Greeter\n redefine_method( :hello, :hi ) do\n hi + &quot;, friend!&quot;\n end\n end\n\n Greeter.new.hello #=&gt; &quot;Hello, friend!&quot;\n\n CREDIT: Trans\n"
12
+ body: " class Greeter\n def hello ; &quot;Hello&quot; ; end\n end\n\n Greeter.new.hello #=&gt; &quot;Hello&quot;\n\n class Greeter\n redefine_method( :hello, :hi ) do\n hi + &quot;, friend!&quot;\n end\n end\n\n Greeter.new.hello #=&gt; &quot;Hello, friend!&quot;\n\n CREDIT: Trans\n"
13
13
  full_name: Module#redefine_method
14
14
  is_singleton: false
15
15
  name: redefine_method
@@ -11,7 +11,9 @@ comment:
11
11
  - !ruby/struct:SM::Flow::P
12
12
  body: "The above class definition is equivalent to:"
13
13
  - !ruby/struct:SM::Flow::VERB
14
- body: " class Example\n def hi(*args)\n hello(*args)\n end\n def hey(*args)\n hello(*args)\n end\n def hello\n puts &quot;Hello&quot;\n end\n end\n\n CREDIT: Trans\n"
14
+ body: " class Example\n def hi(*args)\n hello(*args)\n end\n def hey(*args)\n hello(*args)\n end\n def hello\n puts &quot;Hello&quot;\n end\n end\n"
15
+ - !ruby/struct:SM::Flow::P
16
+ body: "CREDIT: Trans"
15
17
  full_name: Module#redirect_method
16
18
  is_singleton: false
17
19
  name: redirect_method
@@ -7,7 +7,7 @@ comment:
7
7
  - !ruby/struct:SM::Flow::P
8
8
  body: Aliases a method and undefines the original.
9
9
  - !ruby/struct:SM::Flow::VERB
10
- body: " rename_method( :to_method, :from_method )\n\n CREDIT: Trans\n"
10
+ body: " rename_method( :to_method, :from_method )\n\n CREDIT: Trans\n"
11
11
  full_name: Module#rename_method
12
12
  is_singleton: false
13
13
  name: rename_method
@@ -1 +1 @@
1
- Tue, 12 Aug 2008 23:36:17 -0400
1
+ Wed, 13 Aug 2008 19:26:46 -0400
@@ -10,14 +10,17 @@
10
10
  require 'facets/array/combination.rb'
11
11
  require 'facets/array/conjoin.rb'
12
12
  require 'facets/array/delete.rb'
13
+ require 'facets/array/indexable.rb'
13
14
  require 'facets/array/merge.rb'
14
15
  require 'facets/array/not_empty'
15
16
  require 'facets/array/only'
16
17
  require 'facets/array/pad.rb'
17
18
  require 'facets/array/permutation.rb'
18
19
  require 'facets/array/product.rb'
20
+ require 'facets/array/recursively.rb'
19
21
  require 'facets/array/rotate.rb'
20
22
  require 'facets/array/select.rb'
21
23
  require 'facets/array/splice.rb'
24
+ require 'facets/array/stackable.rb'
22
25
  require 'facets/array/traverse.rb'
23
26
 
@@ -3,6 +3,5 @@ require 'facets/binding/eval'
3
3
  require 'facets/binding/caller'
4
4
  require 'facets/binding/defined'
5
5
  require 'facets/binding/local_variables'
6
- #require 'facets/binding/opvars'
7
6
  require 'facets/binding/self'
8
7
 
@@ -1,7 +1,7 @@
1
1
  require 'facets/class/descendents'
2
- #require 'facets/class/prepend'
3
- #require 'facets/class/subclasses'
4
- #require 'facets/class/to_methodname'
5
- #require 'facets/class/to_pathname'
2
+ require 'facets/class/prepend'
3
+ require 'facets/class/subclasses'
4
+ require 'facets/class/methodize'
5
+ require 'facets/class/pathize'
6
6
  require 'facets/class/to_proc'
7
7
 
@@ -1,11 +1,14 @@
1
+ require 'facets/string/methodize'
2
+
1
3
  class Class
2
4
 
3
5
  # Translate a class name to a suitable method name.
4
6
  #
5
7
  # My::CoolClass.methodize => "my__cool_class"
6
8
  #
7
- def to_methodname
8
- name.gsub(/([A-Z]+)([A-Z])/,'\1_\2').gsub(/([a-z])([A-Z])/,'\1_\2').gsub('::','__').downcase
9
+ def methodize
10
+ name.methodize
9
11
  end
10
12
 
11
13
  end
14
+
@@ -0,0 +1,14 @@
1
+ require 'facets/string/pathize'
2
+
3
+ class Class
4
+
5
+ # Converts a class name to a unix path.
6
+ #
7
+ # My::CoolClass.pathize #=> "my/cool_class"
8
+ #
9
+ def pathize
10
+ name.pathize
11
+ end
12
+
13
+ end
14
+
@@ -1,20 +1,23 @@
1
1
  require 'facets/enumerable/accumulate.rb'
2
2
  require 'facets/enumerable/cluster_by.rb'
3
3
  require 'facets/enumerable/collect.rb'
4
+ require 'facets/enumerable/commonality.rb'
4
5
  require 'facets/enumerable/count.rb'
5
6
  require 'facets/enumerable/divide.rb'
6
7
  require 'facets/enumerable/duplicates.rb'
7
8
  require 'facets/enumerable/each_by.rb'
9
+ require 'facets/enumerable/entropy.rb'
10
+ require 'facets/enumerable/frequency.rb'
8
11
  require 'facets/enumerable/group_by.rb'
9
12
  require 'facets/enumerable/inject.rb'
10
- require 'facets/enumerable/mash.rb'
11
13
  require 'facets/enumerable/map_send.rb'
14
+ require 'facets/enumerable/mash.rb'
12
15
  require 'facets/enumerable/mode.rb'
13
16
  require 'facets/enumerable/modulate.rb'
17
+ require 'facets/enumerable/probability.rb'
14
18
  require 'facets/enumerable/none.rb'
15
19
  require 'facets/enumerable/occur.rb'
16
20
  require 'facets/enumerable/one.rb'
17
- #require 'facets/enumerable/probablity.rb'
18
21
  require 'facets/enumerable/split.rb'
19
22
  require 'facets/enumerable/sum.rb'
20
23
  require 'facets/enumerable/uniq_by.rb'
@@ -0,0 +1,33 @@
1
+ module Enumerable
2
+
3
+ # Returns all items that are equal in terms of the supplied block.
4
+ # If no block is given objects are considered to be equal if they
5
+ # return the same value for Object#hash and if obj1 == obj2.
6
+ #
7
+ # [1, 2, 2, 3, 4, 4].commonality # => { 2 => [2], 4 => [4] }
8
+ #
9
+ # ["foo", "bar", "a"].commonality { |str| str.length }
10
+ # # => { 3 => ["foo, "bar"] }
11
+ #
12
+ # # Returns all persons that share their last name with another person.
13
+ # persons.collisions { |person| person.last_name }
14
+ #
15
+ # CREDIT: Florian Gross
16
+
17
+ def commonality( &block )
18
+ had_no_block = !block
19
+ block ||= lambda { |item| item }
20
+ result = Hash.new { |hash, key| hash[key] = Array.new }
21
+ self.each do |item|
22
+ key = block.call(item)
23
+ result[key] << item
24
+ end
25
+ result.reject! do |key, values|
26
+ values.size <= 1
27
+ end
28
+ #return had_no_block ? result.values.flatten : result
29
+ return result
30
+ end
31
+
32
+ end
33
+
@@ -0,0 +1,37 @@
1
+ require 'facets/enumerable/probability'
2
+
3
+ module Enumerable
4
+
5
+ # Shannon's entropy for an array - returns the average
6
+ # bits per symbol required to encode the array.
7
+ # Lower values mean less "entropy" - i.e. less unique
8
+ # information in the array.
9
+ #
10
+ # %w{ a b c d e e e }.entropy #=>
11
+ #
12
+ # CREDIT: Derek
13
+
14
+ def entropy
15
+ arr = to_a
16
+ probHash = arr.probability
17
+ # h is the Shannon entropy of the array
18
+ h = -1.to_f * probHash.keys.inject(0.to_f) do |sum, i|
19
+ sum + (probHash[i] * (Math.log(probHash[i])/Math.log(2.to_f)))
20
+ end
21
+ h
22
+ end
23
+
24
+ # Returns the maximum possible Shannon entropy of the array
25
+ # with given size assuming that it is an "order-0" source
26
+ # (each element is selected independently of the next).
27
+ #
28
+ # CREDIT: Derek
29
+
30
+ def ideal_entropy
31
+ arr = to_a
32
+ unitProb = 1.0.to_f / arr.size.to_f
33
+ (-1.to_f * arr.size.to_f * unitProb * Math.log(unitProb)/Math.log(2.to_f))
34
+ end
35
+
36
+ end
37
+
@@ -0,0 +1,18 @@
1
+ module Enumerable
2
+
3
+ # Generates a hash mapping each unique symbol in the array
4
+ # to the absolute frequency it appears.
5
+ #
6
+ # CREDIT: Brian Schröder
7
+
8
+ def frequency
9
+ #probs = Hash.new(0)
10
+ #each do |e|
11
+ # probs[e] += 1
12
+ #end
13
+ #probs
14
+ inject(Hash.new(0)){|h,v| h[v]+=1; h}
15
+ end
16
+
17
+ end
18
+
@@ -1,6 +1,6 @@
1
1
  module Enumerable
2
2
 
3
- # Generates a hash mapping each unique symbol in the array
3
+ # Generates a hash mapping each unique element in the array
4
4
  # to the relative frequency, i.e. the probablity, of
5
5
  # it appearence.
6
6
  #
@@ -32,102 +32,5 @@ module Enumerable
32
32
  # probHash
33
33
  # end
34
34
 
35
- # Shannon's entropy for an array - returns the average
36
- # bits per symbol required to encode the array.
37
- # Lower values mean less "entropy" - i.e. less unique
38
- # information in the array.
39
- #
40
- # %w{ a b c d e e e }.entropy #=>
41
- #
42
- # CREDIT: Derek
43
-
44
- def entropy
45
- arr = to_a
46
- probHash = arr.probability
47
- # h is the Shannon entropy of the array
48
- h = -1.to_f * probHash.keys.inject(0.to_f) do |sum, i|
49
- sum + (probHash[i] * (Math.log(probHash[i])/Math.log(2.to_f)))
50
- end
51
- h
52
- end
53
-
54
- # Returns the maximum possible Shannon entropy of the array
55
- # with given size assuming that it is an "order-0" source
56
- # (each element is selected independently of the next).
57
- #
58
- # CREDIT: Derek
59
-
60
- def ideal_entropy
61
- arr = to_a
62
- unitProb = 1.0.to_f / arr.size.to_f
63
- (-1.to_f * arr.size.to_f * unitProb * Math.log(unitProb)/Math.log(2.to_f))
64
- end
65
-
66
- # Generates a hash mapping each unique symbol in the array
67
- # to the absolute frequency it appears.
68
- #
69
- # CREDIT: Brian Schröder
70
-
71
- def frequency
72
- #probs = Hash.new(0)
73
- #each do |e|
74
- # probs[e] += 1
75
- #end
76
- #probs
77
- inject(Hash.new(0)){|h,v| h[v]+=1; h}
78
- end
79
-
80
- # Returns all items that are equal in terms of the supplied block.
81
- # If no block is given objects are considered to be equal if they
82
- # return the same value for Object#hash and if obj1 == obj2.
83
- #
84
- # [1, 2, 2, 3, 4, 4].commonality # => { 2 => [2], 4 => [4] }
85
- #
86
- # ["foo", "bar", "a"].commonality { |str| str.length }
87
- # # => { 3 => ["foo, "bar"] }
88
- #
89
- # # Returns all persons that share their last name with another person.
90
- # persons.collisions { |person| person.last_name }
91
- #
92
- # CREDIT: Florian Gross
93
-
94
- def commonality( &block )
95
- had_no_block = !block
96
- block ||= lambda { |item| item }
97
- result = Hash.new { |hash, key| hash[key] = Array.new }
98
- self.each do |item|
99
- key = block.call(item)
100
- result[key] << item
101
- end
102
- result.reject! do |key, values|
103
- values.size <= 1
104
- end
105
- #return had_no_block ? result.values.flatten : result
106
- return result
107
- end
108
-
109
- # Like commonality but returns an array of duplicates.
110
-
111
- #def collisions(&blk) #:yield:
112
- # a = []
113
- # commonality(&blk).each{ |k,v| a.concat(v) }
114
- # a.uniq
115
- #end
116
-
117
35
  end
118
36
 
119
-
120
- # class String
121
- #
122
- # NOTE: String#entropy has been deprecated.
123
- # Use str.chars.entropy instead.
124
- # def entropy
125
- # split(//).entropy
126
- # end
127
- #
128
- # # Not needed b/c ideal_entropy is only dependent on size.
129
- # # def ideal_entropy
130
- # # self.split(//).ideal_entropy
131
- # # end
132
- #
133
- # end
@@ -1,6 +1,6 @@
1
1
  require 'facets/file/null.rb'
2
2
  require 'facets/file/read.rb'
3
- #require 'facets/file/rewrite.rb'
3
+ require 'facets/file/rewrite.rb'
4
4
  require 'facets/file/rootname.rb'
5
5
  require 'facets/file/write.rb'
6
6
 
@@ -1,3 +1,4 @@
1
+ require 'facets/hash/alias.rb'
1
2
  require 'facets/hash/argumentize.rb'
2
3
  require 'facets/hash/at.rb'
3
4
  require 'facets/hash/autonew.rb'
@@ -12,12 +13,17 @@ require 'facets/hash/keys.rb'
12
13
  require 'facets/hash/mash.rb'
13
14
  require 'facets/hash/merge.rb'
14
15
  require 'facets/hash/op.rb'
16
+ require 'facets/hash/recursive_merge.rb'
17
+ require 'facets/hash/recursively.rb'
15
18
  require 'facets/hash/rekey.rb'
16
19
  require 'facets/hash/select.rb'
17
20
  require 'facets/hash/slice.rb'
21
+ require 'facets/hash/swap.rb'
22
+ require 'facets/hash/to_h.rb'
18
23
  require 'facets/hash/to_proc.rb'
19
24
  require 'facets/hash/to_struct.rb'
20
25
  require 'facets/hash/traverse.rb'
21
26
  require 'facets/hash/update.rb'
27
+ require 'facets/hash/weave.rb'
22
28
  require 'facets/hash/zipnew.rb'
23
29