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
@@ -1,287 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
- <html>
6
- <head>
7
- <title>Module: Module::CloneExtensions</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
-
11
- <script language="JavaScript" type="text/javascript">
12
- // <![CDATA[
13
-
14
- function toggleSource( id )
15
- {
16
- var elem
17
- var link
18
-
19
- if( document.getElementById )
20
- {
21
- elem = document.getElementById( id )
22
- link = document.getElementById( "l_" + id )
23
- }
24
- else if ( document.all )
25
- {
26
- elem = eval( "document.all." + id )
27
- link = eval( "document.all.l_" + id )
28
- }
29
- else
30
- return false;
31
-
32
- if( elem.style.display == "block" )
33
- {
34
- elem.style.display = "none"
35
- link.innerHTML = "show source"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "hide source"
41
- }
42
- }
43
-
44
- function openCode( url )
45
- {
46
- window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
47
- }
48
- // ]]>
49
- </script>
50
- </head>
51
-
52
- <body>
53
- <table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
54
- <td class="file-title"><span class="file-title-prefix">Module</span><br />Module::CloneExtensions</td>
55
- <td align="right">
56
- <table cellspacing="0" cellpadding="2">
57
- <tr valign="top">
58
- <td>In:</td>
59
- <td>
60
- <a href="../../files/lib/core/facets/module/clone_rb.html">lib/core/facets/module/clone.rb</a>
61
- <a href="../../files/lib/core/facets/module/clone_rb.html">lib/core/facets/module/clone.rb</a>
62
- </td>
63
- </tr>
64
- </table>
65
- </td>
66
- </tr>
67
- </table>
68
- <!-- banner header -->
69
-
70
- <div id="bodyContent">
71
- <div id="content">
72
-
73
-
74
-
75
-
76
- <div class="sectiontitle">Methods</div>
77
- <ul>
78
- <li><a href="#M000379">clone_removing</a></li>
79
- <li><a href="#M000376">clone_removing</a></li>
80
- <li><a href="#M000375">clone_renaming</a></li>
81
- <li><a href="#M000378">clone_renaming</a></li>
82
- <li><a href="#M000377">clone_using</a></li>
83
- <li><a href="#M000380">clone_using</a></li>
84
- </ul>
85
-
86
-
87
-
88
-
89
-
90
-
91
- <div class="sectiontitle">Public Instance methods</div>
92
- <div class="method">
93
- <div class="title">
94
- <a name="M000379"></a><b>clone_removing</b>( *meths )
95
- </div>
96
- <div class="description">
97
- <p>
98
- Returns an anonymous module with the specified methods of the receiving
99
- module removed.
100
- </p>
101
- <pre>
102
- NOTE: These is likely to be usurped by traits.rb.
103
-
104
- CREDIT: Trans
105
- </pre>
106
- </div>
107
- <div class="sourcecode">
108
- <p class="source-link">[ <a href="javascript:toggleSource('M000379_source')" id="l_M000379_source">show source</a> ]</p>
109
- <div id="M000379_source" class="dyn-source">
110
- <pre>
111
- <span class="ruby-comment cmt"># File lib/core/facets/module/clone.rb, line 30</span>
112
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clone_removing</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">meths</span> )
113
- <span class="ruby-identifier">mod</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
114
- <span class="ruby-identifier">methods_to_remove</span> = <span class="ruby-identifier">meths</span>
115
- <span class="ruby-identifier">methods_to_remove</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">class_eval</span>{ <span class="ruby-identifier">remove_method</span> <span class="ruby-identifier">m</span> } }
116
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">mod</span>
117
- <span class="ruby-keyword kw">end</span>
118
- </pre>
119
- </div>
120
- </div>
121
- </div>
122
- <div class="method">
123
- <div class="title">
124
- <a name="M000376"></a><b>clone_removing</b>( *meths )
125
- </div>
126
- <div class="description">
127
- <p>
128
- Returns an anonymous module with the specified methods of the receiving
129
- module removed.
130
- </p>
131
- <pre>
132
- NOTE: These is likely to be usurped by traits.rb.
133
-
134
- CREDIT: Trans
135
- </pre>
136
- </div>
137
- <div class="sourcecode">
138
- <p class="source-link">[ <a href="javascript:toggleSource('M000376_source')" id="l_M000376_source">show source</a> ]</p>
139
- <div id="M000376_source" class="dyn-source">
140
- <pre>
141
- <span class="ruby-comment cmt"># File lib/core/facets/module/clone.rb, line 30</span>
142
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clone_removing</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">meths</span> )
143
- <span class="ruby-identifier">mod</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
144
- <span class="ruby-identifier">methods_to_remove</span> = <span class="ruby-identifier">meths</span>
145
- <span class="ruby-identifier">methods_to_remove</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">class_eval</span>{ <span class="ruby-identifier">remove_method</span> <span class="ruby-identifier">m</span> } }
146
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">mod</span>
147
- <span class="ruby-keyword kw">end</span>
148
- </pre>
149
- </div>
150
- </div>
151
- </div>
152
- <div class="method">
153
- <div class="title">
154
- <a name="M000375"></a><b>clone_renaming</b>( pairs )
155
- </div>
156
- <div class="description">
157
- <p>
158
- Returns an anonymous module with the specified methods of the receiving
159
- module renamed.
160
- </p>
161
- <pre>
162
- NOTE: These is likely to be usurped by traits.rb.
163
-
164
- CREDIT: Trans
165
- </pre>
166
- </div>
167
- <div class="sourcecode">
168
- <p class="source-link">[ <a href="javascript:toggleSource('M000375_source')" id="l_M000375_source">show source</a> ]</p>
169
- <div id="M000375_source" class="dyn-source">
170
- <pre>
171
- <span class="ruby-comment cmt"># File lib/core/facets/module/clone.rb, line 12</span>
172
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clone_renaming</span>( <span class="ruby-identifier">pairs</span> )
173
- <span class="ruby-identifier">mod</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
174
- <span class="ruby-identifier">pairs</span>.<span class="ruby-identifier">each_pair</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">to_sym</span>, <span class="ruby-identifier">from_sym</span><span class="ruby-operator">|</span>
175
- <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">class_eval</span>{
176
- <span class="ruby-identifier">alias_method</span>( <span class="ruby-identifier">to_sym</span>, <span class="ruby-identifier">from_sym</span> )
177
- <span class="ruby-identifier">undef_method</span>( <span class="ruby-identifier">from_sym</span> )
178
- }
179
- }
180
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">mod</span>
181
- <span class="ruby-keyword kw">end</span>
182
- </pre>
183
- </div>
184
- </div>
185
- </div>
186
- <div class="method">
187
- <div class="title">
188
- <a name="M000378"></a><b>clone_renaming</b>( pairs )
189
- </div>
190
- <div class="description">
191
- <p>
192
- Returns an anonymous module with the specified methods of the receiving
193
- module renamed.
194
- </p>
195
- <pre>
196
- NOTE: These is likely to be usurped by traits.rb.
197
-
198
- CREDIT: Trans
199
- </pre>
200
- </div>
201
- <div class="sourcecode">
202
- <p class="source-link">[ <a href="javascript:toggleSource('M000378_source')" id="l_M000378_source">show source</a> ]</p>
203
- <div id="M000378_source" class="dyn-source">
204
- <pre>
205
- <span class="ruby-comment cmt"># File lib/core/facets/module/clone.rb, line 12</span>
206
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clone_renaming</span>( <span class="ruby-identifier">pairs</span> )
207
- <span class="ruby-identifier">mod</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
208
- <span class="ruby-identifier">pairs</span>.<span class="ruby-identifier">each_pair</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">to_sym</span>, <span class="ruby-identifier">from_sym</span><span class="ruby-operator">|</span>
209
- <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">class_eval</span>{
210
- <span class="ruby-identifier">alias_method</span>( <span class="ruby-identifier">to_sym</span>, <span class="ruby-identifier">from_sym</span> )
211
- <span class="ruby-identifier">undef_method</span>( <span class="ruby-identifier">from_sym</span> )
212
- }
213
- }
214
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">mod</span>
215
- <span class="ruby-keyword kw">end</span>
216
- </pre>
217
- </div>
218
- </div>
219
- </div>
220
- <div class="method">
221
- <div class="title">
222
- <a name="M000377"></a><b>clone_using</b>( *methods )
223
- </div>
224
- <div class="description">
225
- <p>
226
- Returns an anonymous module with only the specified methods of the
227
- receiving module intact.
228
- </p>
229
- <pre>
230
- NOTE: These is likely to be usurped by traits.rb.
231
-
232
- CREDIT: Trans
233
- </pre>
234
- </div>
235
- <div class="sourcecode">
236
- <p class="source-link">[ <a href="javascript:toggleSource('M000377_source')" id="l_M000377_source">show source</a> ]</p>
237
- <div id="M000377_source" class="dyn-source">
238
- <pre>
239
- <span class="ruby-comment cmt"># File lib/core/facets/module/clone.rb, line 44</span>
240
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clone_using</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">methods</span> )
241
- <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">collect!</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">to_s</span> }
242
- <span class="ruby-identifier">methods_to_remove</span> = <span class="ruby-identifier">instance_methods</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">methods</span>
243
- <span class="ruby-identifier">mod</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
244
- <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">class_eval</span>{ <span class="ruby-identifier">methods_to_remove</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">undef_method</span> <span class="ruby-identifier">m</span> } }
245
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">mod</span>
246
- <span class="ruby-keyword kw">end</span>
247
- </pre>
248
- </div>
249
- </div>
250
- </div>
251
- <div class="method">
252
- <div class="title">
253
- <a name="M000380"></a><b>clone_using</b>( *methods )
254
- </div>
255
- <div class="description">
256
- <p>
257
- Returns an anonymous module with only the specified methods of the
258
- receiving module intact.
259
- </p>
260
- <pre>
261
- NOTE: These is likely to be usurped by traits.rb.
262
-
263
- CREDIT: Trans
264
- </pre>
265
- </div>
266
- <div class="sourcecode">
267
- <p class="source-link">[ <a href="javascript:toggleSource('M000380_source')" id="l_M000380_source">show source</a> ]</p>
268
- <div id="M000380_source" class="dyn-source">
269
- <pre>
270
- <span class="ruby-comment cmt"># File lib/core/facets/module/clone.rb, line 44</span>
271
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clone_using</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">methods</span> )
272
- <span class="ruby-identifier">methods</span>.<span class="ruby-identifier">collect!</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">m</span>.<span class="ruby-identifier">to_s</span> }
273
- <span class="ruby-identifier">methods_to_remove</span> = <span class="ruby-identifier">instance_methods</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">methods</span>
274
- <span class="ruby-identifier">mod</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
275
- <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">class_eval</span>{ <span class="ruby-identifier">methods_to_remove</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">undef_method</span> <span class="ruby-identifier">m</span> } }
276
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">mod</span>
277
- <span class="ruby-keyword kw">end</span>
278
- </pre>
279
- </div>
280
- </div>
281
- </div>
282
- </div>
283
-
284
- </div>
285
-
286
- </body>
287
- </html>
@@ -1,20 +0,0 @@
1
- --- !ruby/object:RI::ClassDescription
2
- attributes: []
3
-
4
- class_methods: []
5
-
6
- comment:
7
- constants: []
8
-
9
- full_name: Module::CloneExtensions
10
- includes: []
11
-
12
- instance_methods:
13
- - !ruby/object:RI::MethodSummary
14
- name: clone_removing
15
- - !ruby/object:RI::MethodSummary
16
- name: clone_renaming
17
- - !ruby/object:RI::MethodSummary
18
- name: clone_using
19
- name: CloneExtensions
20
- superclass:
@@ -1,14 +0,0 @@
1
- --- !ruby/object:RI::MethodDescription
2
- aliases: []
3
-
4
- block_params:
5
- comment:
6
- - !ruby/struct:SM::Flow::P
7
- body: Returns an anonymous module with the specified methods of the receiving module removed.
8
- - !ruby/struct:SM::Flow::VERB
9
- body: " NOTE: These is likely to be usurped by traits.rb.\n\n CREDIT: Trans\n"
10
- full_name: Module::CloneExtensions#clone_removing
11
- is_singleton: false
12
- name: clone_removing
13
- params: ( *meths )
14
- visibility: public
@@ -1,14 +0,0 @@
1
- --- !ruby/object:RI::MethodDescription
2
- aliases: []
3
-
4
- block_params:
5
- comment:
6
- - !ruby/struct:SM::Flow::P
7
- body: Returns an anonymous module with the specified methods of the receiving module renamed.
8
- - !ruby/struct:SM::Flow::VERB
9
- body: " NOTE: These is likely to be usurped by traits.rb.\n\n CREDIT: Trans\n"
10
- full_name: Module::CloneExtensions#clone_renaming
11
- is_singleton: false
12
- name: clone_renaming
13
- params: ( pairs )
14
- visibility: public
@@ -1,14 +0,0 @@
1
- --- !ruby/object:RI::MethodDescription
2
- aliases: []
3
-
4
- block_params:
5
- comment:
6
- - !ruby/struct:SM::Flow::P
7
- body: Returns an anonymous module with only the specified methods of the receiving module intact.
8
- - !ruby/struct:SM::Flow::VERB
9
- body: " NOTE: These is likely to be usurped by traits.rb.\n\n CREDIT: Trans\n"
10
- full_name: Module::CloneExtensions#clone_using
11
- is_singleton: false
12
- name: clone_using
13
- params: ( *methods )
14
- visibility: public
@@ -1,12 +0,0 @@
1
- class Class
2
-
3
- # Converts a class name to a unix path
4
- #
5
- # My::CoolClass.pathize #=> "/my/cool_class"
6
- #
7
- def to_pathname
8
- '/' + name.gsub(/([A-Z]+)([A-Z])/,'\1_\2').gsub(/([a-z])([A-Z])/,'\1_\2').gsub('::','/').downcase
9
- end
10
-
11
- end
12
-
@@ -1,57 +0,0 @@
1
- class Module
2
-
3
- module CloneExtensions
4
-
5
- # Returns an anonymous module with the specified methods
6
- # of the receiving module renamed.
7
- #
8
- # NOTE: These is likely to be usurped by traits.rb.
9
- #
10
- # CREDIT: Trans
11
-
12
- def clone_renaming( pairs )
13
- mod = self.dup
14
- pairs.each_pair{ |to_sym, from_sym|
15
- mod.class_eval{
16
- alias_method( to_sym, from_sym )
17
- undef_method( from_sym )
18
- }
19
- }
20
- return mod
21
- end
22
-
23
- # Returns an anonymous module with the specified methods
24
- # of the receiving module removed.
25
- #
26
- # NOTE: These is likely to be usurped by traits.rb.
27
- #
28
- # CREDIT: Trans
29
-
30
- def clone_removing( *meths )
31
- mod = self.dup
32
- methods_to_remove = meths
33
- methods_to_remove.each{ |m| mod.class_eval{ remove_method m } }
34
- return mod
35
- end
36
-
37
- # Returns an anonymous module with only the specified methods
38
- # of the receiving module intact.
39
- #
40
- # NOTE: These is likely to be usurped by traits.rb.
41
- #
42
- # CREDIT: Trans
43
-
44
- def clone_using( *methods )
45
- methods.collect!{ |m| m.to_s }
46
- methods_to_remove = instance_methods - methods
47
- mod = self.dup
48
- mod.class_eval{ methods_to_remove.each{ |m| undef_method m } }
49
- return mod
50
- end
51
-
52
- end
53
-
54
- include CloneExtensions
55
-
56
- end
57
-
@@ -1,45 +0,0 @@
1
- # Test for facets/module/clone.rb
2
-
3
- require 'facets/module/clone.rb'
4
-
5
- require 'test/unit'
6
-
7
- class TestModuleClone < Test::Unit::TestCase
8
-
9
- module M
10
- def f; 1; end
11
- def g; 2; end
12
- end
13
-
14
- class Remove
15
- include M.clone_removing( :g )
16
- end
17
-
18
- class Rename
19
- include M.clone_renaming( :q => :g )
20
- end
21
-
22
- class Use
23
- include M.clone_using( :f )
24
- end
25
-
26
- def test_removing
27
- assert( Remove.method_defined?(:f) )
28
- assert( ! Remove.method_defined?(:g) )
29
- end
30
-
31
- def test_renaming
32
- assert( ! Rename.method_defined?(:g) )
33
- assert( Rename.method_defined?(:f) )
34
- assert( Rename.method_defined?(:q) )
35
- end
36
-
37
- def test_using_2
38
- assert( ! Use.method_defined?(:g) )
39
- assert( Use.method_defined?(:f) )
40
- end
41
-
42
- end
43
-
44
-
45
-