facets 2.5.2 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (677) hide show
  1. data/HISTORY.rdoc +2245 -0
  2. data/MANIFEST +20 -725
  3. data/{README → README.rdoc} +0 -0
  4. data/RELEASE +37 -48
  5. data/doc/log/stats/index.html +39 -0
  6. data/doc/notes/CHANGES +2529 -0
  7. data/lib/{more → core}/facets/binding/opvars.rb +0 -0
  8. data/lib/core/facets/integer/length.rb +16 -0
  9. data/lib/core/facets/kernel/state.rb +50 -0
  10. data/lib/core/facets/module/extend.rb +2 -2
  11. data/lib/core/facets/string/camelcase.rb +33 -9
  12. data/lib/core/facets/string/lowercase.rb +1 -0
  13. data/lib/core/facets/string/methodize.rb +10 -1
  14. data/lib/core/facets/string/modulize.rb +8 -0
  15. data/lib/core/facets/string/pathize.rb +10 -0
  16. data/lib/core/facets/string/snakecase.rb +2 -2
  17. data/lib/core/facets/string/underscore.rb +21 -0
  18. data/lib/core/facets/string/uppercase.rb +23 -0
  19. data/lib/more/facets/censor.rb +97 -0
  20. data/lib/more/facets/minitar.rb +11 -11
  21. data/lib/more/facets/platform.rb +47 -0
  22. data/lib/more/facets/pry.rb +32 -0
  23. data/lib/more/facets/string/obfuscate.rb +65 -0
  24. data/lib/more/facets/string/stylize.rb +169 -0
  25. data/lib/more/facets/string/words.rb +10 -13
  26. data/meta/modified +1 -0
  27. data/meta/package +1 -0
  28. data/meta/version +1 -0
  29. data/test/core/integer/test_length.rb +12 -0
  30. metadata +41 -822
  31. data/CHANGES +0 -133
  32. data/VERSION +0 -1
  33. data/doc/changelogs/CHANGELOG-0.10.30 +0 -239
  34. data/doc/changelogs/CHANGELOG-1.8.54 +0 -450
  35. data/doc/changelogs/CHANGELOG-2.4.5 +0 -1654
  36. data/doc/rdoc/core/classes/Array.html +0 -1208
  37. data/doc/rdoc/core/classes/Binding.html +0 -364
  38. data/doc/rdoc/core/classes/Class.html +0 -444
  39. data/doc/rdoc/core/classes/Comparable.html +0 -250
  40. data/doc/rdoc/core/classes/Dir.html +0 -395
  41. data/doc/rdoc/core/classes/Enumerable.html +0 -1262
  42. data/doc/rdoc/core/classes/Enumerable/Enumerator.html +0 -243
  43. data/doc/rdoc/core/classes/Enumerator.html +0 -242
  44. data/doc/rdoc/core/classes/Exception.html +0 -163
  45. data/doc/rdoc/core/classes/FalseClass.html +0 -131
  46. data/doc/rdoc/core/classes/File.html +0 -576
  47. data/doc/rdoc/core/classes/FileTest.html +0 -116
  48. data/doc/rdoc/core/classes/Float.html +0 -159
  49. data/doc/rdoc/core/classes/Functor.html +0 -171
  50. data/doc/rdoc/core/classes/Hash.html +0 -2184
  51. data/doc/rdoc/core/classes/Indexable.html +0 -629
  52. data/doc/rdoc/core/classes/InstanceVariables.html +0 -306
  53. data/doc/rdoc/core/classes/Integer.html +0 -583
  54. data/doc/rdoc/core/classes/Kernel.html +0 -2269
  55. data/doc/rdoc/core/classes/Lazy.html +0 -96
  56. data/doc/rdoc/core/classes/Lazy/Future.html +0 -100
  57. data/doc/rdoc/core/classes/Lazy/Promise.html +0 -114
  58. data/doc/rdoc/core/classes/Lazy/PromiseSafe.html +0 -99
  59. data/doc/rdoc/core/classes/MatchData.html +0 -204
  60. data/doc/rdoc/core/classes/Module.html +0 -1316
  61. data/doc/rdoc/core/classes/NilClass.html +0 -217
  62. data/doc/rdoc/core/classes/Numeric.html +0 -251
  63. data/doc/rdoc/core/classes/Object.html +0 -161
  64. data/doc/rdoc/core/classes/ObjectSpace.html +0 -114
  65. data/doc/rdoc/core/classes/Proc.html +0 -302
  66. data/doc/rdoc/core/classes/Range.html +0 -360
  67. data/doc/rdoc/core/classes/Regexp.html +0 -191
  68. data/doc/rdoc/core/classes/Stackable.html +0 -262
  69. data/doc/rdoc/core/classes/String.html +0 -2332
  70. data/doc/rdoc/core/classes/Struct.html +0 -121
  71. data/doc/rdoc/core/classes/Symbol.html +0 -441
  72. data/doc/rdoc/core/classes/Time.html +0 -521
  73. data/doc/rdoc/core/classes/TrueClass.html +0 -131
  74. data/doc/rdoc/core/classes/UnboundMethod.html +0 -200
  75. data/doc/rdoc/core/created.rid +0 -1
  76. data/doc/rdoc/core/files/README.html +0 -287
  77. data/doc/rdoc/core/files/doc/README_core.html +0 -230
  78. data/doc/rdoc/core/files/lib/core/facets/array/combination_rb.html +0 -96
  79. data/doc/rdoc/core/files/lib/core/facets/array/conjoin_rb.html +0 -92
  80. data/doc/rdoc/core/files/lib/core/facets/array/delete_rb.html +0 -101
  81. data/doc/rdoc/core/files/lib/core/facets/array/delete_unless_rb.html +0 -92
  82. data/doc/rdoc/core/files/lib/core/facets/array/delete_values_rb.html +0 -92
  83. data/doc/rdoc/core/files/lib/core/facets/array/index_rb.html +0 -92
  84. data/doc/rdoc/core/files/lib/core/facets/array/indexable_rb.html +0 -97
  85. data/doc/rdoc/core/files/lib/core/facets/array/merge_rb.html +0 -92
  86. data/doc/rdoc/core/files/lib/core/facets/array/not_empty_rb.html +0 -92
  87. data/doc/rdoc/core/files/lib/core/facets/array/only_rb.html +0 -92
  88. data/doc/rdoc/core/files/lib/core/facets/array/pad_rb.html +0 -92
  89. data/doc/rdoc/core/files/lib/core/facets/array/permutation_rb.html +0 -92
  90. data/doc/rdoc/core/files/lib/core/facets/array/product_rb.html +0 -92
  91. data/doc/rdoc/core/files/lib/core/facets/array/recursively_rb.html +0 -92
  92. data/doc/rdoc/core/files/lib/core/facets/array/rotate_rb.html +0 -92
  93. data/doc/rdoc/core/files/lib/core/facets/array/select_rb.html +0 -92
  94. data/doc/rdoc/core/files/lib/core/facets/array/splice_rb.html +0 -92
  95. data/doc/rdoc/core/files/lib/core/facets/array/stackable_rb.html +0 -97
  96. data/doc/rdoc/core/files/lib/core/facets/array/traverse_rb.html +0 -92
  97. data/doc/rdoc/core/files/lib/core/facets/array_rb.html +0 -92
  98. data/doc/rdoc/core/files/lib/core/facets/binding/caller_rb.html +0 -97
  99. data/doc/rdoc/core/files/lib/core/facets/binding/callstack_rb.html +0 -96
  100. data/doc/rdoc/core/files/lib/core/facets/binding/defined_rb.html +0 -96
  101. data/doc/rdoc/core/files/lib/core/facets/binding/eval_rb.html +0 -92
  102. data/doc/rdoc/core/files/lib/core/facets/binding/local_variables_rb.html +0 -96
  103. data/doc/rdoc/core/files/lib/core/facets/binding/self_rb.html +0 -96
  104. data/doc/rdoc/core/files/lib/core/facets/binding_rb.html +0 -92
  105. data/doc/rdoc/core/files/lib/core/facets/bitmask_rb.html +0 -92
  106. data/doc/rdoc/core/files/lib/core/facets/blank_rb.html +0 -97
  107. data/doc/rdoc/core/files/lib/core/facets/boolean_rb.html +0 -126
  108. data/doc/rdoc/core/files/lib/core/facets/cattr_rb.html +0 -100
  109. data/doc/rdoc/core/files/lib/core/facets/class/cattr_accessor_rb.html +0 -96
  110. data/doc/rdoc/core/files/lib/core/facets/class/cattr_rb.html +0 -92
  111. data/doc/rdoc/core/files/lib/core/facets/class/cattr_reader_rb.html +0 -96
  112. data/doc/rdoc/core/files/lib/core/facets/class/cattr_writer_rb.html +0 -96
  113. data/doc/rdoc/core/files/lib/core/facets/class/descendents_rb.html +0 -92
  114. data/doc/rdoc/core/files/lib/core/facets/class/methodize_rb.html +0 -96
  115. data/doc/rdoc/core/files/lib/core/facets/class/pathize_rb.html +0 -96
  116. data/doc/rdoc/core/files/lib/core/facets/class/prepend_rb.html +0 -92
  117. data/doc/rdoc/core/files/lib/core/facets/class/subclasses_rb.html +0 -96
  118. data/doc/rdoc/core/files/lib/core/facets/class/to_proc_rb.html +0 -92
  119. data/doc/rdoc/core/files/lib/core/facets/class_rb.html +0 -92
  120. data/doc/rdoc/core/files/lib/core/facets/comparable/at_least_rb.html +0 -96
  121. data/doc/rdoc/core/files/lib/core/facets/comparable/at_most_rb.html +0 -96
  122. data/doc/rdoc/core/files/lib/core/facets/comparable/bound_rb.html +0 -96
  123. data/doc/rdoc/core/files/lib/core/facets/comparable/cap_rb.html +0 -92
  124. data/doc/rdoc/core/files/lib/core/facets/comparable/clip_rb.html +0 -92
  125. data/doc/rdoc/core/files/lib/core/facets/comparable/cmp_rb.html +0 -92
  126. data/doc/rdoc/core/files/lib/core/facets/comparable/comparable_rb.html +0 -109
  127. data/doc/rdoc/core/files/lib/core/facets/comparable_rb.html +0 -92
  128. data/doc/rdoc/core/files/lib/core/facets/dir/ascend_rb.html +0 -92
  129. data/doc/rdoc/core/files/lib/core/facets/dir/descend_rb.html +0 -96
  130. data/doc/rdoc/core/files/lib/core/facets/dir/multiglob_rb.html +0 -92
  131. data/doc/rdoc/core/files/lib/core/facets/dir/parent_rb.html +0 -92
  132. data/doc/rdoc/core/files/lib/core/facets/dir/recurse_rb.html +0 -92
  133. data/doc/rdoc/core/files/lib/core/facets/dir_rb.html +0 -92
  134. data/doc/rdoc/core/files/lib/core/facets/enumerable/accumulate_rb.html +0 -96
  135. data/doc/rdoc/core/files/lib/core/facets/enumerable/cluster_by_rb.html +0 -96
  136. data/doc/rdoc/core/files/lib/core/facets/enumerable/collect_rb.html +0 -101
  137. data/doc/rdoc/core/files/lib/core/facets/enumerable/commonality_rb.html +0 -92
  138. data/doc/rdoc/core/files/lib/core/facets/enumerable/compact_map_rb.html +0 -92
  139. data/doc/rdoc/core/files/lib/core/facets/enumerable/count_rb.html +0 -92
  140. data/doc/rdoc/core/files/lib/core/facets/enumerable/divide_rb.html +0 -92
  141. data/doc/rdoc/core/files/lib/core/facets/enumerable/duplicates_rb.html +0 -92
  142. data/doc/rdoc/core/files/lib/core/facets/enumerable/each_by_rb.html +0 -96
  143. data/doc/rdoc/core/files/lib/core/facets/enumerable/entropy_rb.html +0 -96
  144. data/doc/rdoc/core/files/lib/core/facets/enumerable/frequency_rb.html +0 -92
  145. data/doc/rdoc/core/files/lib/core/facets/enumerable/graph_rb.html +0 -96
  146. data/doc/rdoc/core/files/lib/core/facets/enumerable/group_by_rb.html +0 -92
  147. data/doc/rdoc/core/files/lib/core/facets/enumerable/inject_rb.html +0 -92
  148. data/doc/rdoc/core/files/lib/core/facets/enumerable/map_send_rb.html +0 -92
  149. data/doc/rdoc/core/files/lib/core/facets/enumerable/map_with_index_rb.html +0 -92
  150. data/doc/rdoc/core/files/lib/core/facets/enumerable/mash_rb.html +0 -92
  151. data/doc/rdoc/core/files/lib/core/facets/enumerable/mode_rb.html +0 -92
  152. data/doc/rdoc/core/files/lib/core/facets/enumerable/modulate_rb.html +0 -92
  153. data/doc/rdoc/core/files/lib/core/facets/enumerable/none_rb.html +0 -92
  154. data/doc/rdoc/core/files/lib/core/facets/enumerable/occur_rb.html +0 -92
  155. data/doc/rdoc/core/files/lib/core/facets/enumerable/one_rb.html +0 -92
  156. data/doc/rdoc/core/files/lib/core/facets/enumerable/probability_rb.html +0 -92
  157. data/doc/rdoc/core/files/lib/core/facets/enumerable/split_rb.html +0 -92
  158. data/doc/rdoc/core/files/lib/core/facets/enumerable/sum_rb.html +0 -92
  159. data/doc/rdoc/core/files/lib/core/facets/enumerable/take_rb.html +0 -92
  160. data/doc/rdoc/core/files/lib/core/facets/enumerable/uniq_by_rb.html +0 -92
  161. data/doc/rdoc/core/files/lib/core/facets/enumerable_rb.html +0 -92
  162. data/doc/rdoc/core/files/lib/core/facets/exception/detail_rb.html +0 -92
  163. data/doc/rdoc/core/files/lib/core/facets/exception/suppress_rb.html +0 -92
  164. data/doc/rdoc/core/files/lib/core/facets/exception_rb.html +0 -92
  165. data/doc/rdoc/core/files/lib/core/facets/file/append_rb.html +0 -92
  166. data/doc/rdoc/core/files/lib/core/facets/file/create_rb.html +0 -92
  167. data/doc/rdoc/core/files/lib/core/facets/file/null_rb.html +0 -92
  168. data/doc/rdoc/core/files/lib/core/facets/file/read_rb.html +0 -92
  169. data/doc/rdoc/core/files/lib/core/facets/file/rewrite_rb.html +0 -92
  170. data/doc/rdoc/core/files/lib/core/facets/file/rootname_rb.html +0 -92
  171. data/doc/rdoc/core/files/lib/core/facets/file/split_all_rb.html +0 -92
  172. data/doc/rdoc/core/files/lib/core/facets/file/split_root_rb.html +0 -92
  173. data/doc/rdoc/core/files/lib/core/facets/file/write_rb.html +0 -102
  174. data/doc/rdoc/core/files/lib/core/facets/file/writelines_rb.html +0 -92
  175. data/doc/rdoc/core/files/lib/core/facets/file_rb.html +0 -92
  176. data/doc/rdoc/core/files/lib/core/facets/filetest/root_rb.html +0 -92
  177. data/doc/rdoc/core/files/lib/core/facets/filetest_rb.html +0 -92
  178. data/doc/rdoc/core/files/lib/core/facets/float/round_rb.html +0 -96
  179. data/doc/rdoc/core/files/lib/core/facets/float_rb.html +0 -92
  180. data/doc/rdoc/core/files/lib/core/facets/functor_rb.html +0 -151
  181. data/doc/rdoc/core/files/lib/core/facets/hash/alias_rb.html +0 -92
  182. data/doc/rdoc/core/files/lib/core/facets/hash/argumentize_rb.html +0 -92
  183. data/doc/rdoc/core/files/lib/core/facets/hash/at_rb.html +0 -92
  184. data/doc/rdoc/core/files/lib/core/facets/hash/autonew_rb.html +0 -92
  185. data/doc/rdoc/core/files/lib/core/facets/hash/collate_rb.html +0 -92
  186. data/doc/rdoc/core/files/lib/core/facets/hash/dearray_values_rb.html +0 -92
  187. data/doc/rdoc/core/files/lib/core/facets/hash/delete_rb.html +0 -92
  188. data/doc/rdoc/core/files/lib/core/facets/hash/diff_rb.html +0 -92
  189. data/doc/rdoc/core/files/lib/core/facets/hash/except_rb.html +0 -92
  190. data/doc/rdoc/core/files/lib/core/facets/hash/group_by_value_rb.html +0 -92
  191. data/doc/rdoc/core/files/lib/core/facets/hash/insert_rb.html +0 -92
  192. data/doc/rdoc/core/files/lib/core/facets/hash/inverse_rb.html +0 -92
  193. data/doc/rdoc/core/files/lib/core/facets/hash/join_rb.html +0 -92
  194. data/doc/rdoc/core/files/lib/core/facets/hash/keys_rb.html +0 -92
  195. data/doc/rdoc/core/files/lib/core/facets/hash/mash_rb.html +0 -96
  196. data/doc/rdoc/core/files/lib/core/facets/hash/merge_rb.html +0 -92
  197. data/doc/rdoc/core/files/lib/core/facets/hash/new_with_rb.html +0 -92
  198. data/doc/rdoc/core/files/lib/core/facets/hash/op_add_rb.html +0 -92
  199. data/doc/rdoc/core/files/lib/core/facets/hash/op_and_rb.html +0 -92
  200. data/doc/rdoc/core/files/lib/core/facets/hash/op_mul_rb.html +0 -92
  201. data/doc/rdoc/core/files/lib/core/facets/hash/op_or_rb.html +0 -92
  202. data/doc/rdoc/core/files/lib/core/facets/hash/op_push_rb.html +0 -92
  203. data/doc/rdoc/core/files/lib/core/facets/hash/op_rb.html +0 -101
  204. data/doc/rdoc/core/files/lib/core/facets/hash/op_sub_rb.html +0 -92
  205. data/doc/rdoc/core/files/lib/core/facets/hash/recursive_merge_rb.html +0 -92
  206. data/doc/rdoc/core/files/lib/core/facets/hash/recursively_rb.html +0 -92
  207. data/doc/rdoc/core/files/lib/core/facets/hash/rekey_rb.html +0 -96
  208. data/doc/rdoc/core/files/lib/core/facets/hash/replace_each_rb.html +0 -92
  209. data/doc/rdoc/core/files/lib/core/facets/hash/select_rb.html +0 -92
  210. data/doc/rdoc/core/files/lib/core/facets/hash/slice_rb.html +0 -96
  211. data/doc/rdoc/core/files/lib/core/facets/hash/stringify_keys_rb.html +0 -96
  212. data/doc/rdoc/core/files/lib/core/facets/hash/swap_rb.html +0 -92
  213. data/doc/rdoc/core/files/lib/core/facets/hash/symbolize_keys_rb.html +0 -96
  214. data/doc/rdoc/core/files/lib/core/facets/hash/to_h_rb.html +0 -96
  215. data/doc/rdoc/core/files/lib/core/facets/hash/to_options_rb.html +0 -96
  216. data/doc/rdoc/core/files/lib/core/facets/hash/to_proc_rb.html +0 -92
  217. data/doc/rdoc/core/files/lib/core/facets/hash/to_struct_rb.html +0 -92
  218. data/doc/rdoc/core/files/lib/core/facets/hash/traverse_rb.html +0 -92
  219. data/doc/rdoc/core/files/lib/core/facets/hash/update_each_rb.html +0 -92
  220. data/doc/rdoc/core/files/lib/core/facets/hash/update_keys_rb.html +0 -92
  221. data/doc/rdoc/core/files/lib/core/facets/hash/update_rb.html +0 -103
  222. data/doc/rdoc/core/files/lib/core/facets/hash/update_values_rb.html +0 -92
  223. data/doc/rdoc/core/files/lib/core/facets/hash/weave_rb.html +0 -92
  224. data/doc/rdoc/core/files/lib/core/facets/hash/zipnew_rb.html +0 -92
  225. data/doc/rdoc/core/files/lib/core/facets/hash_rb.html +0 -92
  226. data/doc/rdoc/core/files/lib/core/facets/indexable_rb.html +0 -113
  227. data/doc/rdoc/core/files/lib/core/facets/integer/even_rb.html +0 -96
  228. data/doc/rdoc/core/files/lib/core/facets/integer/factorial_rb.html +0 -92
  229. data/doc/rdoc/core/files/lib/core/facets/integer/multiple_rb.html +0 -92
  230. data/doc/rdoc/core/files/lib/core/facets/integer/odd_rb.html +0 -92
  231. data/doc/rdoc/core/files/lib/core/facets/integer/of_rb.html +0 -92
  232. data/doc/rdoc/core/files/lib/core/facets/integer/ordinal_rb.html +0 -92
  233. data/doc/rdoc/core/files/lib/core/facets/integer_rb.html +0 -92
  234. data/doc/rdoc/core/files/lib/core/facets/kernel/__callee___rb.html +0 -96
  235. data/doc/rdoc/core/files/lib/core/facets/kernel/__class___rb.html +0 -92
  236. data/doc/rdoc/core/files/lib/core/facets/kernel/__dir___rb.html +0 -92
  237. data/doc/rdoc/core/files/lib/core/facets/kernel/__get___rb.html +0 -92
  238. data/doc/rdoc/core/files/lib/core/facets/kernel/__here___rb.html +0 -92
  239. data/doc/rdoc/core/files/lib/core/facets/kernel/__method___rb.html +0 -92
  240. data/doc/rdoc/core/files/lib/core/facets/kernel/__set___rb.html +0 -96
  241. data/doc/rdoc/core/files/lib/core/facets/kernel/as_rb.html +0 -96
  242. data/doc/rdoc/core/files/lib/core/facets/kernel/ask_rb.html +0 -92
  243. data/doc/rdoc/core/files/lib/core/facets/kernel/attr_singleton_rb.html +0 -92
  244. data/doc/rdoc/core/files/lib/core/facets/kernel/callstack_rb.html +0 -92
  245. data/doc/rdoc/core/files/lib/core/facets/kernel/complete_rb.html +0 -92
  246. data/doc/rdoc/core/files/lib/core/facets/kernel/constant_rb.html +0 -92
  247. data/doc/rdoc/core/files/lib/core/facets/kernel/d_rb.html +0 -92
  248. data/doc/rdoc/core/files/lib/core/facets/kernel/deep_copy_rb.html +0 -92
  249. data/doc/rdoc/core/files/lib/core/facets/kernel/demo_rb.html +0 -92
  250. data/doc/rdoc/core/files/lib/core/facets/kernel/ergo_rb.html +0 -96
  251. data/doc/rdoc/core/files/lib/core/facets/kernel/here_rb.html +0 -92
  252. data/doc/rdoc/core/files/lib/core/facets/kernel/in_rb.html +0 -92
  253. data/doc/rdoc/core/files/lib/core/facets/kernel/instance_assign_rb.html +0 -92
  254. data/doc/rdoc/core/files/lib/core/facets/kernel/instance_class_rb.html +0 -92
  255. data/doc/rdoc/core/files/lib/core/facets/kernel/instance_exec_rb.html +0 -92
  256. data/doc/rdoc/core/files/lib/core/facets/kernel/instance_rb.html +0 -96
  257. data/doc/rdoc/core/files/lib/core/facets/kernel/instance_send_rb.html +0 -92
  258. data/doc/rdoc/core/files/lib/core/facets/kernel/instance_variables_rb.html +0 -92
  259. data/doc/rdoc/core/files/lib/core/facets/kernel/maybe_rb.html +0 -92
  260. data/doc/rdoc/core/files/lib/core/facets/kernel/not_nil_rb.html +0 -92
  261. data/doc/rdoc/core/files/lib/core/facets/kernel/object_class_rb.html +0 -92
  262. data/doc/rdoc/core/files/lib/core/facets/kernel/object_hexid_rb.html +0 -92
  263. data/doc/rdoc/core/files/lib/core/facets/kernel/object_send_rb.html +0 -92
  264. data/doc/rdoc/core/files/lib/core/facets/kernel/p_rb.html +0 -92
  265. data/doc/rdoc/core/files/lib/core/facets/kernel/populate_rb.html +0 -92
  266. data/doc/rdoc/core/files/lib/core/facets/kernel/qua_class_rb.html +0 -92
  267. data/doc/rdoc/core/files/lib/core/facets/kernel/require_all_rb.html +0 -92
  268. data/doc/rdoc/core/files/lib/core/facets/kernel/require_local_rb.html +0 -92
  269. data/doc/rdoc/core/files/lib/core/facets/kernel/resc_rb.html +0 -92
  270. data/doc/rdoc/core/files/lib/core/facets/kernel/respond_rb.html +0 -92
  271. data/doc/rdoc/core/files/lib/core/facets/kernel/returning_rb.html +0 -92
  272. data/doc/rdoc/core/files/lib/core/facets/kernel/silence_rb.html +0 -92
  273. data/doc/rdoc/core/files/lib/core/facets/kernel/singleton_class_rb.html +0 -92
  274. data/doc/rdoc/core/files/lib/core/facets/kernel/tap_rb.html +0 -92
  275. data/doc/rdoc/core/files/lib/core/facets/kernel/try_rb.html +0 -92
  276. data/doc/rdoc/core/files/lib/core/facets/kernel/val_rb.html +0 -92
  277. data/doc/rdoc/core/files/lib/core/facets/kernel/with_rb.html +0 -92
  278. data/doc/rdoc/core/files/lib/core/facets/kernel_rb.html +0 -92
  279. data/doc/rdoc/core/files/lib/core/facets/lazy_rb.html +0 -120
  280. data/doc/rdoc/core/files/lib/core/facets/matchdata/match_rb.html +0 -92
  281. data/doc/rdoc/core/files/lib/core/facets/matchdata/matchset_rb.html +0 -92
  282. data/doc/rdoc/core/files/lib/core/facets/matchdata_rb.html +0 -92
  283. data/doc/rdoc/core/files/lib/core/facets/metaid_rb.html +0 -92
  284. data/doc/rdoc/core/files/lib/core/facets/module/abstract_rb.html +0 -92
  285. data/doc/rdoc/core/files/lib/core/facets/module/alias_accessor_rb.html +0 -92
  286. data/doc/rdoc/core/files/lib/core/facets/module/alias_method_chain_rb.html +0 -92
  287. data/doc/rdoc/core/files/lib/core/facets/module/alias_module_function_rb.html +0 -92
  288. data/doc/rdoc/core/files/lib/core/facets/module/ancestor_rb.html +0 -92
  289. data/doc/rdoc/core/files/lib/core/facets/module/basename_rb.html +0 -92
  290. data/doc/rdoc/core/files/lib/core/facets/module/can_rb.html +0 -92
  291. data/doc/rdoc/core/files/lib/core/facets/module/class_rb.html +0 -92
  292. data/doc/rdoc/core/files/lib/core/facets/module/conflict_rb.html +0 -92
  293. data/doc/rdoc/core/files/lib/core/facets/module/extend_rb.html +0 -92
  294. data/doc/rdoc/core/files/lib/core/facets/module/include_function_module_rb.html +0 -92
  295. data/doc/rdoc/core/files/lib/core/facets/module/instance_methods_rb.html +0 -92
  296. data/doc/rdoc/core/files/lib/core/facets/module/integrate_rb.html +0 -96
  297. data/doc/rdoc/core/files/lib/core/facets/module/is_rb.html +0 -92
  298. data/doc/rdoc/core/files/lib/core/facets/module/methodize_rb.html +0 -96
  299. data/doc/rdoc/core/files/lib/core/facets/module/modspace_rb.html +0 -92
  300. data/doc/rdoc/core/files/lib/core/facets/module/module_load_rb.html +0 -92
  301. data/doc/rdoc/core/files/lib/core/facets/module/nesting_rb.html +0 -92
  302. data/doc/rdoc/core/files/lib/core/facets/module/op_rb.html +0 -92
  303. data/doc/rdoc/core/files/lib/core/facets/module/pathize_rb.html +0 -96
  304. data/doc/rdoc/core/files/lib/core/facets/module/prepend_rb.html +0 -92
  305. data/doc/rdoc/core/files/lib/core/facets/module/redefine_method_rb.html +0 -92
  306. data/doc/rdoc/core/files/lib/core/facets/module/redirect_method_rb.html +0 -92
  307. data/doc/rdoc/core/files/lib/core/facets/module/rename_method_rb.html +0 -92
  308. data/doc/rdoc/core/files/lib/core/facets/module/revise_rb.html +0 -99
  309. data/doc/rdoc/core/files/lib/core/facets/module/spacename_rb.html +0 -92
  310. data/doc/rdoc/core/files/lib/core/facets/module/wrap_method_rb.html +0 -92
  311. data/doc/rdoc/core/files/lib/core/facets/module_rb.html +0 -92
  312. data/doc/rdoc/core/files/lib/core/facets/nilclass/ergo_rb.html +0 -96
  313. data/doc/rdoc/core/files/lib/core/facets/nilclass/to_f_rb.html +0 -92
  314. data/doc/rdoc/core/files/lib/core/facets/nilclass_rb.html +0 -92
  315. data/doc/rdoc/core/files/lib/core/facets/numeric/approx_rb.html +0 -92
  316. data/doc/rdoc/core/files/lib/core/facets/numeric/distance_rb.html +0 -92
  317. data/doc/rdoc/core/files/lib/core/facets/numeric/round_rb.html +0 -92
  318. data/doc/rdoc/core/files/lib/core/facets/numeric_rb.html +0 -92
  319. data/doc/rdoc/core/files/lib/core/facets/objectspace/classes_rb.html +0 -92
  320. data/doc/rdoc/core/files/lib/core/facets/objectspace_rb.html +0 -92
  321. data/doc/rdoc/core/files/lib/core/facets/proc/bind_rb.html +0 -92
  322. data/doc/rdoc/core/files/lib/core/facets/proc/compose_rb.html +0 -92
  323. data/doc/rdoc/core/files/lib/core/facets/proc/curry_rb.html +0 -92
  324. data/doc/rdoc/core/files/lib/core/facets/proc/to_method_rb.html +0 -96
  325. data/doc/rdoc/core/files/lib/core/facets/proc/update_rb.html +0 -92
  326. data/doc/rdoc/core/files/lib/core/facets/proc_rb.html +0 -92
  327. data/doc/rdoc/core/files/lib/core/facets/range/combine_rb.html +0 -92
  328. data/doc/rdoc/core/files/lib/core/facets/range/overlap_rb.html +0 -92
  329. data/doc/rdoc/core/files/lib/core/facets/range/to_r_rb.html +0 -92
  330. data/doc/rdoc/core/files/lib/core/facets/range/umbrella_rb.html +0 -96
  331. data/doc/rdoc/core/files/lib/core/facets/range/within_rb.html +0 -92
  332. data/doc/rdoc/core/files/lib/core/facets/range_rb.html +0 -92
  333. data/doc/rdoc/core/files/lib/core/facets/regexp/arity_rb.html +0 -92
  334. data/doc/rdoc/core/files/lib/core/facets/regexp/to_re_rb.html +0 -92
  335. data/doc/rdoc/core/files/lib/core/facets/regexp_rb.html +0 -92
  336. data/doc/rdoc/core/files/lib/core/facets/stackable_rb.html +0 -120
  337. data/doc/rdoc/core/files/lib/core/facets/string/align_rb.html +0 -92
  338. data/doc/rdoc/core/files/lib/core/facets/string/bracket_rb.html +0 -92
  339. data/doc/rdoc/core/files/lib/core/facets/string/bytes_rb.html +0 -92
  340. data/doc/rdoc/core/files/lib/core/facets/string/camelcase_rb.html +0 -92
  341. data/doc/rdoc/core/files/lib/core/facets/string/capitalized_rb.html +0 -92
  342. data/doc/rdoc/core/files/lib/core/facets/string/chars_rb.html +0 -92
  343. data/doc/rdoc/core/files/lib/core/facets/string/chomp_rb.html +0 -92
  344. data/doc/rdoc/core/files/lib/core/facets/string/cleave_rb.html +0 -92
  345. data/doc/rdoc/core/files/lib/core/facets/string/compress_lines_rb.html +0 -92
  346. data/doc/rdoc/core/files/lib/core/facets/string/contains_rb.html +0 -92
  347. data/doc/rdoc/core/files/lib/core/facets/string/divide_rb.html +0 -92
  348. data/doc/rdoc/core/files/lib/core/facets/string/each_char_rb.html +0 -96
  349. data/doc/rdoc/core/files/lib/core/facets/string/each_word_rb.html +0 -96
  350. data/doc/rdoc/core/files/lib/core/facets/string/end_with_rb.html +0 -96
  351. data/doc/rdoc/core/files/lib/core/facets/string/expand_tab_rb.html +0 -92
  352. data/doc/rdoc/core/files/lib/core/facets/string/file_rb.html +0 -96
  353. data/doc/rdoc/core/files/lib/core/facets/string/fold_rb.html +0 -92
  354. data/doc/rdoc/core/files/lib/core/facets/string/indent_rb.html +0 -92
  355. data/doc/rdoc/core/files/lib/core/facets/string/interpolate_rb.html +0 -92
  356. data/doc/rdoc/core/files/lib/core/facets/string/line_wrap_rb.html +0 -92
  357. data/doc/rdoc/core/files/lib/core/facets/string/lines_rb.html +0 -92
  358. data/doc/rdoc/core/files/lib/core/facets/string/margin_rb.html +0 -92
  359. data/doc/rdoc/core/files/lib/core/facets/string/methodize_rb.html +0 -92
  360. data/doc/rdoc/core/files/lib/core/facets/string/modulize_rb.html +0 -92
  361. data/doc/rdoc/core/files/lib/core/facets/string/mscan_rb.html +0 -92
  362. data/doc/rdoc/core/files/lib/core/facets/string/natcmp_rb.html +0 -92
  363. data/doc/rdoc/core/files/lib/core/facets/string/nchar_rb.html +0 -92
  364. data/doc/rdoc/core/files/lib/core/facets/string/op_sub_rb.html +0 -92
  365. data/doc/rdoc/core/files/lib/core/facets/string/outdent_rb.html +0 -96
  366. data/doc/rdoc/core/files/lib/core/facets/string/pathize_rb.html +0 -92
  367. data/doc/rdoc/core/files/lib/core/facets/string/range_rb.html +0 -92
  368. data/doc/rdoc/core/files/lib/core/facets/string/rewrite_rb.html +0 -92
  369. data/doc/rdoc/core/files/lib/core/facets/string/shatter_rb.html +0 -92
  370. data/doc/rdoc/core/files/lib/core/facets/string/snakecase_rb.html +0 -92
  371. data/doc/rdoc/core/files/lib/core/facets/string/splice_rb.html +0 -92
  372. data/doc/rdoc/core/files/lib/core/facets/string/start_with_rb.html +0 -92
  373. data/doc/rdoc/core/files/lib/core/facets/string/subtract_rb.html +0 -100
  374. data/doc/rdoc/core/files/lib/core/facets/string/tab_rb.html +0 -99
  375. data/doc/rdoc/core/files/lib/core/facets/string/tabto_rb.html +0 -96
  376. data/doc/rdoc/core/files/lib/core/facets/string/titlecase_rb.html +0 -92
  377. data/doc/rdoc/core/files/lib/core/facets/string/to_re_rb.html +0 -92
  378. data/doc/rdoc/core/files/lib/core/facets/string/variablize_rb.html +0 -92
  379. data/doc/rdoc/core/files/lib/core/facets/string/word_wrap_rb.html +0 -92
  380. data/doc/rdoc/core/files/lib/core/facets/string/words_rb.html +0 -92
  381. data/doc/rdoc/core/files/lib/core/facets/string/xor_rb.html +0 -92
  382. data/doc/rdoc/core/files/lib/core/facets/string_rb.html +0 -92
  383. data/doc/rdoc/core/files/lib/core/facets/struct/attributes_rb.html +0 -92
  384. data/doc/rdoc/core/files/lib/core/facets/struct_rb.html +0 -92
  385. data/doc/rdoc/core/files/lib/core/facets/symbol/chomp_rb.html +0 -92
  386. data/doc/rdoc/core/files/lib/core/facets/symbol/generate_rb.html +0 -92
  387. data/doc/rdoc/core/files/lib/core/facets/symbol/not_rb.html +0 -92
  388. data/doc/rdoc/core/files/lib/core/facets/symbol/plain_rb.html +0 -92
  389. data/doc/rdoc/core/files/lib/core/facets/symbol/query_rb.html +0 -96
  390. data/doc/rdoc/core/files/lib/core/facets/symbol/re_s_rb.html +0 -96
  391. data/doc/rdoc/core/files/lib/core/facets/symbol/setter_rb.html +0 -96
  392. data/doc/rdoc/core/files/lib/core/facets/symbol/succ_rb.html +0 -92
  393. data/doc/rdoc/core/files/lib/core/facets/symbol/to_proc_rb.html +0 -92
  394. data/doc/rdoc/core/files/lib/core/facets/symbol/variablize_rb.html +0 -92
  395. data/doc/rdoc/core/files/lib/core/facets/symbol_rb.html +0 -92
  396. data/doc/rdoc/core/files/lib/core/facets/time/advance_rb.html +0 -92
  397. data/doc/rdoc/core/files/lib/core/facets/time/ago_rb.html +0 -96
  398. data/doc/rdoc/core/files/lib/core/facets/time/change_rb.html +0 -92
  399. data/doc/rdoc/core/files/lib/core/facets/time/elapse_rb.html +0 -92
  400. data/doc/rdoc/core/files/lib/core/facets/time/hence_rb.html +0 -96
  401. data/doc/rdoc/core/files/lib/core/facets/time/round_rb.html +0 -96
  402. data/doc/rdoc/core/files/lib/core/facets/time/set_rb.html +0 -92
  403. data/doc/rdoc/core/files/lib/core/facets/time/stamp_rb.html +0 -92
  404. data/doc/rdoc/core/files/lib/core/facets/time/to_time_rb.html +0 -92
  405. data/doc/rdoc/core/files/lib/core/facets/time/trunc_rb.html +0 -92
  406. data/doc/rdoc/core/files/lib/core/facets/time_rb.html +0 -92
  407. data/doc/rdoc/core/files/lib/core/facets/to_hash_rb.html +0 -97
  408. data/doc/rdoc/core/files/lib/core/facets/unboundmethod/arguments_rb.html +0 -92
  409. data/doc/rdoc/core/files/lib/core/facets/unboundmethod/name_rb.html +0 -92
  410. data/doc/rdoc/core/files/lib/core/facets/unboundmethod_rb.html +0 -92
  411. data/doc/rdoc/core/fr_class_index.html +0 -85
  412. data/doc/rdoc/core/fr_file_index.html +0 -381
  413. data/doc/rdoc/core/fr_method_index.html +0 -520
  414. data/doc/rdoc/core/index.html +0 -26
  415. data/doc/rdoc/core/rdoc-style.css +0 -177
  416. data/doc/rdoc/more/classes/ANSICode.html +0 -493
  417. data/doc/rdoc/more/classes/Advisable.html +0 -269
  418. data/doc/rdoc/more/classes/Advisable/Method.html +0 -223
  419. data/doc/rdoc/more/classes/Archive.html +0 -89
  420. data/doc/rdoc/more/classes/Archive/Tar.html +0 -89
  421. data/doc/rdoc/more/classes/Archive/Tar/Minitar.html +0 -469
  422. data/doc/rdoc/more/classes/Archive/Tar/Minitar/Input.html +0 -355
  423. data/doc/rdoc/more/classes/Archive/Tar/Minitar/Output.html +0 -216
  424. data/doc/rdoc/more/classes/Archive/Tar/Minitar/Reader.html +0 -283
  425. data/doc/rdoc/more/classes/Archive/Tar/Minitar/Writer.html +0 -378
  426. data/doc/rdoc/more/classes/Argvector.html +0 -487
  427. data/doc/rdoc/more/classes/Association.html +0 -319
  428. data/doc/rdoc/more/classes/Association/Kernel.html +0 -131
  429. data/doc/rdoc/more/classes/Autoarray.html +0 -166
  430. data/doc/rdoc/more/classes/BBCode.html +0 -532
  431. data/doc/rdoc/more/classes/BaseX.html +0 -194
  432. data/doc/rdoc/more/classes/BiCrypt.html +0 -541
  433. data/doc/rdoc/more/classes/BinReadable.html +0 -485
  434. data/doc/rdoc/more/classes/BinReadable/ByteOrder.html +0 -223
  435. data/doc/rdoc/more/classes/Binding.html +0 -146
  436. data/doc/rdoc/more/classes/BlankSlate.html +0 -129
  437. data/doc/rdoc/more/classes/Buildable.html +0 -152
  438. data/doc/rdoc/more/classes/BuildingBlock.html +0 -360
  439. data/doc/rdoc/more/classes/Capsule.html +0 -408
  440. data/doc/rdoc/more/classes/Capsule/MissingFile.html +0 -96
  441. data/doc/rdoc/more/classes/Cloneable.html +0 -129
  442. data/doc/rdoc/more/classes/ConsoleUtils.html +0 -238
  443. data/doc/rdoc/more/classes/Coroutine.html +0 -285
  444. data/doc/rdoc/more/classes/Crypt.html +0 -275
  445. data/doc/rdoc/more/classes/CssFilter.html +0 -471
  446. data/doc/rdoc/more/classes/CssTree.html +0 -149
  447. data/doc/rdoc/more/classes/Dictionary.html +0 -1255
  448. data/doc/rdoc/more/classes/Downloader.html +0 -512
  449. data/doc/rdoc/more/classes/Duration.html +0 -691
  450. data/doc/rdoc/more/classes/Duration/Numeric.html +0 -389
  451. data/doc/rdoc/more/classes/Duration/Time.html +0 -124
  452. data/doc/rdoc/more/classes/Enumerable.html +0 -401
  453. data/doc/rdoc/more/classes/Enumerable/Elementor.html +0 -170
  454. data/doc/rdoc/more/classes/Enumerable/Enumerator.html +0 -116
  455. data/doc/rdoc/more/classes/Enumerable/Filterable.html +0 -246
  456. data/doc/rdoc/more/classes/EnumerablePass.html +0 -214
  457. data/doc/rdoc/more/classes/Enumerator.html +0 -95
  458. data/doc/rdoc/more/classes/Enumerator/Filter.html +0 -104
  459. data/doc/rdoc/more/classes/Equatable.html +0 -188
  460. data/doc/rdoc/more/classes/Expirable.html +0 -195
  461. data/doc/rdoc/more/classes/FileList.html +0 -955
  462. data/doc/rdoc/more/classes/Fileable.html +0 -178
  463. data/doc/rdoc/more/classes/Fileable/DSL.html +0 -303
  464. data/doc/rdoc/more/classes/Hash.html +0 -171
  465. data/doc/rdoc/more/classes/Hash2Xml.html +0 -105
  466. data/doc/rdoc/more/classes/Hook.html +0 -162
  467. data/doc/rdoc/more/classes/HtmlFilter.html +0 -329
  468. data/doc/rdoc/more/classes/IORedirect.html +0 -220
  469. data/doc/rdoc/more/classes/InfinityClass.html +0 -448
  470. data/doc/rdoc/more/classes/InfinityClass/Numeric.html +0 -195
  471. data/doc/rdoc/more/classes/Ini.html +0 -447
  472. data/doc/rdoc/more/classes/Instantiable.html +0 -140
  473. data/doc/rdoc/more/classes/Instantize.html +0 -160
  474. data/doc/rdoc/more/classes/Interval.html +0 -877
  475. data/doc/rdoc/more/classes/It.html +0 -185
  476. data/doc/rdoc/more/classes/LRUCache.html +0 -321
  477. data/doc/rdoc/more/classes/LRUCache/Item.html +0 -114
  478. data/doc/rdoc/more/classes/LRUCache/Sentinel.html +0 -100
  479. data/doc/rdoc/more/classes/LinkedList.html +0 -432
  480. data/doc/rdoc/more/classes/LinkedList/Node.html +0 -149
  481. data/doc/rdoc/more/classes/Matcher.html +0 -335
  482. data/doc/rdoc/more/classes/Matcher/MatchData.html +0 -115
  483. data/doc/rdoc/more/classes/Memoizer.html +0 -240
  484. data/doc/rdoc/more/classes/MissingArgument.html +0 -97
  485. data/doc/rdoc/more/classes/Module.html +0 -1224
  486. data/doc/rdoc/more/classes/Multiton.html +0 -205
  487. data/doc/rdoc/more/classes/Multiton/Inclusive.html +0 -93
  488. data/doc/rdoc/more/classes/Multiton/MetaMethods.html +0 -221
  489. data/doc/rdoc/more/classes/NackClass.html +0 -98
  490. data/doc/rdoc/more/classes/Net.html +0 -88
  491. data/doc/rdoc/more/classes/Net/SMTP.html +0 -140
  492. data/doc/rdoc/more/classes/NullClass.html +0 -202
  493. data/doc/rdoc/more/classes/Numeric/Multipliers.html +0 -456
  494. data/doc/rdoc/more/classes/ObjectReflection.html +0 -172
  495. data/doc/rdoc/more/classes/OpEsc.html +0 -137
  496. data/doc/rdoc/more/classes/OpenCascade.html +0 -179
  497. data/doc/rdoc/more/classes/OpenCollection.html +0 -138
  498. data/doc/rdoc/more/classes/OpenHash.html +0 -157
  499. data/doc/rdoc/more/classes/OpenModule.html +0 -135
  500. data/doc/rdoc/more/classes/OpenObject.html +0 -608
  501. data/doc/rdoc/more/classes/OpenStructable.html +0 -326
  502. data/doc/rdoc/more/classes/PQueue.html +0 -607
  503. data/doc/rdoc/more/classes/Paramix.html +0 -201
  504. data/doc/rdoc/more/classes/Paramix/Delegator.html +0 -215
  505. data/doc/rdoc/more/classes/PathList.html +0 -159
  506. data/doc/rdoc/more/classes/PathList/Finder.html +0 -135
  507. data/doc/rdoc/more/classes/Platform.html +0 -444
  508. data/doc/rdoc/more/classes/Pool.html +0 -204
  509. data/doc/rdoc/more/classes/Proc.html +0 -180
  510. data/doc/rdoc/more/classes/ProgressBar.html +0 -356
  511. data/doc/rdoc/more/classes/Prototype.html +0 -243
  512. data/doc/rdoc/more/classes/RWDelegator.html +0 -194
  513. data/doc/rdoc/more/classes/Random.html +0 -145
  514. data/doc/rdoc/more/classes/Random/Array.html +0 -339
  515. data/doc/rdoc/more/classes/Random/Hash.html +0 -378
  516. data/doc/rdoc/more/classes/Random/Object.html +0 -119
  517. data/doc/rdoc/more/classes/Random/String.html +0 -299
  518. data/doc/rdoc/more/classes/Random/String/Self.html +0 -153
  519. data/doc/rdoc/more/classes/Recorder.html +0 -203
  520. data/doc/rdoc/more/classes/Reference.html +0 -196
  521. data/doc/rdoc/more/classes/Registerable.html +0 -157
  522. data/doc/rdoc/more/classes/Semaphore.html +0 -260
  523. data/doc/rdoc/more/classes/Settings.html +0 -288
  524. data/doc/rdoc/more/classes/Settings/Setting.html +0 -223
  525. data/doc/rdoc/more/classes/Settings/SettingCollection.html +0 -144
  526. data/doc/rdoc/more/classes/SimpleStringIO.html +0 -135
  527. data/doc/rdoc/more/classes/Snapshot.html +0 -194
  528. data/doc/rdoc/more/classes/Snapshot/ValueHolder.html +0 -163
  529. data/doc/rdoc/more/classes/SparseArray.html +0 -1397
  530. data/doc/rdoc/more/classes/Stash.html +0 -232
  531. data/doc/rdoc/more/classes/String/Mask.html +0 -555
  532. data/doc/rdoc/more/classes/String/Words.html +0 -328
  533. data/doc/rdoc/more/classes/Struct.html +0 -130
  534. data/doc/rdoc/more/classes/SyncArray.html +0 -127
  535. data/doc/rdoc/more/classes/SyncHash.html +0 -158
  536. data/doc/rdoc/more/classes/SyncHash/Delegator.html +0 -211
  537. data/doc/rdoc/more/classes/SyncHash/Inheritor.html +0 -211
  538. data/doc/rdoc/more/classes/System.html +0 -1117
  539. data/doc/rdoc/more/classes/Timer.html +0 -464
  540. data/doc/rdoc/more/classes/Timer/Dummy.html +0 -139
  541. data/doc/rdoc/more/classes/TracePoint.html +0 -455
  542. data/doc/rdoc/more/classes/Tuple.html +0 -900
  543. data/doc/rdoc/more/classes/TypeCast.html +0 -158
  544. data/doc/rdoc/more/classes/TypeCast/Class.html +0 -127
  545. data/doc/rdoc/more/classes/TypeCast/Object.html +0 -117
  546. data/doc/rdoc/more/classes/TypeCastException.html +0 -96
  547. data/doc/rdoc/more/classes/Uninheritable.html +0 -120
  548. data/doc/rdoc/more/classes/VersionNumber.html +0 -408
  549. data/doc/rdoc/more/classes/X.html +0 -117
  550. data/doc/rdoc/more/classes/XOXO.html +0 -189
  551. data/doc/rdoc/more/classes/ZipUtils.html +0 -568
  552. data/doc/rdoc/more/classes/ZipUtils/DryRun.html +0 -391
  553. data/doc/rdoc/more/classes/ZipUtils/NoWrite.html +0 -391
  554. data/doc/rdoc/more/classes/ZipUtils/Verbose.html +0 -361
  555. data/doc/rdoc/more/created.rid +0 -1
  556. data/doc/rdoc/more/files/README.html +0 -286
  557. data/doc/rdoc/more/files/doc/README_more.html +0 -141
  558. data/doc/rdoc/more/files/lib/more/facets/1stclassmethod_rb.html +0 -181
  559. data/doc/rdoc/more/files/lib/more/facets/advisable_rb.html +0 -124
  560. data/doc/rdoc/more/files/lib/more/facets/ansicode_rb.html +0 -200
  561. data/doc/rdoc/more/files/lib/more/facets/argvector_rb.html +0 -142
  562. data/doc/rdoc/more/files/lib/more/facets/association_rb.html +0 -158
  563. data/doc/rdoc/more/files/lib/more/facets/attr_rb.html +0 -92
  564. data/doc/rdoc/more/files/lib/more/facets/autoarray_rb.html +0 -125
  565. data/doc/rdoc/more/files/lib/more/facets/autoreload_rb.html +0 -134
  566. data/doc/rdoc/more/files/lib/more/facets/basex_rb.html +0 -92
  567. data/doc/rdoc/more/files/lib/more/facets/bbcode_rb.html +0 -138
  568. data/doc/rdoc/more/files/lib/more/facets/bicrypt_rb.html +0 -124
  569. data/doc/rdoc/more/files/lib/more/facets/binding/opvars_rb.html +0 -96
  570. data/doc/rdoc/more/files/lib/more/facets/binreadable_rb.html +0 -141
  571. data/doc/rdoc/more/files/lib/more/facets/blankslate_rb.html +0 -92
  572. data/doc/rdoc/more/files/lib/more/facets/buildable_rb.html +0 -230
  573. data/doc/rdoc/more/files/lib/more/facets/capsule_rb.html +0 -143
  574. data/doc/rdoc/more/files/lib/more/facets/class_extension_rb.html +0 -155
  575. data/doc/rdoc/more/files/lib/more/facets/classmethods_rb.html +0 -213
  576. data/doc/rdoc/more/files/lib/more/facets/cloneable_rb.html +0 -134
  577. data/doc/rdoc/more/files/lib/more/facets/consoleutils_rb.html +0 -92
  578. data/doc/rdoc/more/files/lib/more/facets/coroutine_rb.html +0 -163
  579. data/doc/rdoc/more/files/lib/more/facets/crypt_rb.html +0 -141
  580. data/doc/rdoc/more/files/lib/more/facets/cssfilter_rb.html +0 -121
  581. data/doc/rdoc/more/files/lib/more/facets/daemonize_rb.html +0 -118
  582. data/doc/rdoc/more/files/lib/more/facets/dependency_rb.html +0 -158
  583. data/doc/rdoc/more/files/lib/more/facets/dictionary_rb.html +0 -201
  584. data/doc/rdoc/more/files/lib/more/facets/downloader_rb.html +0 -137
  585. data/doc/rdoc/more/files/lib/more/facets/duplicable_rb.html +0 -100
  586. data/doc/rdoc/more/files/lib/more/facets/duration_rb.html +0 -92
  587. data/doc/rdoc/more/files/lib/more/facets/elementor_rb.html +0 -149
  588. data/doc/rdoc/more/files/lib/more/facets/elementwise_rb.html +0 -96
  589. data/doc/rdoc/more/files/lib/more/facets/enumerablepass_rb.html +0 -154
  590. data/doc/rdoc/more/files/lib/more/facets/equatable_rb.html +0 -146
  591. data/doc/rdoc/more/files/lib/more/facets/expirable_rb.html +0 -116
  592. data/doc/rdoc/more/files/lib/more/facets/fileable_rb.html +0 -138
  593. data/doc/rdoc/more/files/lib/more/facets/filelist_rb.html +0 -165
  594. data/doc/rdoc/more/files/lib/more/facets/filter_rb.html +0 -97
  595. data/doc/rdoc/more/files/lib/more/facets/heap_rb.html +0 -132
  596. data/doc/rdoc/more/files/lib/more/facets/hook_rb.html +0 -96
  597. data/doc/rdoc/more/files/lib/more/facets/htmlfilter_rb.html +0 -153
  598. data/doc/rdoc/more/files/lib/more/facets/infinity_rb.html +0 -153
  599. data/doc/rdoc/more/files/lib/more/facets/inheritor_rb.html +0 -124
  600. data/doc/rdoc/more/files/lib/more/facets/ini_rb.html +0 -105
  601. data/doc/rdoc/more/files/lib/more/facets/instantiable_rb.html +0 -119
  602. data/doc/rdoc/more/files/lib/more/facets/instantise_rb.html +0 -96
  603. data/doc/rdoc/more/files/lib/more/facets/instantize_rb.html +0 -160
  604. data/doc/rdoc/more/files/lib/more/facets/interval_rb.html +0 -163
  605. data/doc/rdoc/more/files/lib/more/facets/ioredirect_rb.html +0 -133
  606. data/doc/rdoc/more/files/lib/more/facets/iteration_rb.html +0 -94
  607. data/doc/rdoc/more/files/lib/more/facets/kernel/meta_rb.html +0 -96
  608. data/doc/rdoc/more/files/lib/more/facets/linkedlist_rb.html +0 -159
  609. data/doc/rdoc/more/files/lib/more/facets/lrucache_rb.html +0 -129
  610. data/doc/rdoc/more/files/lib/more/facets/main_rb.html +0 -126
  611. data/doc/rdoc/more/files/lib/more/facets/matcher_rb.html +0 -97
  612. data/doc/rdoc/more/files/lib/more/facets/memoize_rb.html +0 -164
  613. data/doc/rdoc/more/files/lib/more/facets/memoizer_rb.html +0 -152
  614. data/doc/rdoc/more/files/lib/more/facets/methodspace_rb.html +0 -138
  615. data/doc/rdoc/more/files/lib/more/facets/minitar_rb.html +0 -203
  616. data/doc/rdoc/more/files/lib/more/facets/multipliers_rb.html +0 -132
  617. data/doc/rdoc/more/files/lib/more/facets/multiton_rb.html +0 -187
  618. data/doc/rdoc/more/files/lib/more/facets/nackclass_rb.html +0 -120
  619. data/doc/rdoc/more/files/lib/more/facets/net/smtp_tls_rb.html +0 -143
  620. data/doc/rdoc/more/files/lib/more/facets/nilstatus_rb.html +0 -92
  621. data/doc/rdoc/more/files/lib/more/facets/nullclass_rb.html +0 -122
  622. data/doc/rdoc/more/files/lib/more/facets/opencascade_rb.html +0 -114
  623. data/doc/rdoc/more/files/lib/more/facets/opencollection_rb.html +0 -123
  624. data/doc/rdoc/more/files/lib/more/facets/openhash_rb.html +0 -107
  625. data/doc/rdoc/more/files/lib/more/facets/openmodule_rb.html +0 -92
  626. data/doc/rdoc/more/files/lib/more/facets/openobject_rb.html +0 -169
  627. data/doc/rdoc/more/files/lib/more/facets/opesc_rb.html +0 -94
  628. data/doc/rdoc/more/files/lib/more/facets/orderedhash_rb.html +0 -143
  629. data/doc/rdoc/more/files/lib/more/facets/ostructable_rb.html +0 -92
  630. data/doc/rdoc/more/files/lib/more/facets/overload_rb.html +0 -119
  631. data/doc/rdoc/more/files/lib/more/facets/paramix_rb.html +0 -135
  632. data/doc/rdoc/more/files/lib/more/facets/partial_rb.html +0 -124
  633. data/doc/rdoc/more/files/lib/more/facets/pathlist_rb.html +0 -133
  634. data/doc/rdoc/more/files/lib/more/facets/platform_rb.html +0 -103
  635. data/doc/rdoc/more/files/lib/more/facets/pool_rb.html +0 -131
  636. data/doc/rdoc/more/files/lib/more/facets/pqueue_rb.html +0 -128
  637. data/doc/rdoc/more/files/lib/more/facets/progressbar_rb.html +0 -126
  638. data/doc/rdoc/more/files/lib/more/facets/prototype_rb.html +0 -102
  639. data/doc/rdoc/more/files/lib/more/facets/random_rb.html +0 -149
  640. data/doc/rdoc/more/files/lib/more/facets/rbsystem_rb.html +0 -144
  641. data/doc/rdoc/more/files/lib/more/facets/recorder_rb.html +0 -154
  642. data/doc/rdoc/more/files/lib/more/facets/reference_rb.html +0 -130
  643. data/doc/rdoc/more/files/lib/more/facets/reflection_rb.html +0 -134
  644. data/doc/rdoc/more/files/lib/more/facets/registerable_rb.html +0 -98
  645. data/doc/rdoc/more/files/lib/more/facets/rwdelegator_rb.html +0 -122
  646. data/doc/rdoc/more/files/lib/more/facets/semaphore_rb.html +0 -120
  647. data/doc/rdoc/more/files/lib/more/facets/settings_rb.html +0 -141
  648. data/doc/rdoc/more/files/lib/more/facets/snapshot_rb.html +0 -177
  649. data/doc/rdoc/more/files/lib/more/facets/sparse_array_rb.html +0 -92
  650. data/doc/rdoc/more/files/lib/more/facets/stash_rb.html +0 -166
  651. data/doc/rdoc/more/files/lib/more/facets/string/mask_rb.html +0 -96
  652. data/doc/rdoc/more/files/lib/more/facets/string/words_rb.html +0 -96
  653. data/doc/rdoc/more/files/lib/more/facets/succ_rb.html +0 -92
  654. data/doc/rdoc/more/files/lib/more/facets/syncarray_rb.html +0 -125
  655. data/doc/rdoc/more/files/lib/more/facets/synchash_rb.html +0 -138
  656. data/doc/rdoc/more/files/lib/more/facets/thread_rb.html +0 -132
  657. data/doc/rdoc/more/files/lib/more/facets/timer_rb.html +0 -174
  658. data/doc/rdoc/more/files/lib/more/facets/tracepoint_rb.html +0 -172
  659. data/doc/rdoc/more/files/lib/more/facets/tuple_rb.html +0 -160
  660. data/doc/rdoc/more/files/lib/more/facets/typecast_rb.html +0 -215
  661. data/doc/rdoc/more/files/lib/more/facets/uninheritable_rb.html +0 -129
  662. data/doc/rdoc/more/files/lib/more/facets/version_rb.html +0 -132
  663. data/doc/rdoc/more/files/lib/more/facets/xmlhash_rb.html +0 -97
  664. data/doc/rdoc/more/files/lib/more/facets/xoxo_rb.html +0 -136
  665. data/doc/rdoc/more/files/lib/more/facets/ziputils_rb.html +0 -105
  666. data/doc/rdoc/more/fr_class_index.html +0 -185
  667. data/doc/rdoc/more/fr_file_index.html +0 -156
  668. data/doc/rdoc/more/fr_method_index.html +0 -1132
  669. data/doc/rdoc/more/index.html +0 -26
  670. data/doc/rdoc/more/rdoc-style.css +0 -177
  671. data/lib/core/facets/kernel/__here__.rb +0 -8
  672. data/lib/more/facets/buildable.rb +0 -344
  673. data/lib/more/facets/cssfilter.rb +0 -254
  674. data/lib/more/facets/htmlfilter.rb +0 -595
  675. data/lib/more/facets/kernel/meta.rb +0 -32
  676. data/lib/more/facets/prototype.rb +0 -88
  677. data/lib/more/facets/rwdelegator.rb +0 -74
@@ -1,2269 +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: Kernel</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 = "+"
36
- }
37
- else
38
- {
39
- elem.style.display = "block"
40
- link.innerHTML = "-"
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 />Kernel</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/metaid_rb.html">lib/core/facets/metaid.rb</a>
61
- <a href="../files/lib/core/facets/lazy_rb.html">lib/core/facets/lazy.rb</a>
62
- <a href="../files/lib/core/facets/boolean_rb.html">lib/core/facets/boolean.rb</a>
63
- <a href="../files/lib/core/facets/bitmask_rb.html">lib/core/facets/bitmask.rb</a>
64
- <a href="../files/lib/core/facets/kernel/here_rb.html">lib/core/facets/kernel/here.rb</a>
65
- <a href="../files/lib/core/facets/kernel/as_rb.html">lib/core/facets/kernel/as.rb</a>
66
- <a href="../files/lib/core/facets/kernel/__class___rb.html">lib/core/facets/kernel/__class__.rb</a>
67
- <a href="../files/lib/core/facets/kernel/ask_rb.html">lib/core/facets/kernel/ask.rb</a>
68
- <a href="../files/lib/core/facets/kernel/demo_rb.html">lib/core/facets/kernel/demo.rb</a>
69
- <a href="../files/lib/core/facets/kernel/maybe_rb.html">lib/core/facets/kernel/maybe.rb</a>
70
- <a href="../files/lib/core/facets/kernel/instance_send_rb.html">lib/core/facets/kernel/instance_send.rb</a>
71
- <a href="../files/lib/core/facets/kernel/object_hexid_rb.html">lib/core/facets/kernel/object_hexid.rb</a>
72
- <a href="../files/lib/core/facets/kernel/object_class_rb.html">lib/core/facets/kernel/object_class.rb</a>
73
- <a href="../files/lib/core/facets/kernel/tap_rb.html">lib/core/facets/kernel/tap.rb</a>
74
- <a href="../files/lib/core/facets/kernel/instance_rb.html">lib/core/facets/kernel/instance.rb</a>
75
- <a href="../files/lib/core/facets/kernel/object_send_rb.html">lib/core/facets/kernel/object_send.rb</a>
76
- <a href="../files/lib/core/facets/kernel/ergo_rb.html">lib/core/facets/kernel/ergo.rb</a>
77
- <a href="../files/lib/core/facets/kernel/complete_rb.html">lib/core/facets/kernel/complete.rb</a>
78
- <a href="../files/lib/core/facets/kernel/__get___rb.html">lib/core/facets/kernel/__get__.rb</a>
79
- <a href="../files/lib/core/facets/kernel/not_nil_rb.html">lib/core/facets/kernel/not_nil.rb</a>
80
- <a href="../files/lib/core/facets/kernel/deep_copy_rb.html">lib/core/facets/kernel/deep_copy.rb</a>
81
- <a href="../files/lib/core/facets/kernel/silence_rb.html">lib/core/facets/kernel/silence.rb</a>
82
- <a href="../files/lib/core/facets/kernel/require_all_rb.html">lib/core/facets/kernel/require_all.rb</a>
83
- <a href="../files/lib/core/facets/kernel/qua_class_rb.html">lib/core/facets/kernel/qua_class.rb</a>
84
- <a href="../files/lib/core/facets/kernel/resc_rb.html">lib/core/facets/kernel/resc.rb</a>
85
- <a href="../files/lib/core/facets/kernel/instance_variables_rb.html">lib/core/facets/kernel/instance_variables.rb</a>
86
- <a href="../files/lib/core/facets/kernel/instance_assign_rb.html">lib/core/facets/kernel/instance_assign.rb</a>
87
- <a href="../files/lib/core/facets/kernel/with_rb.html">lib/core/facets/kernel/with.rb</a>
88
- <a href="../files/lib/core/facets/kernel/d_rb.html">lib/core/facets/kernel/d.rb</a>
89
- <a href="../files/lib/core/facets/kernel/__method___rb.html">lib/core/facets/kernel/__method__.rb</a>
90
- <a href="../files/lib/core/facets/kernel/instance_class_rb.html">lib/core/facets/kernel/instance_class.rb</a>
91
- <a href="../files/lib/core/facets/kernel/__here___rb.html">lib/core/facets/kernel/__here__.rb</a>
92
- <a href="../files/lib/core/facets/kernel/attr_singleton_rb.html">lib/core/facets/kernel/attr_singleton.rb</a>
93
- <a href="../files/lib/core/facets/kernel/p_rb.html">lib/core/facets/kernel/p.rb</a>
94
- <a href="../files/lib/core/facets/kernel/singleton_class_rb.html">lib/core/facets/kernel/singleton_class.rb</a>
95
- <a href="../files/lib/core/facets/kernel/try_rb.html">lib/core/facets/kernel/try.rb</a>
96
- <a href="../files/lib/core/facets/kernel/__dir___rb.html">lib/core/facets/kernel/__dir__.rb</a>
97
- <a href="../files/lib/core/facets/kernel/returning_rb.html">lib/core/facets/kernel/returning.rb</a>
98
- <a href="../files/lib/core/facets/kernel/callstack_rb.html">lib/core/facets/kernel/callstack.rb</a>
99
- <a href="../files/lib/core/facets/kernel/populate_rb.html">lib/core/facets/kernel/populate.rb</a>
100
- <a href="../files/lib/core/facets/kernel/val_rb.html">lib/core/facets/kernel/val.rb</a>
101
- <a href="../files/lib/core/facets/kernel/constant_rb.html">lib/core/facets/kernel/constant.rb</a>
102
- <a href="../files/lib/core/facets/kernel/require_local_rb.html">lib/core/facets/kernel/require_local.rb</a>
103
- <a href="../files/lib/core/facets/kernel/respond_rb.html">lib/core/facets/kernel/respond.rb</a>
104
- <a href="../files/lib/core/facets/kernel/in_rb.html">lib/core/facets/kernel/in.rb</a>
105
- <a href="../files/lib/core/facets/blank_rb.html">lib/core/facets/blank.rb</a>
106
- </td>
107
- </tr>
108
- </table>
109
- </td>
110
- </tr>
111
- </table>
112
- <!-- banner header -->
113
-
114
- <div id="bodyContent">
115
- <div id="content">
116
-
117
-
118
-
119
-
120
- <div class="sectiontitle">Methods</div>
121
- <span style="padding-right: 5px;"><a href="#M000374">Bit</a></span>
122
- <span style="padding-right: 5px;"><a href="#M000414">__DIR__</a></span>
123
- <span style="padding-right: 5px;"><a href="#M000406">__HERE__</a></span>
124
- <span style="padding-right: 5px;"><a href="#M000375">as</a></span>
125
- <span style="padding-right: 5px;"><a href="#M000379">ask</a></span>
126
- <span style="padding-right: 5px;"><a href="#M000409">attr_singleton_accessor</a></span>
127
- <span style="padding-right: 5px;"><a href="#M000407">attr_singleton_reader</a></span>
128
- <span style="padding-right: 5px;"><a href="#M000408">attr_singleton_writer</a></span>
129
- <span style="padding-right: 5px;"><a href="#M000426">blank?</a></span>
130
- <span style="padding-right: 5px;"><a href="#M000373">bool?</a></span>
131
- <span style="padding-right: 5px;"><a href="#M000416">callstack</a></span>
132
- <span style="padding-right: 5px;"><a href="#M000387">complete</a></span>
133
- <span style="padding-right: 5px;"><a href="#M000420">constant</a></span>
134
- <span style="padding-right: 5px;"><a href="#M000404">d</a></span>
135
- <span style="padding-right: 5px;"><a href="#M000390">deep_copy</a></span>
136
- <span style="padding-right: 5px;"><a href="#M000368">demand</a></span>
137
- <span style="padding-right: 5px;"><a href="#M000380">demo</a></span>
138
- <span style="padding-right: 5px;"><a href="#M000366">eigenclass</a></span>
139
- <span style="padding-right: 5px;"><a href="#M000396">enable_warnings</a></span>
140
- <span style="padding-right: 5px;"><a href="#M000386">ergo</a></span>
141
- <span style="padding-right: 5px;"><a href="#M000372">false?</a></span>
142
- <span style="padding-right: 5px;"><a href="#M000369">future</a></span>
143
- <span style="padding-right: 5px;"><a href="#M000425">in?</a></span>
144
- <span style="padding-right: 5px;"><a href="#M000384">instance</a></span>
145
- <span style="padding-right: 5px;"><a href="#M000402">instance_assign</a></span>
146
- <span style="padding-right: 5px;"><a href="#M000405">instance_class</a></span>
147
- <span style="padding-right: 5px;"><a href="#M000401">instance_values</a></span>
148
- <span style="padding-right: 5px;"><a href="#M000400">instance_vars</a></span>
149
- <span style="padding-right: 5px;"><a href="#M000422">load_local</a></span>
150
- <span style="padding-right: 5px;"><a href="#M000381">maybe</a></span>
151
- <span style="padding-right: 5px;"><a href="#M000361">meta_alias</a></span>
152
- <span style="padding-right: 5px;"><a href="#M000364">meta_class</a></span>
153
- <span style="padding-right: 5px;"><a href="#M000363">meta_def</a></span>
154
- <span style="padding-right: 5px;"><a href="#M000362">meta_eval</a></span>
155
- <span style="padding-right: 5px;"><a href="#M000365">metaclass</a></span>
156
- <span style="padding-right: 5px;"><a href="#M000389">non_nil?</a></span>
157
- <span style="padding-right: 5px;"><a href="#M000388">not_nil?</a></span>
158
- <span style="padding-right: 5px;"><a href="#M000382">object_hexid</a></span>
159
- <span style="padding-right: 5px;"><a href="#M000385">object_send</a></span>
160
- <span style="padding-right: 5px;"><a href="#M000410">p</a></span>
161
- <span style="padding-right: 5px;"><a href="#M000417">populate</a></span>
162
- <span style="padding-right: 5px;"><a href="#M000367">promise</a></span>
163
- <span style="padding-right: 5px;"><a href="#M000398">qua_class</a></span>
164
- <span style="padding-right: 5px;"><a href="#M000397">require_all</a></span>
165
- <span style="padding-right: 5px;"><a href="#M000421">require_local</a></span>
166
- <span style="padding-right: 5px;"><a href="#M000399">resc</a></span>
167
- <span style="padding-right: 5px;"><a href="#M000423">respond</a></span>
168
- <span style="padding-right: 5px;"><a href="#M000424">respond_with_value</a></span>
169
- <span style="padding-right: 5px;"><a href="#M000415">returning</a></span>
170
- <span style="padding-right: 5px;"><a href="#M000376">send_as</a></span>
171
- <span style="padding-right: 5px;"><a href="#M000418">set_from</a></span>
172
- <span style="padding-right: 5px;"><a href="#M000392">silence_stderr</a></span>
173
- <span style="padding-right: 5px;"><a href="#M000393">silence_stdout</a></span>
174
- <span style="padding-right: 5px;"><a href="#M000391">silence_stream</a></span>
175
- <span style="padding-right: 5px;"><a href="#M000395">silence_warnings</a></span>
176
- <span style="padding-right: 5px;"><a href="#M000394">silently</a></span>
177
- <span style="padding-right: 5px;"><a href="#M000412">singleton</a></span>
178
- <span style="padding-right: 5px;"><a href="#M000411">singleton_class</a></span>
179
- <span style="padding-right: 5px;"><a href="#M000378">super_as</a></span>
180
- <span style="padding-right: 5px;"><a href="#M000377">super_method</a></span>
181
- <span style="padding-right: 5px;"><a href="#M000383">tap</a></span>
182
- <span style="padding-right: 5px;"><a href="#M000370">to_b</a></span>
183
- <span style="padding-right: 5px;"><a href="#M000371">true?</a></span>
184
- <span style="padding-right: 5px;"><a href="#M000413">try</a></span>
185
- <span style="padding-right: 5px;"><a href="#M000419">val?</a></span>
186
- <span style="padding-right: 5px;"><a href="#M000403">with</a></span>
187
-
188
-
189
-
190
-
191
-
192
-
193
- <div class="sectiontitle">Public Instance methods</div>
194
- <div class="method">
195
- <div class="title">
196
- <a name="M000374"></a><b>Bit</b>(n)
197
- </div>
198
- <div class="description">
199
- <p>
200
- Create a single bit bitmask.
201
- </p>
202
- <pre>
203
- Bit(0) #=&gt; 1
204
- Bit(1) #=&gt; 2
205
- Bit(2) #=&gt; 4
206
- </pre>
207
- <p>
208
- This is equivalent to n-shift: &quot;1 &lt;&lt; n&quot;.
209
- </p>
210
- <p>
211
- CREDIT: Thomas Sawyer, George Moschovitis
212
- </p>
213
- </div>
214
- <div class="sourcecode">
215
- <p class="source-link">[ <a href="javascript:toggleSource('M000374_source')" id="l_M000374_source">+</a> ]</p>
216
- <div id="M000374_source" class="dyn-source">
217
- <pre>
218
- <span class="ruby-comment cmt"># File lib/core/facets/bitmask.rb, line 97</span>
219
- <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Bit</span>(<span class="ruby-identifier">n</span>)
220
- <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">n</span>)
221
- <span class="ruby-keyword kw">end</span>
222
- </pre>
223
- </div>
224
- </div>
225
- </div>
226
- <div class="method">
227
- <div class="title">
228
- <a name="M000414"></a><b>__DIR__</b>()
229
- </div>
230
- <div class="description">
231
- <p>
232
- Similar to <em>FILE</em> and <em>LINE</em>, <em>DIR</em> provides the
233
- directory path to the current executing script.
234
- </p>
235
- <p>
236
- CREDIT: Trans
237
- </p>
238
- </div>
239
- <div class="sourcecode">
240
- <p class="source-link">[ <a href="javascript:toggleSource('M000414_source')" id="l_M000414_source">+</a> ]</p>
241
- <div id="M000414_source" class="dyn-source">
242
- <pre>
243
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/__dir__.rb, line 8</span>
244
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">__DIR__</span>
245
- (<span class="ruby-regexp re">/^(.+)?:\d+/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">caller</span>[<span class="ruby-value">0</span>]) <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">$1</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</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="M000406"></a><b>__HERE__</b>()
254
- </div>
255
- <div class="sourcecode">
256
- <p class="source-link">[ <a href="javascript:toggleSource('M000406_source')" id="l_M000406_source">+</a> ]</p>
257
- <div id="M000406_source" class="dyn-source">
258
- <pre>
259
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/__here__.rb, line 3</span>
260
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">__HERE__</span>
261
- <span class="ruby-node">&quot;#{__FILE__}: #{__LINE__}&quot;</span>
262
- <span class="ruby-keyword kw">end</span>
263
- </pre>
264
- </div>
265
- </div>
266
- </div>
267
- <div class="method">
268
- <div class="title">
269
- <a name="M000375"></a><b>as</b>(ancestor, &amp;blk)
270
- </div>
271
- <div class="description">
272
- <p>
273
- Returns a As-functor that allows one to call any ancestor&#8216;s method
274
- directly of the given object.
275
- </p>
276
- <pre>
277
- class A
278
- def x ; 1 ; end
279
- end
280
-
281
- class B &lt; A
282
- def x ; 2 ; end
283
- end
284
-
285
- class C &lt; B
286
- def x ; as(A).x ; end
287
- end
288
-
289
- C.new.x #=&gt; 1
290
- </pre>
291
- </div>
292
- <div class="sourcecode">
293
- <p class="source-link">[ <a href="javascript:toggleSource('M000375_source')" id="l_M000375_source">+</a> ]</p>
294
- <div id="M000375_source" class="dyn-source">
295
- <pre>
296
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/as.rb, line 22</span>
297
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">as</span>(<span class="ruby-identifier">ancestor</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
298
- <span class="ruby-ivar">@__as</span> <span class="ruby-operator">||=</span> {}
299
- <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">r</span> = <span class="ruby-ivar">@__as</span>[<span class="ruby-identifier">ancestor</span>]
300
- <span class="ruby-identifier">r</span> = (<span class="ruby-ivar">@__as</span>[<span class="ruby-identifier">ancestor</span>] = <span class="ruby-constant">As</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">ancestor</span>))
301
- <span class="ruby-keyword kw">end</span>
302
- <span class="ruby-identifier">r</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
303
- <span class="ruby-comment cmt">#yield(r) if block_given?</span>
304
- <span class="ruby-identifier">r</span>
305
- <span class="ruby-keyword kw">end</span>
306
- </pre>
307
- </div>
308
- </div>
309
- </div>
310
- <div class="method">
311
- <div class="title">
312
- <a name="M000379"></a><b>ask</b>(question, answers=nil)
313
- </div>
314
- <div class="description">
315
- <p>
316
- Very simple convenience method to get a console reply.
317
- </p>
318
- <pre>
319
- ask &quot;Are you happy?&quot;, &quot;Yn&quot;
320
- </pre>
321
- <p>
322
- On the command line one would see.
323
- </p>
324
- <pre>
325
- $ Are you happy? [Yn]
326
- </pre>
327
- <p>
328
- Responding:
329
- </p>
330
- <pre>
331
- $ Are you happy? [Yn] Y &lt;ENTER&gt;
332
- </pre>
333
- <p>
334
- The <a href="Kernel.html#M000379">ask</a> method would return
335
- &quot;Y&quot;.
336
- </p>
337
- </div>
338
- <div class="sourcecode">
339
- <p class="source-link">[ <a href="javascript:toggleSource('M000379_source')" id="l_M000379_source">+</a> ]</p>
340
- <div id="M000379_source" class="dyn-source">
341
- <pre>
342
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/ask.rb, line 19</span>
343
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ask</span>(<span class="ruby-identifier">question</span>, <span class="ruby-identifier">answers</span>=<span class="ruby-keyword kw">nil</span>)
344
- <span class="ruby-identifier">$stdout</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{question}&quot;</span>
345
- <span class="ruby-identifier">$stdout</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; [#{answers}] &quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">answers</span>
346
- <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">inp</span> = <span class="ruby-identifier">$stdin</span>.<span class="ruby-identifier">gets</span> ; <span class="ruby-identifier">sleep</span> <span class="ruby-value">1</span> ; <span class="ruby-keyword kw">end</span>
347
- <span class="ruby-identifier">inp</span>.<span class="ruby-identifier">strip</span>
348
- <span class="ruby-keyword kw">end</span>
349
- </pre>
350
- </div>
351
- </div>
352
- </div>
353
- <div class="method">
354
- <div class="title">
355
- <a name="M000409"></a><b>attr_singleton_accessor</b>(*args)
356
- </div>
357
- <div class="description">
358
- <p>
359
- Takes an array or hash <a href="Kernel.html#M000403">with</a> default
360
- values and creates <a href="Kernel.html#M000412">singleton</a>
361
- attr_accessors for each.
362
- </p>
363
- <pre>
364
- attr_singleton_accessor { :x =&gt; 1, :y =&gt; 2 }
365
- @x #=&gt; 1
366
- @y #=&gt; 2
367
- self.x = 3
368
- self.y = 4
369
- self.x #=&gt; 3
370
- self.y #=&gt; 4
371
- </pre>
372
- <p>
373
- CREDIT: Trans
374
- </p>
375
- </div>
376
- <div class="sourcecode">
377
- <p class="source-link">[ <a href="javascript:toggleSource('M000409_source')" id="l_M000409_source">+</a> ]</p>
378
- <div id="M000409_source" class="dyn-source">
379
- <pre>
380
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/attr_singleton.rb, line 54</span>
381
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attr_singleton_accessor</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
382
- <span class="ruby-comment cmt">#h, a = *args.partition{|a| Hash===a}</span>
383
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">send</span>( <span class="ruby-identifier">:attr_accessor</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
384
- <span class="ruby-comment cmt">#(class &lt;&lt; self ; self ; end).send( :attr_accessor, *h.keys )</span>
385
- <span class="ruby-comment cmt">#h.each { |k,v| instance_variable_set(&quot;@#{k}&quot;, v) }</span>
386
- <span class="ruby-keyword kw">end</span>
387
- </pre>
388
- </div>
389
- </div>
390
- </div>
391
- <div class="method">
392
- <div class="title">
393
- <a name="M000407"></a><b>attr_singleton_reader</b>(*args)
394
- </div>
395
- <div class="description">
396
- <p>
397
- Takes an array or a hash <a href="Kernel.html#M000403">with</a> default
398
- values and creates <a href="Kernel.html#M000412">singleton</a> attr_readers
399
- for each.
400
- </p>
401
- <pre>
402
- attr_singleton_reader {:x =&gt; 1, :y =&gt; 2}
403
- @x #=&gt; 1
404
- @y #=&gt; 2
405
- self.x #=&gt; 1
406
- self.y #=&gt; 2
407
- </pre>
408
- <p>
409
- CREDIT: Trans
410
- </p>
411
- </div>
412
- <div class="sourcecode">
413
- <p class="source-link">[ <a href="javascript:toggleSource('M000407_source')" id="l_M000407_source">+</a> ]</p>
414
- <div id="M000407_source" class="dyn-source">
415
- <pre>
416
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/attr_singleton.rb, line 14</span>
417
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attr_singleton_reader</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
418
- <span class="ruby-comment cmt">#h, a = *args.partition{|a| Hash===a}</span>
419
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">send</span>( <span class="ruby-identifier">:attr_reader</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
420
- <span class="ruby-comment cmt">#(class &lt;&lt; self ; self ; end).send( :attr_reader, *h.keys )</span>
421
- <span class="ruby-comment cmt">#h.each { |k,v| instance_variable_set(&quot;@#{k}&quot;, v) }</span>
422
- <span class="ruby-keyword kw">end</span>
423
- </pre>
424
- </div>
425
- </div>
426
- </div>
427
- <div class="method">
428
- <div class="title">
429
- <a name="M000408"></a><b>attr_singleton_writer</b>(*args)
430
- </div>
431
- <div class="description">
432
- <p>
433
- Takes an array or a hash <a href="Kernel.html#M000403">with</a> default
434
- values and creates <a href="Kernel.html#M000412">singleton</a> attr_writers
435
- for each.
436
- </p>
437
- <pre>
438
- attr_singleton_writer { :x =&gt; 1, :y =&gt; 2 }
439
- @x #=&gt; 1
440
- @y #=&gt; 2
441
- self.x = 3
442
- self.y = 4
443
- @x #=&gt; 3
444
- @y #=&gt; 4
445
- </pre>
446
- <p>
447
- CREDIT: Trans
448
- </p>
449
- </div>
450
- <div class="sourcecode">
451
- <p class="source-link">[ <a href="javascript:toggleSource('M000408_source')" id="l_M000408_source">+</a> ]</p>
452
- <div id="M000408_source" class="dyn-source">
453
- <pre>
454
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/attr_singleton.rb, line 34</span>
455
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attr_singleton_writer</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
456
- <span class="ruby-comment cmt">#h, a = *args.partition{|a| Hash===a}</span>
457
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">self</span> ; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">send</span>( <span class="ruby-identifier">:attr_writer</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
458
- <span class="ruby-comment cmt">#(class &lt;&lt; self ; self ; end).send( :attr_writer, *h.keys )</span>
459
- <span class="ruby-comment cmt">#h.each { |k,v| instance_variable_set(&quot;@#{k}&quot;, v) }</span>
460
- <span class="ruby-keyword kw">end</span>
461
- </pre>
462
- </div>
463
- </div>
464
- </div>
465
- <div class="method">
466
- <div class="title">
467
- <a name="M000426"></a><b>blank?</b>()
468
- </div>
469
- <div class="description">
470
- <p>
471
- An object is blank if it&#8216;s nil, empty, or a whitespace string. For
472
- example, &quot;&quot;, &quot; &quot;, nil, [], and {} are blank.
473
- </p>
474
- <p>
475
- This simplifies
476
- </p>
477
- <pre>
478
- if !address.nil? &amp;&amp; !address.empty?
479
- </pre>
480
- <p>
481
- to
482
- </p>
483
- <pre>
484
- if !address.blank?
485
- </pre>
486
- </div>
487
- <div class="sourcecode">
488
- <p class="source-link">[ <a href="javascript:toggleSource('M000426_source')" id="l_M000426_source">+</a> ]</p>
489
- <div id="M000426_source" class="dyn-source">
490
- <pre>
491
- <span class="ruby-comment cmt"># File lib/core/facets/blank.rb, line 14</span>
492
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">blank?</span>
493
- <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:empty?</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">empty?</span> <span class="ruby-operator">:</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">self</span>
494
- <span class="ruby-keyword kw">end</span>
495
- </pre>
496
- </div>
497
- </div>
498
- </div>
499
- <div class="method">
500
- <div class="title">
501
- <a name="M000373"></a><b>bool?</b>()
502
- </div>
503
- <div class="description">
504
- <p>
505
- Returns true is an object is class <a href="TrueClass.html">TrueClass</a>
506
- or <a href="FalseClass.html">FalseClass</a>, otherwise false.
507
- </p>
508
- <pre>
509
- true.bool? #=&gt; true
510
- false.bool? #=&gt; true
511
- nil.bool? #=&gt; false
512
- </pre>
513
- </div>
514
- <div class="sourcecode">
515
- <p class="source-link">[ <a href="javascript:toggleSource('M000373_source')" id="l_M000373_source">+</a> ]</p>
516
- <div id="M000373_source" class="dyn-source">
517
- <pre>
518
- <span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 127</span>
519
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bool?</span>
520
- (<span class="ruby-keyword kw">true</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">or</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span>)
521
- <span class="ruby-keyword kw">end</span>
522
- </pre>
523
- </div>
524
- </div>
525
- </div>
526
- <div class="method">
527
- <div class="title">
528
- <a name="M000416"></a><b>callstack</b>( level = 1 )
529
- </div>
530
- <div class="description">
531
- <p>
532
- Parse a caller string and break it into its components, <a
533
- href="Kernel.html#M000415">returning</a> an array. Returns:
534
- </p>
535
- <ul>
536
- <li>file (<a href="String.html">String</a>)
537
-
538
- </li>
539
- <li>lineno (<a href="Integer.html">Integer</a>)
540
-
541
- </li>
542
- <li>method (<a href="Symbol.html">Symbol</a>)
543
-
544
- </li>
545
- </ul>
546
- <p>
547
- For example, from irb,
548
- </p>
549
- <pre>
550
- call_stack(1)
551
- </pre>
552
- <p>
553
- <em>produces</em>
554
- </p>
555
- <p>
556
- [[&quot;(irb)&quot;, 2, :irb_binding],
557
- </p>
558
- <pre>
559
- [&quot;/usr/lib/ruby/1.8/irb/workspace.rb&quot;, 52, :irb_binding],
560
- [&quot;/usr/lib/ruby/1.8/irb/workspace.rb&quot;, 52, nil]]
561
- </pre>
562
- <p>
563
- Note: If the user decides to redefine caller() to output data in a
564
- different format, <em>prior</em> to requiring this, then the results will
565
- be indeterminate.
566
- </p>
567
- <p>
568
- CREDIT: Trans
569
- </p>
570
- </div>
571
- <div class="sourcecode">
572
- <p class="source-link">[ <a href="javascript:toggleSource('M000416_source')" id="l_M000416_source">+</a> ]</p>
573
- <div id="M000416_source" class="dyn-source">
574
- <pre>
575
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/callstack.rb, line 27</span>
576
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">callstack</span>( <span class="ruby-identifier">level</span> = <span class="ruby-value">1</span> )
577
- <span class="ruby-identifier">call_str_array</span> = <span class="ruby-identifier">pp_callstack</span>(<span class="ruby-identifier">level</span>)
578
- <span class="ruby-identifier">stack</span> = []
579
- <span class="ruby-identifier">call_str_array</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">call_str</span><span class="ruby-operator">|</span>
580
- <span class="ruby-identifier">file</span>, <span class="ruby-identifier">lineno</span>, <span class="ruby-identifier">method</span> = <span class="ruby-identifier">call_str</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">':'</span>)
581
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">method</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/in `(.*)'/</span> <span class="ruby-keyword kw">then</span>
582
- <span class="ruby-identifier">method</span> = <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">intern</span>()
583
- <span class="ruby-keyword kw">end</span>
584
- <span class="ruby-identifier">stack</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">file</span>, <span class="ruby-identifier">lineno</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">method</span>]
585
- }
586
- <span class="ruby-identifier">stack</span>
587
- <span class="ruby-keyword kw">end</span>
588
- </pre>
589
- </div>
590
- </div>
591
- </div>
592
- <div class="method">
593
- <div class="title">
594
- <a name="M000387"></a><b>complete</b>() {|| ...}
595
- </div>
596
- <div class="description">
597
- <p>
598
- Repeat loop until it yeilds false or nil.
599
- </p>
600
- <pre>
601
- a = [3, 2, 1]
602
- complete do
603
- b &lt;&lt; a.pop
604
- end
605
- b #=&gt; [3, 2, 1, nil]
606
- </pre>
607
- <p>
608
- CREDIT: Trans
609
- </p>
610
- </div>
611
- <div class="sourcecode">
612
- <p class="source-link">[ <a href="javascript:toggleSource('M000387_source')" id="l_M000387_source">+</a> ]</p>
613
- <div id="M000387_source" class="dyn-source">
614
- <pre>
615
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/complete.rb, line 13</span>
616
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">complete</span>
617
- <span class="ruby-identifier">loop</span> { <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">yield</span> }
618
- <span class="ruby-keyword kw">end</span>
619
- </pre>
620
- </div>
621
- </div>
622
- </div>
623
- <div class="method">
624
- <div class="title">
625
- <a name="M000420"></a><b>constant</b>(const)
626
- </div>
627
- <div class="description">
628
- <p>
629
- This is similar to +Module#const_get+ but is accessible at all levels, and,
630
- unlike <tt>const_get</tt>, can handle module hierarchy.
631
- </p>
632
- <pre>
633
- constant(&quot;Fixnum&quot;) # -&gt; Fixnum
634
- constant(:Fixnum) # -&gt; Fixnum
635
-
636
- constant(&quot;Process::Sys&quot;) # -&gt; Process::Sys
637
- constant(&quot;Regexp::MULTILINE&quot;) # -&gt; 4
638
-
639
- require 'test/unit'
640
- Test.constant(&quot;Unit::Assertions&quot;) # -&gt; Test::Unit::Assertions
641
- Test.constant(&quot;::Test::Unit&quot;) # -&gt; Test::Unit
642
- </pre>
643
- <p>
644
- CREDIT: Trans
645
- </p>
646
- </div>
647
- <div class="sourcecode">
648
- <p class="source-link">[ <a href="javascript:toggleSource('M000420_source')" id="l_M000420_source">+</a> ]</p>
649
- <div id="M000420_source" class="dyn-source">
650
- <pre>
651
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/constant.rb, line 18</span>
652
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">constant</span>(<span class="ruby-identifier">const</span>)
653
- <span class="ruby-identifier">const</span> = <span class="ruby-identifier">const</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">dup</span>
654
- <span class="ruby-identifier">base</span> = <span class="ruby-identifier">const</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/^::/</span>, <span class="ruby-value str">''</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">Object</span> <span class="ruby-operator">:</span> ( <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Module</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span> )
655
- <span class="ruby-identifier">const</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/::/</span>).<span class="ruby-identifier">inject</span>(<span class="ruby-identifier">base</span>){ <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">name</span>) }
656
- <span class="ruby-keyword kw">end</span>
657
- </pre>
658
- </div>
659
- </div>
660
- </div>
661
- <div class="method">
662
- <div class="title">
663
- <a name="M000404"></a><b>d</b>(*x)
664
- </div>
665
- <div class="description">
666
- <p>
667
- Like <a href="Kernel.html#M000410">p</a> but gives file and line number.
668
- </p>
669
- <pre>
670
- d(&quot;hi&quot;)
671
- </pre>
672
- <p>
673
- produces
674
- </p>
675
- <pre>
676
- /home/dave/projects/foo.rb, 38
677
- &quot;hi&quot;
678
- </pre>
679
- <p>
680
- TODO: This is borderline &quot;prime&quot;. Keep here? Another copy of it
681
- exits in dtools.rb
682
- </p>
683
- </div>
684
- <div class="sourcecode">
685
- <p class="source-link">[ <a href="javascript:toggleSource('M000404_source')" id="l_M000404_source">+</a> ]</p>
686
- <div id="M000404_source" class="dyn-source">
687
- <pre>
688
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/d.rb, line 15</span>
689
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">d</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">x</span>)
690
- <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{__FILE__}, #{__LINE__}&quot;</span>
691
- <span class="ruby-identifier">x</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">inspect</span> } <span class="ruby-comment cmt">#p(*x)</span>
692
- <span class="ruby-identifier">x</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">last</span> <span class="ruby-comment cmt">#x.last</span>
693
- <span class="ruby-keyword kw">end</span>
694
- </pre>
695
- </div>
696
- </div>
697
- </div>
698
- <div class="method">
699
- <div class="title">
700
- <a name="M000390"></a><b>deep_copy</b>()
701
- </div>
702
- <div class="description">
703
- <p>
704
- Anything that can be marshaled can be copied in totality. This is also
705
- commonly called a <a href="Kernel.html#M000390">deep_copy</a>.
706
- </p>
707
- <pre>
708
- &quot;ABC&quot;.copy #=&gt; &quot;ABC&quot;
709
- </pre>
710
- </div>
711
- <div class="sourcecode">
712
- <p class="source-link">[ <a href="javascript:toggleSource('M000390_source')" id="l_M000390_source">+</a> ]</p>
713
- <div id="M000390_source" class="dyn-source">
714
- <pre>
715
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/deep_copy.rb, line 8</span>
716
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">deep_copy</span>
717
- <span class="ruby-constant">Marshal</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>(<span class="ruby-constant">Marshal</span><span class="ruby-operator">::</span><span class="ruby-identifier">dump</span>(<span class="ruby-keyword kw">self</span>))
718
- <span class="ruby-keyword kw">end</span>
719
- </pre>
720
- </div>
721
- </div>
722
- </div>
723
- <div class="method">
724
- <div class="title">
725
- <a name="M000368"></a><b>demand</b>( promise )
726
- </div>
727
- <div class="description">
728
- <p>
729
- Forces the result of a <a href="Kernel.html#M000367">promise</a> to be
730
- computed (if necessary) and returns the bare result object. Once evaluated,
731
- the result of the <a href="Kernel.html#M000367">promise</a> will be cached.
732
- Nested promises will be evaluated together, until the first non-<a
733
- href="Kernel.html#M000367">promise</a> result.
734
- </p>
735
- <p>
736
- If called on a value that is not a <a
737
- href="Kernel.html#M000367">promise</a>, it will simply return it.
738
- </p>
739
- </div>
740
- <div class="sourcecode">
741
- <p class="source-link">[ <a href="javascript:toggleSource('M000368_source')" id="l_M000368_source">+</a> ]</p>
742
- <div id="M000368_source" class="dyn-source">
743
- <pre>
744
- <span class="ruby-comment cmt"># File lib/core/facets/lazy.rb, line 219</span>
745
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">demand</span>( <span class="ruby-identifier">promise</span> )
746
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">promise</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:__result__</span>
747
- <span class="ruby-identifier">promise</span>.<span class="ruby-identifier">__result__</span>
748
- <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># not really a promise</span>
749
- <span class="ruby-identifier">promise</span>
750
- <span class="ruby-keyword kw">end</span>
751
- <span class="ruby-keyword kw">end</span>
752
- </pre>
753
- </div>
754
- </div>
755
- </div>
756
- <div class="method">
757
- <div class="title">
758
- <a name="M000380"></a><b>demo</b>(out=$stdout,&amp;block)
759
- </div>
760
- <div class="description">
761
- <p>
762
- For debugging and showing examples. Currently this takes an argument of a
763
- string in a block.
764
- </p>
765
- <pre>
766
- demo {%{ a = [1,2,3] }}
767
- demo {%{ a.slice(1,2) }}
768
- demo {%{ a.map { |x| x**3 } }}
769
- </pre>
770
- <p>
771
- Produces:
772
- </p>
773
- <pre>
774
- a = [1,2,3] #=&gt; [1, 2, 3]
775
- a.slice(1,2) #=&gt; [2, 3]
776
- a.map { |x| x**3 } #=&gt; [1, 8, 27]
777
- </pre>
778
- <p>
779
- TODO: Is there a way to do this without the eval string in block?
780
- Preferably just a block and no string.
781
- </p>
782
- </div>
783
- <div class="sourcecode">
784
- <p class="source-link">[ <a href="javascript:toggleSource('M000380_source')" id="l_M000380_source">+</a> ]</p>
785
- <div id="M000380_source" class="dyn-source">
786
- <pre>
787
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/demo.rb, line 19</span>
788
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">demo</span>(<span class="ruby-identifier">out</span>=<span class="ruby-identifier">$stdout</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
789
- <span class="ruby-identifier">out</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;%-25s#=&gt; %s\n&quot;</span>, <span class="ruby-identifier">expr</span> = <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>, <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-identifier">block</span>.<span class="ruby-identifier">binding</span>).<span class="ruby-identifier">inspect</span>)
790
- <span class="ruby-keyword kw">end</span>
791
- </pre>
792
- </div>
793
- </div>
794
- </div>
795
- <div class="method">
796
- <div class="title">
797
- <a name="M000366"></a><b>eigenclass</b>()
798
- </div>
799
- <div class="description">
800
- <p>
801
- During this trying time when no one can get their techie catchwords to
802
- stick to the refrigerator no matter how hard they slap it # <a
803
- href="Kernel.html#M000403">with</a> the enchanted magnetic spatula, it’s
804
- good to know that the contrived phrases really do fly, graceful and
805
- unclasped and bearing north toward chilled shrimp. I know what my
806
- Hallowe’en pumpkin is going to say.
807
- </p>
808
- <pre>
809
- -- why the lucky stiff
810
- </pre>
811
- <p>
812
- CREDIT: WhyTheLuckyStiff
813
- </p>
814
- </div>
815
- <div class="sourcecode">
816
- <p class="source-link">[ <a href="javascript:toggleSource('M000366_source')" id="l_M000366_source">+</a> ]</p>
817
- <div id="M000366_source" class="dyn-source">
818
- <pre>
819
- <span class="ruby-comment cmt"># File lib/core/facets/metaid.rb, line 69</span>
820
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eigenclass</span>
821
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>)
822
- <span class="ruby-keyword kw">end</span>
823
- </pre>
824
- </div>
825
- </div>
826
- </div>
827
- <div class="method">
828
- <div class="title">
829
- <a name="M000396"></a><b>enable_warnings</b>() {|| ...}
830
- </div>
831
- <div class="description">
832
- <p>
833
- Sets $VERBOSE to true for the duration of the block and back to its
834
- original value afterwards.
835
- </p>
836
- <p>
837
- CREDIT: David Heinemeier Hansson
838
- </p>
839
- </div>
840
- <div class="sourcecode">
841
- <p class="source-link">[ <a href="javascript:toggleSource('M000396_source')" id="l_M000396_source">+</a> ]</p>
842
- <div id="M000396_source" class="dyn-source">
843
- <pre>
844
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 67</span>
845
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">enable_warnings</span>
846
- <span class="ruby-identifier">old_verbose</span>, <span class="ruby-identifier">$VERBOSE</span> = <span class="ruby-identifier">$VERBOSE</span>, <span class="ruby-keyword kw">true</span>
847
- <span class="ruby-keyword kw">yield</span>
848
- <span class="ruby-keyword kw">ensure</span>
849
- <span class="ruby-identifier">$VERBOSE</span> = <span class="ruby-identifier">old_verbose</span>
850
- <span class="ruby-keyword kw">end</span>
851
- </pre>
852
- </div>
853
- </div>
854
- </div>
855
- <div class="method">
856
- <div class="title">
857
- <a name="M000386"></a><b>ergo</b>() {|self| ...}
858
- </div>
859
- <div class="description">
860
- <p>
861
- Yield self -or- return self.
862
- </p>
863
- <pre>
864
- &quot;a&quot;.ergo.upcase #=&gt; &quot;A&quot;
865
- nil.ergo.foobar #=&gt; nil
866
-
867
- &quot;a&quot;.ergo{ |o| o.upcase } #=&gt; &quot;A&quot;
868
- nil.ergo{ |o| o.foobar } #=&gt; nil
869
- </pre>
870
- <p>
871
- This is like <a href="Kernel.html#M000383">tap</a>, but <a
872
- href="Kernel.html#M000383">tap</a> yields self -and- returns self.
873
- </p>
874
- <p>
875
- CREDIT: Daniel DeLorme
876
- </p>
877
- </div>
878
- <div class="sourcecode">
879
- <p class="source-link">[ <a href="javascript:toggleSource('M000386_source')" id="l_M000386_source">+</a> ]</p>
880
- <div id="M000386_source" class="dyn-source">
881
- <pre>
882
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/ergo.rb, line 17</span>
883
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ergo</span> <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>
884
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
885
- <span class="ruby-identifier">b</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
886
- <span class="ruby-keyword kw">else</span>
887
- <span class="ruby-keyword kw">self</span>
888
- <span class="ruby-keyword kw">end</span>
889
- <span class="ruby-keyword kw">end</span>
890
- </pre>
891
- </div>
892
- </div>
893
- </div>
894
- <div class="method">
895
- <div class="title">
896
- <a name="M000372"></a><b>false?</b>()
897
- </div>
898
- <div class="description">
899
- <p>
900
- Returns true is an object is class <a
901
- href="FalseClass.html">FalseClass</a>, otherwise false.
902
- </p>
903
- <pre>
904
- true.false? #=&gt; false
905
- false.false? #=&gt; true
906
- nil.false? #=&gt; false
907
- </pre>
908
- </div>
909
- <div class="sourcecode">
910
- <p class="source-link">[ <a href="javascript:toggleSource('M000372_source')" id="l_M000372_source">+</a> ]</p>
911
- <div id="M000372_source" class="dyn-source">
912
- <pre>
913
- <span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 116</span>
914
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">false?</span>
915
- (<span class="ruby-keyword kw">false</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span>)
916
- <span class="ruby-keyword kw">end</span>
917
- </pre>
918
- </div>
919
- </div>
920
- </div>
921
- <div class="method">
922
- <div class="title">
923
- <a name="M000369"></a><b>future</b>( ) {|result| ...}
924
- </div>
925
- <div class="description">
926
- <p>
927
- Schedules a computation to be run asynchronously in a background thread and
928
- returns a <a href="Kernel.html#M000367">promise</a> for its result. An
929
- attempt to <a href="Kernel.html#M000368">demand</a> the result of the <a
930
- href="Kernel.html#M000367">promise</a> will block until the computation
931
- finishes.
932
- </p>
933
- <p>
934
- As <a href="Kernel.html#M000403">with</a> <a
935
- href="Kernel.html#M000367">Kernel.promise</a>, this passes the block a <a
936
- href="Kernel.html#M000367">promise</a> for its own result. Use wisely.
937
- </p>
938
- </div>
939
- <div class="sourcecode">
940
- <p class="source-link">[ <a href="javascript:toggleSource('M000369_source')" id="l_M000369_source">+</a> ]</p>
941
- <div id="M000369_source" class="dyn-source">
942
- <pre>
943
- <span class="ruby-comment cmt"># File lib/core/facets/lazy.rb, line 234</span>
944
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">future</span>( <span class="ruby-operator">&amp;</span><span class="ruby-identifier">computation</span> ) <span class="ruby-comment cmt">#:yields: result</span>
945
- <span class="ruby-constant">Lazy</span><span class="ruby-operator">::</span><span class="ruby-constant">Future</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">computation</span>)
946
- <span class="ruby-keyword kw">end</span>
947
- </pre>
948
- </div>
949
- </div>
950
- </div>
951
- <div class="method">
952
- <div class="title">
953
- <a name="M000425"></a><b>in?</b>(other)
954
- </div>
955
- <div class="description">
956
- <p>
957
- Is self included in other?
958
- </p>
959
- <pre>
960
- 5.in?(0..10) #=&gt; true
961
- 5.in?([0,1,2,3]) #=&gt; false
962
- </pre>
963
- </div>
964
- <div class="sourcecode">
965
- <p class="source-link">[ <a href="javascript:toggleSource('M000425_source')" id="l_M000425_source">+</a> ]</p>
966
- <div id="M000425_source" class="dyn-source">
967
- <pre>
968
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/in.rb, line 8</span>
969
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">in?</span>(<span class="ruby-identifier">other</span>)
970
- <span class="ruby-identifier">other</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-keyword kw">self</span>)
971
- <span class="ruby-keyword kw">end</span>
972
- </pre>
973
- </div>
974
- </div>
975
- </div>
976
- <div class="method">
977
- <div class="title">
978
- <a name="M000384"></a><b>instance</b>()
979
- </div>
980
- <div class="description">
981
- <p>
982
- Access internals of an object <a href="Kernel.html#M000375">as</a> if <a
983
- href="Kernel.html#M000403">with</a> private access.
984
- </p>
985
- <pre>
986
- class X
987
- metaclass.instance.attr_reader :x
988
- end
989
- </pre>
990
- </div>
991
- <div class="sourcecode">
992
- <p class="source-link">[ <a href="javascript:toggleSource('M000384_source')" id="l_M000384_source">+</a> ]</p>
993
- <div id="M000384_source" class="dyn-source">
994
- <pre>
995
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/instance.rb, line 12</span>
996
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance</span>
997
- <span class="ruby-ivar">@_instance_functor</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Functor</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">op</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
998
- <span class="ruby-identifier">send</span>(<span class="ruby-identifier">op</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
999
- <span class="ruby-keyword kw">end</span>
1000
- <span class="ruby-keyword kw">end</span>
1001
- </pre>
1002
- </div>
1003
- </div>
1004
- </div>
1005
- <div class="method">
1006
- <div class="title">
1007
- <a name="M000402"></a><b>instance_assign</b>(hash)
1008
- </div>
1009
- <div class="description">
1010
- <p>
1011
- Set <a href="Kernel.html#M000384">instance</a> variables using a hash.
1012
- </p>
1013
- <pre>
1014
- instance_assign('@a'=&gt;1, '@b'=&gt;2)
1015
- @a #=&gt; 1
1016
- @b #=&gt; 2
1017
- </pre>
1018
- <p>
1019
- WARNING: <a href="Kernel.html#M000402">instance_assign</a> will be
1020
- deprecated. Use instance_vars.update instead.
1021
- </p>
1022
- </div>
1023
- <div class="sourcecode">
1024
- <p class="source-link">[ <a href="javascript:toggleSource('M000402_source')" id="l_M000402_source">+</a> ]</p>
1025
- <div id="M000402_source" class="dyn-source">
1026
- <pre>
1027
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/instance_assign.rb, line 32</span>
1028
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_assign</span>(<span class="ruby-identifier">hash</span>)
1029
- <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
1030
- <span class="ruby-identifier">k</span> = <span class="ruby-node">&quot;@#{k}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/^@/</span>
1031
- <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>)
1032
- <span class="ruby-keyword kw">end</span>
1033
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>
1034
- <span class="ruby-keyword kw">end</span>
1035
- </pre>
1036
- </div>
1037
- </div>
1038
- </div>
1039
- <div class="method">
1040
- <div class="title">
1041
- <a name="M000405"></a><b>instance_class</b>(&amp;block)
1042
- </div>
1043
- <div class="description">
1044
- <p>
1045
- Easy access to an object qua class, otherwise known <a
1046
- href="Kernel.html#M000375">as</a> the object&#8216;s <a
1047
- href="Kernel.html#M000365">metaclass</a> or <a
1048
- href="Kernel.html#M000412">singleton</a> class. This implemnetation alwasy
1049
- returns the class, even if a block is provided to eval against it.
1050
- </p>
1051
- <pre>
1052
- It is what it is.
1053
- </pre>
1054
- <p>
1055
- CREDIT: Trans
1056
- </p>
1057
- </div>
1058
- <div class="sourcecode">
1059
- <p class="source-link">[ <a href="javascript:toggleSource('M000405_source')" id="l_M000405_source">+</a> ]</p>
1060
- <div id="M000405_source" class="dyn-source">
1061
- <pre>
1062
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/instance_class.rb, line 19</span>
1063
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_class</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1064
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">module_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span>
1065
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>)
1066
- <span class="ruby-keyword kw">end</span>
1067
- </pre>
1068
- </div>
1069
- </div>
1070
- </div>
1071
- <div class="method">
1072
- <div class="title">
1073
- <a name="M000401"></a><b>instance_values</b>()
1074
- </div>
1075
- <div class="description">
1076
- <p>
1077
- Return <a href="Kernel.html#M000384">instance</a> variable values in an
1078
- array.
1079
- </p>
1080
- <pre>
1081
- class X
1082
- def initialize(a,b)
1083
- @a, @b = a, b
1084
- end
1085
- end
1086
-
1087
- x = X.new(1,2)
1088
-
1089
- x.instance_values #=&gt; { &quot;a&quot;=&gt;1, &quot;b&quot;=&gt;2 }
1090
- </pre>
1091
- <p>
1092
- WARNING: <a href="Kernel.html#M000401">instance_values</a> will be
1093
- deprecated. Use instance_vars.to_hash instead.
1094
- </p>
1095
- </div>
1096
- <div class="sourcecode">
1097
- <p class="source-link">[ <a href="javascript:toggleSource('M000401_source')" id="l_M000401_source">+</a> ]</p>
1098
- <div id="M000401_source" class="dyn-source">
1099
- <pre>
1100
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/instance_assign.rb, line 17</span>
1101
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_values</span>
1102
- <span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">values</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
1103
- <span class="ruby-identifier">values</span>[<span class="ruby-identifier">name</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]] = <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">name</span>)
1104
- <span class="ruby-identifier">values</span>
1105
- <span class="ruby-keyword kw">end</span>
1106
- <span class="ruby-keyword kw">end</span>
1107
- </pre>
1108
- </div>
1109
- </div>
1110
- </div>
1111
- <div class="method">
1112
- <div class="title">
1113
- <a name="M000400"></a><b>instance_vars</b>()
1114
- </div>
1115
- <div class="sourcecode">
1116
- <p class="source-link">[ <a href="javascript:toggleSource('M000400_source')" id="l_M000400_source">+</a> ]</p>
1117
- <div id="M000400_source" class="dyn-source">
1118
- <pre>
1119
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/instance_variables.rb, line 3</span>
1120
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance_vars</span>
1121
- <span class="ruby-constant">InstanceVariables</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
1122
- <span class="ruby-keyword kw">end</span>
1123
- </pre>
1124
- </div>
1125
- </div>
1126
- </div>
1127
- <div class="method">
1128
- <div class="title">
1129
- <a name="M000422"></a><b>load_local</b>(fname, safe=nil)
1130
- </div>
1131
- <div class="description">
1132
- <p>
1133
- Load file from same dir <a href="Kernel.html#M000375">as</a> calling
1134
- script.
1135
- </p>
1136
- <pre>
1137
- load_local 'templib'
1138
- </pre>
1139
- </div>
1140
- <div class="sourcecode">
1141
- <p class="source-link">[ <a href="javascript:toggleSource('M000422_source')" id="l_M000422_source">+</a> ]</p>
1142
- <div id="M000422_source" class="dyn-source">
1143
- <pre>
1144
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/require_local.rb, line 17</span>
1145
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_local</span>(<span class="ruby-identifier">fname</span>, <span class="ruby-identifier">safe</span>=<span class="ruby-keyword kw">nil</span>)
1146
- <span class="ruby-comment cmt">#fdir = File.expand_path( File.dirname( caller[0] ) )</span>
1147
- <span class="ruby-identifier">fdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>( <span class="ruby-identifier">caller</span>[<span class="ruby-value">0</span>] )
1148
- <span class="ruby-identifier">load</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>( <span class="ruby-identifier">fdir</span>, <span class="ruby-identifier">fname</span> ), <span class="ruby-identifier">safe</span> )
1149
- <span class="ruby-keyword kw">end</span>
1150
- </pre>
1151
- </div>
1152
- </div>
1153
- </div>
1154
- <div class="method">
1155
- <div class="title">
1156
- <a name="M000381"></a><b>maybe</b>(chance = 0.5) {|if rand &lt; chance| ...}
1157
- </div>
1158
- <div class="description">
1159
- <p>
1160
- Random generator that returns true or false. Can also take a block that has
1161
- a 50/50 chance to being executed.
1162
- </p>
1163
- <pre>
1164
- maybe #=&gt; true
1165
- maybe #=&gt; false
1166
- </pre>
1167
- </div>
1168
- <div class="sourcecode">
1169
- <p class="source-link">[ <a href="javascript:toggleSource('M000381_source')" id="l_M000381_source">+</a> ]</p>
1170
- <div id="M000381_source" class="dyn-source">
1171
- <pre>
1172
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/maybe.rb, line 9</span>
1173
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">maybe</span>(<span class="ruby-identifier">chance</span> = <span class="ruby-value">0</span><span class="ruby-value">.5</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1174
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block</span> <span class="ruby-keyword kw">then</span>
1175
- <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rand</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">chance</span>
1176
- <span class="ruby-keyword kw">else</span>
1177
- <span class="ruby-identifier">rand</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">chance</span>
1178
- <span class="ruby-keyword kw">end</span>
1179
- <span class="ruby-keyword kw">end</span>
1180
- </pre>
1181
- </div>
1182
- </div>
1183
- </div>
1184
- <div class="method">
1185
- <div class="title">
1186
- <a name="M000361"></a><b>meta_alias</b>(*args)
1187
- </div>
1188
- <div class="description">
1189
- <p>
1190
- Alias a method defined in the <a href="Kernel.html#M000365">metaclass</a>
1191
- (ie. <a href="Kernel.html#M000412">singleton</a> class).
1192
- </p>
1193
- <pre>
1194
- def X.y?; &quot;y?&quot; ; end
1195
- X.meta_alias &quot;ynot?&quot;, &quot;y?&quot;
1196
- X.ynot? #=&gt; y?
1197
- </pre>
1198
- <p>
1199
- CREDIT: Trans
1200
- </p>
1201
- </div>
1202
- <div class="sourcecode">
1203
- <p class="source-link">[ <a href="javascript:toggleSource('M000361_source')" id="l_M000361_source">+</a> ]</p>
1204
- <div id="M000361_source" class="dyn-source">
1205
- <pre>
1206
- <span class="ruby-comment cmt"># File lib/core/facets/metaid.rb, line 11</span>
1207
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_alias</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
1208
- <span class="ruby-identifier">meta_class</span> <span class="ruby-keyword kw">do</span>
1209
- <span class="ruby-identifier">alias_method</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
1210
- <span class="ruby-keyword kw">end</span>
1211
- <span class="ruby-keyword kw">end</span>
1212
- </pre>
1213
- </div>
1214
- </div>
1215
- </div>
1216
- <div class="method">
1217
- <div class="title">
1218
- <a name="M000364"></a><b>meta_class</b>(&amp;block)
1219
- </div>
1220
- <div class="description">
1221
- <p>
1222
- Easy access to an object&#8216;s &quot;special&quot; class, otherwise known
1223
- <a href="Kernel.html#M000375">as</a> it&#8216;s <a
1224
- href="Kernel.html#M000365">metaclass</a> or <a
1225
- href="Kernel.html#M000412">singleton</a> class.
1226
- </p>
1227
- </div>
1228
- <div class="aka">
1229
- This method is also aliased as
1230
- <a href="Kernel.html#M000365">metaclass</a>
1231
- </div>
1232
- <div class="sourcecode">
1233
- <p class="source-link">[ <a href="javascript:toggleSource('M000364_source')" id="l_M000364_source">+</a> ]</p>
1234
- <div id="M000364_source" class="dyn-source">
1235
- <pre>
1236
- <span class="ruby-comment cmt"># File lib/core/facets/metaid.rb, line 47</span>
1237
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_class</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1238
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
1239
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">class_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1240
- <span class="ruby-keyword kw">else</span>
1241
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>)
1242
- <span class="ruby-keyword kw">end</span>
1243
- <span class="ruby-keyword kw">end</span>
1244
- </pre>
1245
- </div>
1246
- </div>
1247
- </div>
1248
- <div class="method">
1249
- <div class="title">
1250
- <a name="M000363"></a><b>meta_def</b>( name, &amp;block )
1251
- </div>
1252
- <div class="description">
1253
- <p>
1254
- Add method to a meta-class &#8212;i.e. a <a
1255
- href="Kernel.html#M000412">singleton</a> method.
1256
- </p>
1257
- <pre>
1258
- class X; end
1259
- X.meta_def(:x){&quot;x&quot;}
1260
- X.x #=&gt; &quot;x&quot;
1261
- </pre>
1262
- <p>
1263
- CREDIT: WhyTheLuckyStiff
1264
- </p>
1265
- </div>
1266
- <div class="sourcecode">
1267
- <p class="source-link">[ <a href="javascript:toggleSource('M000363_source')" id="l_M000363_source">+</a> ]</p>
1268
- <div id="M000363_source" class="dyn-source">
1269
- <pre>
1270
- <span class="ruby-comment cmt"># File lib/core/facets/metaid.rb, line 38</span>
1271
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_def</span>( <span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span> )
1272
- <span class="ruby-identifier">meta_class</span> <span class="ruby-keyword kw">do</span>
1273
- <span class="ruby-identifier">define_method</span>( <span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span> )
1274
- <span class="ruby-keyword kw">end</span>
1275
- <span class="ruby-keyword kw">end</span>
1276
- </pre>
1277
- </div>
1278
- </div>
1279
- </div>
1280
- <div class="method">
1281
- <div class="title">
1282
- <a name="M000362"></a><b>meta_eval</b>(str=nil, &amp;blk)
1283
- </div>
1284
- <div class="description">
1285
- <p>
1286
- Evaluate code in a <a href="Kernel.html#M000365">metaclass</a>. This is
1287
- equivalent to &#8216;meta_class.instance_eval&#8217;.
1288
- </p>
1289
- <p>
1290
- CREDIT: WhyTheLuckyStiff
1291
- </p>
1292
- </div>
1293
- <div class="sourcecode">
1294
- <p class="source-link">[ <a href="javascript:toggleSource('M000362_source')" id="l_M000362_source">+</a> ]</p>
1295
- <div id="M000362_source" class="dyn-source">
1296
- <pre>
1297
- <span class="ruby-comment cmt"># File lib/core/facets/metaid.rb, line 22</span>
1298
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_eval</span>(<span class="ruby-identifier">str</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
1299
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">str</span>
1300
- <span class="ruby-identifier">meta_class</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-identifier">str</span>)
1301
- <span class="ruby-keyword kw">else</span>
1302
- <span class="ruby-identifier">meta_class</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
1303
- <span class="ruby-keyword kw">end</span>
1304
- <span class="ruby-keyword kw">end</span>
1305
- </pre>
1306
- </div>
1307
- </div>
1308
- </div>
1309
- <div class="method">
1310
- <div class="title">
1311
- <a name="M000365"></a><b>metaclass</b>(&amp;block)
1312
- </div>
1313
- <div class="description">
1314
- <p>
1315
- Alias for <a href="Kernel.html#M000364">meta_class</a>
1316
- </p>
1317
- </div>
1318
- </div>
1319
- <div class="method">
1320
- <div class="title">
1321
- <a name="M000389"></a><b>non_nil?</b>()
1322
- </div>
1323
- <div class="description">
1324
- <p>
1325
- Alias for not_nil?
1326
- </p>
1327
- </div>
1328
- </div>
1329
- <div class="method">
1330
- <div class="title">
1331
- <a name="M000388"></a><b>not_nil?</b>()
1332
- </div>
1333
- <div class="description">
1334
- <p>
1335
- The opposite of nil?.
1336
- </p>
1337
- <pre>
1338
- &quot;hello&quot;.not_nil? # -&gt; true
1339
- nil.not_nil? # -&gt; false
1340
- </pre>
1341
- <p>
1342
- CREDIT: Gavin Sinclair
1343
- </p>
1344
- </div>
1345
- <div class="aka">
1346
- This method is also aliased as
1347
- <a href="Kernel.html#M000389">non_nil?</a>
1348
- </div>
1349
- <div class="sourcecode">
1350
- <p class="source-link">[ <a href="javascript:toggleSource('M000388_source')" id="l_M000388_source">+</a> ]</p>
1351
- <div id="M000388_source" class="dyn-source">
1352
- <pre>
1353
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/not_nil.rb, line 10</span>
1354
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">not_nil?</span>
1355
- <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">nil?</span>
1356
- <span class="ruby-keyword kw">end</span>
1357
- </pre>
1358
- </div>
1359
- </div>
1360
- </div>
1361
- <div class="method">
1362
- <div class="title">
1363
- <a name="M000382"></a><b>object_hexid</b>()
1364
- </div>
1365
- <div class="description">
1366
- <p>
1367
- Returns the object id <a href="Kernel.html#M000375">as</a> a string in
1368
- hexideciaml, which is how Ruby reports them <a
1369
- href="Kernel.html#M000403">with</a> inspect.
1370
- </p>
1371
- <pre>
1372
- &quot;ABC&quot;.object_hexid #=&gt; &quot;0x402d359c&quot;
1373
- </pre>
1374
- </div>
1375
- <div class="sourcecode">
1376
- <p class="source-link">[ <a href="javascript:toggleSource('M000382_source')" id="l_M000382_source">+</a> ]</p>
1377
- <div id="M000382_source" class="dyn-source">
1378
- <pre>
1379
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/object_hexid.rb, line 8</span>
1380
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">object_hexid</span>
1381
- <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;0x&quot;</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value str">'%.x'</span> <span class="ruby-operator">%</span> (<span class="ruby-value">2</span><span class="ruby-operator">*</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">__id__</span>)) <span class="ruby-comment cmt">#[1..-1]</span>
1382
- <span class="ruby-keyword kw">end</span>
1383
- </pre>
1384
- </div>
1385
- </div>
1386
- </div>
1387
- <div class="method">
1388
- <div class="title">
1389
- <a name="M000385"></a><b>object_send</b>(name,*args,&amp;blk)
1390
- </div>
1391
- <div class="description">
1392
- <p>
1393
- Send only to public methods.
1394
- </p>
1395
- <pre>
1396
- class X
1397
- private
1398
- def foo; end
1399
- end
1400
-
1401
- X.new.object_send(:foo)
1402
- =&gt; NoMethodError: private method `foo' called for #&lt;X:0xb7ac6ba8&gt;
1403
- </pre>
1404
- <p>
1405
- TODO: <a href="Kernel.html#M000385">object_send</a> needs to change for
1406
- 1.9.
1407
- </p>
1408
- <p>
1409
- CREDIT: Trans
1410
- </p>
1411
- </div>
1412
- <div class="sourcecode">
1413
- <p class="source-link">[ <a href="javascript:toggleSource('M000385_source')" id="l_M000385_source">+</a> ]</p>
1414
- <div id="M000385_source" class="dyn-source">
1415
- <pre>
1416
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/object_send.rb, line 20</span>
1417
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">object_send</span>(<span class="ruby-identifier">name</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
1418
- <span class="ruby-comment cmt">#instance_eval &quot;self.#{name}(*args)&quot;</span>
1419
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">name</span>)
1420
- <span class="ruby-identifier">send</span>(<span class="ruby-identifier">name</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
1421
- <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt">#if respond_to?(:method_missing)</span>
1422
- <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">name</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
1423
- <span class="ruby-comment cmt">#else</span>
1424
- <span class="ruby-comment cmt"># raise NoMethodError</span>
1425
- <span class="ruby-keyword kw">end</span>
1426
- <span class="ruby-keyword kw">end</span>
1427
- </pre>
1428
- </div>
1429
- </div>
1430
- </div>
1431
- <div class="method">
1432
- <div class="title">
1433
- <a name="M000410"></a><b>p</b>(*x)
1434
- </div>
1435
- <div class="description">
1436
- <p>
1437
- Alternate to standard <a href="Kernel.html#M000410">p</a> method that
1438
- outputs Kernel#inspect to stdout, but also passes through the orginal
1439
- argument(s).
1440
- </p>
1441
- <pre>
1442
- x = 1
1443
- r = 4 + q(1)
1444
- p r
1445
- </pre>
1446
- <p>
1447
- produces
1448
- </p>
1449
- <pre>
1450
- 1
1451
- 5
1452
- </pre>
1453
- <p>
1454
- TODO: DEPRECATE <a href="Kernel.html#M000375">as</a> of 1.9, <em>if</em> it
1455
- will do this.
1456
- </p>
1457
- </div>
1458
- <div class="sourcecode">
1459
- <p class="source-link">[ <a href="javascript:toggleSource('M000410_source')" id="l_M000410_source">+</a> ]</p>
1460
- <div id="M000410_source" class="dyn-source">
1461
- <pre>
1462
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/p.rb, line 18</span>
1463
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">p</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">x</span>)
1464
- <span class="ruby-identifier">x</span>.<span class="ruby-identifier">each</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">inspect</span> } <span class="ruby-comment cmt">#p(*x)</span>
1465
- <span class="ruby-identifier">x</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">last</span> <span class="ruby-comment cmt">#x.last</span>
1466
- <span class="ruby-keyword kw">end</span>
1467
- </pre>
1468
- </div>
1469
- </div>
1470
- </div>
1471
- <div class="method">
1472
- <div class="title">
1473
- <a name="M000417"></a><b>populate</b>(data=nil) {|| ...}
1474
- </div>
1475
- <div class="description">
1476
- <p>
1477
- Assign via accessor methods using a hash, associative array or block.
1478
- </p>
1479
- <pre>
1480
- object.populate( :a =&gt; 1, :b =&gt; 2 )
1481
- object.populate( :a, 1, :b, 2 )
1482
- object.populate( [:a, 1], [:b, 2] )
1483
- object.populate( *[[:a, 1], [:b, 2]] )
1484
- object.populate{ |s| s.a = 1; s.b = 2 }
1485
- </pre>
1486
- <p>
1487
- These are all the same <a href="Kernel.html#M000375">as</a> doing:
1488
- </p>
1489
- <pre>
1490
- object.a = 1
1491
- object.b = 2
1492
- </pre>
1493
- <p>
1494
- Using an associative array instead of hash guarentees order of assignemnt.
1495
- </p>
1496
- <p>
1497
- Using a hash or array will not raise an error if the accessor does not
1498
- exits &#8212;it will simply be skipped.
1499
- </p>
1500
- <p>
1501
- TODO: Better name, set_with ?
1502
- </p>
1503
- </div>
1504
- <div class="sourcecode">
1505
- <p class="source-link">[ <a href="javascript:toggleSource('M000417_source')" id="l_M000417_source">+</a> ]</p>
1506
- <div id="M000417_source" class="dyn-source">
1507
- <pre>
1508
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/populate.rb, line 25</span>
1509
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">populate</span>(<span class="ruby-identifier">data</span>=<span class="ruby-keyword kw">nil</span>) <span class="ruby-comment cmt">#:yield:</span>
1510
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">data</span>
1511
- <span class="ruby-identifier">data</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
1512
- <span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{k}=&quot;</span>, <span class="ruby-identifier">v</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;#{k}=&quot;</span>)
1513
- <span class="ruby-keyword kw">end</span>
1514
- <span class="ruby-keyword kw">end</span>
1515
- <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
1516
- <span class="ruby-keyword kw">self</span>
1517
- <span class="ruby-keyword kw">end</span>
1518
- </pre>
1519
- </div>
1520
- </div>
1521
- </div>
1522
- <div class="method">
1523
- <div class="title">
1524
- <a name="M000367"></a><b>promise</b>( ) {|result| ...}
1525
- </div>
1526
- <div class="description">
1527
- <p>
1528
- The <a href="Kernel.html#M000367">promise</a>() function is used together
1529
- <a href="Kernel.html#M000403">with</a> <a
1530
- href="Kernel.html#M000368">demand</a>() to implement lazy evaluation. It
1531
- returns a <a href="Kernel.html#M000367">promise</a> to evaluate the
1532
- provided block at a <a href="Kernel.html#M000369">future</a> time.
1533
- Evaluation can be demanded and the block&#8216;s result obtained via the <a
1534
- href="Kernel.html#M000368">demand</a>() function.
1535
- </p>
1536
- <p>
1537
- Implicit evaluation is also supported: the first message sent to it will <a
1538
- href="Kernel.html#M000368">demand</a> evaluation, after which that message
1539
- and any subsequent messages will be forwarded to the result object.
1540
- </p>
1541
- <p>
1542
- As an aid to circular programming, the block will be passed a <a
1543
- href="Kernel.html#M000367">promise</a> for its own result when it is
1544
- evaluated. Be careful not to force that <a
1545
- href="Kernel.html#M000367">promise</a> during the computation, lest the
1546
- computation diverge.
1547
- </p>
1548
- </div>
1549
- <div class="sourcecode">
1550
- <p class="source-link">[ <a href="javascript:toggleSource('M000367_source')" id="l_M000367_source">+</a> ]</p>
1551
- <div id="M000367_source" class="dyn-source">
1552
- <pre>
1553
- <span class="ruby-comment cmt"># File lib/core/facets/lazy.rb, line 208</span>
1554
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">promise</span>( <span class="ruby-operator">&amp;</span><span class="ruby-identifier">computation</span> ) <span class="ruby-comment cmt">#:yields: result</span>
1555
- <span class="ruby-constant">Lazy</span><span class="ruby-operator">::</span><span class="ruby-constant">Promise</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">computation</span>)
1556
- <span class="ruby-keyword kw">end</span>
1557
- </pre>
1558
- </div>
1559
- </div>
1560
- </div>
1561
- <div class="method">
1562
- <div class="title">
1563
- <a name="M000398"></a><b>qua_class</b>(&amp;block)
1564
- </div>
1565
- <div class="description">
1566
- <p>
1567
- Easy access to an object qua class, otherwise known <a
1568
- href="Kernel.html#M000375">as</a> the object&#8216;s <a
1569
- href="Kernel.html#M000412">singleton</a> class.
1570
- </p>
1571
- <p>
1572
- Yes, another one.
1573
- </p>
1574
- <p>
1575
- CREDIT: Trans
1576
- </p>
1577
- </div>
1578
- <div class="sourcecode">
1579
- <p class="source-link">[ <a href="javascript:toggleSource('M000398_source')" id="l_M000398_source">+</a> ]</p>
1580
- <div id="M000398_source" class="dyn-source">
1581
- <pre>
1582
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/qua_class.rb, line 10</span>
1583
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">qua_class</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1584
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
1585
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">class_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
1586
- <span class="ruby-keyword kw">else</span>
1587
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>)
1588
- <span class="ruby-keyword kw">end</span>
1589
- <span class="ruby-keyword kw">end</span>
1590
- </pre>
1591
- </div>
1592
- </div>
1593
- </div>
1594
- <div class="method">
1595
- <div class="title">
1596
- <a name="M000397"></a><b>require_all</b>(pat)
1597
- </div>
1598
- <div class="description">
1599
- <p>
1600
- Require a pattern of files. This make is easy to require an entire
1601
- directory, for <a href="Kernel.html#M000384">instance</a>.
1602
- </p>
1603
- <pre>
1604
- require_all 'facets/time/*'
1605
- </pre>
1606
- </div>
1607
- <div class="sourcecode">
1608
- <p class="source-link">[ <a href="javascript:toggleSource('M000397_source')" id="l_M000397_source">+</a> ]</p>
1609
- <div id="M000397_source" class="dyn-source">
1610
- <pre>
1611
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/require_all.rb, line 8</span>
1612
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">require_all</span>(<span class="ruby-identifier">pat</span>)
1613
- <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
1614
- <span class="ruby-identifier">fs</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>,<span class="ruby-identifier">pat</span>)]
1615
- <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">fs</span>.<span class="ruby-identifier">empty?</span>
1616
- <span class="ruby-identifier">fs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
1617
- <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">require</span>( <span class="ruby-identifier">f</span> ) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>( <span class="ruby-identifier">f</span> )
1618
- }
1619
- <span class="ruby-keyword kw">break</span>;
1620
- <span class="ruby-keyword kw">end</span>
1621
- <span class="ruby-keyword kw">end</span>
1622
- <span class="ruby-keyword kw">end</span>
1623
- </pre>
1624
- </div>
1625
- </div>
1626
- </div>
1627
- <div class="method">
1628
- <div class="title">
1629
- <a name="M000421"></a><b>require_local</b>(fname)
1630
- </div>
1631
- <div class="description">
1632
- <p>
1633
- Require file from same dir <a href="Kernel.html#M000375">as</a> calling
1634
- script.
1635
- </p>
1636
- <pre>
1637
- require_local 'templib'
1638
- </pre>
1639
- </div>
1640
- <div class="sourcecode">
1641
- <p class="source-link">[ <a href="javascript:toggleSource('M000421_source')" id="l_M000421_source">+</a> ]</p>
1642
- <div id="M000421_source" class="dyn-source">
1643
- <pre>
1644
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/require_local.rb, line 7</span>
1645
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">require_local</span>(<span class="ruby-identifier">fname</span>)
1646
- <span class="ruby-comment cmt">#fdir = File.expand_path( File.dirname( caller[0] ) )</span>
1647
- <span class="ruby-identifier">fdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>( <span class="ruby-identifier">caller</span>[<span class="ruby-value">0</span>] )
1648
- <span class="ruby-identifier">require</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>( <span class="ruby-identifier">fdir</span>, <span class="ruby-identifier">fname</span> ) )
1649
- <span class="ruby-keyword kw">end</span>
1650
- </pre>
1651
- </div>
1652
- </div>
1653
- </div>
1654
- <div class="method">
1655
- <div class="title">
1656
- <a name="M000399"></a><b>resc</b>(str)
1657
- </div>
1658
- <div class="description">
1659
- <p>
1660
- Provides a shortcut to the Regexp.escape module method.
1661
- </p>
1662
- <pre>
1663
- resc(&quot;H..LO&quot;) #=&gt; &quot;H\\.\\.LO&quot;
1664
-
1665
- TODO: Should this be deprecated in favor of String#to_re/to_rx ?
1666
- </pre>
1667
- <p>
1668
- CREDIT: Trans
1669
- </p>
1670
- </div>
1671
- <div class="sourcecode">
1672
- <p class="source-link">[ <a href="javascript:toggleSource('M000399_source')" id="l_M000399_source">+</a> ]</p>
1673
- <div id="M000399_source" class="dyn-source">
1674
- <pre>
1675
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/resc.rb, line 11</span>
1676
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resc</span>(<span class="ruby-identifier">str</span>)
1677
- <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">escape</span>(<span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_s</span>)
1678
- <span class="ruby-keyword kw">end</span>
1679
- </pre>
1680
- </div>
1681
- </div>
1682
- </div>
1683
- <div class="method">
1684
- <div class="title">
1685
- <a name="M000423"></a><b>respond</b>(sym, *args)
1686
- </div>
1687
- <div class="description">
1688
- <p>
1689
- Like respond_to? but returns the result of the call if it does indeed <a
1690
- href="Kernel.html#M000423">respond</a>.
1691
- </p>
1692
- <pre>
1693
- class X
1694
- def f; &quot;f&quot;; end
1695
- end
1696
-
1697
- x = X.new
1698
- x.respond(:f) #=&gt; &quot;f&quot;
1699
- x.respond(:g) #=&gt; nil
1700
- </pre>
1701
- <p>
1702
- CREDIT: Trans
1703
- </p>
1704
- </div>
1705
- <div class="aka">
1706
- This method is also aliased as
1707
- <a href="Kernel.html#M000424">respond_with_value</a>
1708
- </div>
1709
- <div class="sourcecode">
1710
- <p class="source-link">[ <a href="javascript:toggleSource('M000423_source')" id="l_M000423_source">+</a> ]</p>
1711
- <div id="M000423_source" class="dyn-source">
1712
- <pre>
1713
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/respond.rb, line 16</span>
1714
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">respond</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
1715
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">sym</span>)
1716
- <span class="ruby-identifier">send</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
1717
- <span class="ruby-keyword kw">end</span>
1718
- </pre>
1719
- </div>
1720
- </div>
1721
- </div>
1722
- <div class="method">
1723
- <div class="title">
1724
- <a name="M000424"></a><b>respond_with_value</b>(sym, *args)
1725
- </div>
1726
- <div class="description">
1727
- <p>
1728
- Alias for <a href="Kernel.html#M000423">respond</a>
1729
- </p>
1730
- </div>
1731
- </div>
1732
- <div class="method">
1733
- <div class="title">
1734
- <a name="M000415"></a><b>returning</b>(obj=self) {|| ...}
1735
- </div>
1736
- <div class="description">
1737
- <p>
1738
- A Ruby-ized realization of the K combinator.
1739
- </p>
1740
- <pre>
1741
- returning Book.new do |book|
1742
- book.title = &quot;Imperium&quot;
1743
- book.author = &quot;Ulick Varange&quot;
1744
- end
1745
- </pre>
1746
- <p>
1747
- Technically, <a href="Kernel.html#M000415">returning</a> probably should
1748
- force the return of the stated object irregardless of any return statements
1749
- that might appear within it&#8216;s block. This might differentiate <a
1750
- href="Kernel.html#M000415">returning</a> from <a
1751
- href="Kernel.html#M000403">with</a>, however it also would require
1752
- implementation in Ruby itself.
1753
- </p>
1754
- <p>
1755
- CREDIT: Mikael Brockman
1756
- </p>
1757
- </div>
1758
- <div class="sourcecode">
1759
- <p class="source-link">[ <a href="javascript:toggleSource('M000415_source')" id="l_M000415_source">+</a> ]</p>
1760
- <div id="M000415_source" class="dyn-source">
1761
- <pre>
1762
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/returning.rb, line 18</span>
1763
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">returning</span>(<span class="ruby-identifier">obj</span>=<span class="ruby-keyword kw">self</span>) <span class="ruby-comment cmt">#:yield:</span>
1764
- <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">obj</span>
1765
- <span class="ruby-identifier">obj</span>
1766
- <span class="ruby-keyword kw">end</span>
1767
- </pre>
1768
- </div>
1769
- </div>
1770
- </div>
1771
- <div class="method">
1772
- <div class="title">
1773
- <a name="M000376"></a><b>send_as</b>(ancestor, sym, *args, &amp;blk)
1774
- </div>
1775
- <div class="description">
1776
- <p>
1777
- Call parent class/module methods once bound to self.
1778
- </p>
1779
- <p>
1780
- TODO: Does this have the proper scope for send?
1781
- </p>
1782
- </div>
1783
- <div class="sourcecode">
1784
- <p class="source-link">[ <a href="javascript:toggleSource('M000376_source')" id="l_M000376_source">+</a> ]</p>
1785
- <div id="M000376_source" class="dyn-source">
1786
- <pre>
1787
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/as.rb, line 36</span>
1788
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_as</span>(<span class="ruby-identifier">ancestor</span>, <span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
1789
- <span class="ruby-identifier">ancestor</span>.<span class="ruby-identifier">instance_method</span>(<span class="ruby-identifier">sym</span>).<span class="ruby-identifier">bind</span>(<span class="ruby-keyword kw">self</span>).<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
1790
- <span class="ruby-keyword kw">end</span>
1791
- </pre>
1792
- </div>
1793
- </div>
1794
- </div>
1795
- <div class="method">
1796
- <div class="title">
1797
- <a name="M000418"></a><b>set_from</b>(obj, *fields)
1798
- </div>
1799
- <div class="description">
1800
- <p>
1801
- Set setter methods using a another object.
1802
- </p>
1803
- <pre>
1804
- class X
1805
- attr_accessor :a, :b
1806
- def initialize( a, b )
1807
- @a,@b = a,b
1808
- end
1809
- end
1810
-
1811
- obj1 = X.new( 1, 2 )
1812
- obj2 = X.new
1813
-
1814
- obj2.set_from(obj1)
1815
-
1816
- obj2.a #=&gt; 1
1817
- obj2.b #=&gt; 2
1818
- </pre>
1819
- <p>
1820
- TODO: populate_from(obj) ?
1821
- </p>
1822
- </div>
1823
- <div class="sourcecode">
1824
- <p class="source-link">[ <a href="javascript:toggleSource('M000418_source')" id="l_M000418_source">+</a> ]</p>
1825
- <div id="M000418_source" class="dyn-source">
1826
- <pre>
1827
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/populate.rb, line 54</span>
1828
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_from</span>(<span class="ruby-identifier">obj</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">fields</span>)
1829
- <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">empty?</span>
1830
- <span class="ruby-identifier">fields</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
1831
- <span class="ruby-identifier">send</span>( <span class="ruby-node">&quot;#{k}=&quot;</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{k}&quot;</span>) ) <span class="ruby-comment cmt">#if self.respond_to?(&quot;#{k}=&quot;) &amp;&amp; obj.respond_to?(&quot;#{k}&quot;)</span>
1832
- <span class="ruby-keyword kw">end</span>
1833
- <span class="ruby-keyword kw">else</span>
1834
- <span class="ruby-identifier">setters</span> = <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-operator">=~</span> <span class="ruby-regexp re">/=$/</span> }
1835
- <span class="ruby-identifier">setters</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">setter</span><span class="ruby-operator">|</span>
1836
- <span class="ruby-identifier">getter</span> = <span class="ruby-identifier">setter</span>.<span class="ruby-identifier">chomp</span>(<span class="ruby-value str">'='</span>)
1837
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">getter</span>)
1838
- <span class="ruby-identifier">send</span>( <span class="ruby-identifier">setter</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">getter</span>) )
1839
- <span class="ruby-identifier">fields</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">getter</span>
1840
- <span class="ruby-keyword kw">end</span>
1841
- <span class="ruby-keyword kw">end</span>
1842
- <span class="ruby-keyword kw">end</span>
1843
- <span class="ruby-identifier">fields</span>
1844
- <span class="ruby-keyword kw">end</span>
1845
- </pre>
1846
- </div>
1847
- </div>
1848
- </div>
1849
- <div class="method">
1850
- <div class="title">
1851
- <a name="M000392"></a><b>silence_stderr</b>( {|| ...}
1852
- </div>
1853
- <div class="sourcecode">
1854
- <p class="source-link">[ <a href="javascript:toggleSource('M000392_source')" id="l_M000392_source">+</a> ]</p>
1855
- <div id="M000392_source" class="dyn-source">
1856
- <pre>
1857
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 27</span>
1858
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">silence_stderr</span> <span class="ruby-comment cmt">#:yeild:</span>
1859
- <span class="ruby-identifier">silence_stream</span>(<span class="ruby-constant">STDERR</span>) { <span class="ruby-keyword kw">yield</span> }
1860
- <span class="ruby-keyword kw">end</span>
1861
- </pre>
1862
- </div>
1863
- </div>
1864
- </div>
1865
- <div class="method">
1866
- <div class="title">
1867
- <a name="M000393"></a><b>silence_stdout</b>( {|| ...}
1868
- </div>
1869
- <div class="sourcecode">
1870
- <p class="source-link">[ <a href="javascript:toggleSource('M000393_source')" id="l_M000393_source">+</a> ]</p>
1871
- <div id="M000393_source" class="dyn-source">
1872
- <pre>
1873
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 32</span>
1874
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">silence_stdout</span> <span class="ruby-comment cmt">#:yeild:</span>
1875
- <span class="ruby-identifier">silence_stream</span>(<span class="ruby-constant">STDOUT</span>) { <span class="ruby-keyword kw">yield</span> }
1876
- <span class="ruby-keyword kw">end</span>
1877
- </pre>
1878
- </div>
1879
- </div>
1880
- </div>
1881
- <div class="method">
1882
- <div class="title">
1883
- <a name="M000391"></a><b>silence_stream</b>(*streams) {|| ...}
1884
- </div>
1885
- <div class="description">
1886
- <p>
1887
- Silences any stream for the duration of the block.
1888
- </p>
1889
- <pre>
1890
- silence_stream(STDOUT) do
1891
- puts 'This will never be seen'
1892
- end
1893
-
1894
- puts 'But this will'
1895
- </pre>
1896
- <p>
1897
- CREDIT: David Heinemeier Hansson
1898
- </p>
1899
- </div>
1900
- <div class="sourcecode">
1901
- <p class="source-link">[ <a href="javascript:toggleSource('M000391_source')" id="l_M000391_source">+</a> ]</p>
1902
- <div id="M000391_source" class="dyn-source">
1903
- <pre>
1904
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 13</span>
1905
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">silence_stream</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">streams</span>) <span class="ruby-comment cmt">#:yeild:</span>
1906
- <span class="ruby-identifier">on_hold</span> = <span class="ruby-identifier">streams</span>.<span class="ruby-identifier">collect</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">stream</span><span class="ruby-operator">|</span> <span class="ruby-identifier">stream</span>.<span class="ruby-identifier">dup</span> }
1907
- <span class="ruby-identifier">streams</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">stream</span><span class="ruby-operator">|</span>
1908
- <span class="ruby-identifier">stream</span>.<span class="ruby-identifier">reopen</span>(<span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/mswin/</span> <span class="ruby-operator">?</span> <span class="ruby-value str">'NUL:'</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'/dev/null'</span>)
1909
- <span class="ruby-identifier">stream</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
1910
- <span class="ruby-keyword kw">end</span>
1911
- <span class="ruby-keyword kw">yield</span>
1912
- <span class="ruby-keyword kw">ensure</span>
1913
- <span class="ruby-identifier">streams</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">stream</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
1914
- <span class="ruby-identifier">stream</span>.<span class="ruby-identifier">reopen</span>(<span class="ruby-identifier">on_hold</span>[<span class="ruby-identifier">i</span>])
1915
- <span class="ruby-keyword kw">end</span>
1916
- <span class="ruby-keyword kw">end</span>
1917
- </pre>
1918
- </div>
1919
- </div>
1920
- </div>
1921
- <div class="method">
1922
- <div class="title">
1923
- <a name="M000395"></a><b>silence_warnings</b>() {|| ...}
1924
- </div>
1925
- <div class="description">
1926
- <p>
1927
- Sets $VERBOSE to nil for the duration of the block and back to its original
1928
- value afterwards.
1929
- </p>
1930
- <pre>
1931
- silence_warnings do
1932
- value = noisy_call # no warning voiced
1933
- end
1934
-
1935
- noisy_call # no warning is voiced
1936
- </pre>
1937
- <p>
1938
- CREDIT: David Heinemeier Hansson
1939
- </p>
1940
- </div>
1941
- <div class="sourcecode">
1942
- <p class="source-link">[ <a href="javascript:toggleSource('M000395_source')" id="l_M000395_source">+</a> ]</p>
1943
- <div id="M000395_source" class="dyn-source">
1944
- <pre>
1945
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 55</span>
1946
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">silence_warnings</span>
1947
- <span class="ruby-identifier">old_verbose</span>, <span class="ruby-identifier">$VERBOSE</span> = <span class="ruby-identifier">$VERBOSE</span>, <span class="ruby-keyword kw">nil</span>
1948
- <span class="ruby-keyword kw">yield</span>
1949
- <span class="ruby-keyword kw">ensure</span>
1950
- <span class="ruby-identifier">$VERBOSE</span> = <span class="ruby-identifier">old_verbose</span>
1951
- <span class="ruby-keyword kw">end</span>
1952
- </pre>
1953
- </div>
1954
- </div>
1955
- </div>
1956
- <div class="method">
1957
- <div class="title">
1958
- <a name="M000394"></a><b>silently</b>(*streams) {|| ...}
1959
- </div>
1960
- <div class="description">
1961
- <p>
1962
- Just like <a href="Kernel.html#M000391">silence_stream</a>, but will
1963
- default to STDOUT, STDERR if no streams are given.
1964
- </p>
1965
- </div>
1966
- <div class="sourcecode">
1967
- <p class="source-link">[ <a href="javascript:toggleSource('M000394_source')" id="l_M000394_source">+</a> ]</p>
1968
- <div id="M000394_source" class="dyn-source">
1969
- <pre>
1970
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/silence.rb, line 39</span>
1971
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">silently</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">streams</span>) <span class="ruby-comment cmt">#:yeild:</span>
1972
- <span class="ruby-identifier">streams</span> = [<span class="ruby-constant">STDOUT</span>, <span class="ruby-constant">STDERR</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">streams</span>.<span class="ruby-identifier">empty?</span>
1973
- <span class="ruby-identifier">silence_stream</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">streams</span>){ <span class="ruby-keyword kw">yield</span> }
1974
- <span class="ruby-keyword kw">end</span>
1975
- </pre>
1976
- </div>
1977
- </div>
1978
- </div>
1979
- <div class="method">
1980
- <div class="title">
1981
- <a name="M000412"></a><b>singleton</b>(&amp;block)
1982
- </div>
1983
- <div class="description">
1984
- <p>
1985
- Alias for <a href="Kernel.html#M000411">singleton_class</a>
1986
- </p>
1987
- </div>
1988
- </div>
1989
- <div class="method">
1990
- <div class="title">
1991
- <a name="M000411"></a><b>singleton_class</b>(&amp;block)
1992
- </div>
1993
- <div class="description">
1994
- <p>
1995
- Easy access to an object&#8216;s &quot;special&quot; class,
1996
- </p>
1997
- <p>
1998
- One day these names must be reconciled!
1999
- </p>
2000
- </div>
2001
- <div class="aka">
2002
- This method is also aliased as
2003
- <a href="Kernel.html#M000412">singleton</a>
2004
- </div>
2005
- <div class="sourcecode">
2006
- <p class="source-link">[ <a href="javascript:toggleSource('M000411_source')" id="l_M000411_source">+</a> ]</p>
2007
- <div id="M000411_source" class="dyn-source">
2008
- <pre>
2009
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/singleton_class.rb, line 7</span>
2010
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">singleton_class</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
2011
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
2012
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">class_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
2013
- <span class="ruby-keyword kw">else</span>
2014
- (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>)
2015
- <span class="ruby-keyword kw">end</span>
2016
- <span class="ruby-keyword kw">end</span>
2017
- </pre>
2018
- </div>
2019
- </div>
2020
- </div>
2021
- <div class="method">
2022
- <div class="title">
2023
- <a name="M000378"></a><b>super_as</b>(klass=self.class.superclass, *args, &amp;blk)
2024
- </div>
2025
- <div class="description">
2026
- <p>
2027
- Like super but skips to a specific ancestor module or class.
2028
- </p>
2029
- <pre>
2030
- class A
2031
- def x ; 1 ; end
2032
- end
2033
-
2034
- class B &lt; A
2035
- def x ; 2 ; end
2036
- end
2037
-
2038
- class C &lt; B
2039
- def x ; super_as(A) ; end
2040
- end
2041
-
2042
- C.new.x #=&gt; 1
2043
- </pre>
2044
- </div>
2045
- <div class="sourcecode">
2046
- <p class="source-link">[ <a href="javascript:toggleSource('M000378_source')" id="l_M000378_source">+</a> ]</p>
2047
- <div id="M000378_source" class="dyn-source">
2048
- <pre>
2049
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/as.rb, line 73</span>
2050
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">super_as</span>(<span class="ruby-identifier">klass</span>=<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">superclass</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
2051
- <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ancestors</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">klass</span>)
2052
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>
2053
- <span class="ruby-keyword kw">end</span>
2054
- <span class="ruby-identifier">called</span> = <span class="ruby-regexp re">/\`([^\']+)\'/</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">caller</span>(<span class="ruby-value">1</span>).<span class="ruby-identifier">first</span>)[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_sym</span>
2055
- <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">instance_method</span>(<span class="ruby-identifier">called</span>).<span class="ruby-identifier">bind</span>(<span class="ruby-keyword kw">self</span>).<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
2056
- <span class="ruby-keyword kw">end</span>
2057
- </pre>
2058
- </div>
2059
- </div>
2060
- </div>
2061
- <div class="method">
2062
- <div class="title">
2063
- <a name="M000377"></a><b>super_method</b>(klass, meth)
2064
- </div>
2065
- <div class="description">
2066
- <p>
2067
- Returns method of a parent class bound to self.
2068
- </p>
2069
- </div>
2070
- <div class="sourcecode">
2071
- <p class="source-link">[ <a href="javascript:toggleSource('M000377_source')" id="l_M000377_source">+</a> ]</p>
2072
- <div id="M000377_source" class="dyn-source">
2073
- <pre>
2074
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/as.rb, line 50</span>
2075
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">super_method</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">meth</span>)
2076
- <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ancestors</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">klass</span>)
2077
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Not an ancestor for super_method-- #{klass}&quot;</span>
2078
- <span class="ruby-keyword kw">end</span>
2079
- <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">instance_method</span>(<span class="ruby-identifier">meth</span>).<span class="ruby-identifier">bind</span>(<span class="ruby-keyword kw">self</span>)
2080
- <span class="ruby-keyword kw">end</span>
2081
- </pre>
2082
- </div>
2083
- </div>
2084
- </div>
2085
- <div class="method">
2086
- <div class="title">
2087
- <a name="M000383"></a><b>tap</b>() {|self| ...}
2088
- </div>
2089
- <div class="description">
2090
- <p>
2091
- The <a href="Kernel.html#M000383">tap</a> K-Combinator. This yields self
2092
- -and- returns self.
2093
- </p>
2094
- </div>
2095
- <div class="sourcecode">
2096
- <p class="source-link">[ <a href="javascript:toggleSource('M000383_source')" id="l_M000383_source">+</a> ]</p>
2097
- <div id="M000383_source" class="dyn-source">
2098
- <pre>
2099
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/tap.rb, line 7</span>
2100
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tap</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
2101
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
2102
- <span class="ruby-identifier">b</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
2103
- <span class="ruby-keyword kw">end</span>
2104
- <span class="ruby-keyword kw">self</span>
2105
- <span class="ruby-keyword kw">end</span>
2106
- </pre>
2107
- </div>
2108
- </div>
2109
- </div>
2110
- <div class="method">
2111
- <div class="title">
2112
- <a name="M000370"></a><b>to_b</b>()
2113
- </div>
2114
- <div class="description">
2115
- <p>
2116
- Boolean conversion for not being nil or false. Other classes may redefine
2117
- this to suite the particular need.
2118
- </p>
2119
- <pre>
2120
- &quot;abc&quot;.to_b #=&gt; true
2121
- true.to_b #=&gt; true
2122
- false.to_b #=&gt; false
2123
- nil.to_b #=&gt; false
2124
- </pre>
2125
- </div>
2126
- <div class="sourcecode">
2127
- <p class="source-link">[ <a href="javascript:toggleSource('M000370_source')" id="l_M000370_source">+</a> ]</p>
2128
- <div id="M000370_source" class="dyn-source">
2129
- <pre>
2130
- <span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 94</span>
2131
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_b</span>
2132
- <span class="ruby-keyword kw">self</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
2133
- <span class="ruby-keyword kw">end</span>
2134
- </pre>
2135
- </div>
2136
- </div>
2137
- </div>
2138
- <div class="method">
2139
- <div class="title">
2140
- <a name="M000371"></a><b>true?</b>()
2141
- </div>
2142
- <div class="description">
2143
- <p>
2144
- Returns true is an object is class <a href="TrueClass.html">TrueClass</a>,
2145
- otherwise false.
2146
- </p>
2147
- <pre>
2148
- true.true? #=&gt; true
2149
- false.true? #=&gt; false
2150
- nil.true? #=&gt; false
2151
- </pre>
2152
- </div>
2153
- <div class="sourcecode">
2154
- <p class="source-link">[ <a href="javascript:toggleSource('M000371_source')" id="l_M000371_source">+</a> ]</p>
2155
- <div id="M000371_source" class="dyn-source">
2156
- <pre>
2157
- <span class="ruby-comment cmt"># File lib/core/facets/boolean.rb, line 105</span>
2158
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">true?</span>
2159
- (<span class="ruby-keyword kw">true</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span>)
2160
- <span class="ruby-keyword kw">end</span>
2161
- </pre>
2162
- </div>
2163
- </div>
2164
- </div>
2165
- <div class="method">
2166
- <div class="title">
2167
- <a name="M000413"></a><b>try</b>(method, default=nil)
2168
- </div>
2169
- <div class="description">
2170
- <p>
2171
- Try a method.
2172
- </p>
2173
- <pre>
2174
- @person ? @person.name : nil
2175
- </pre>
2176
- <p>
2177
- vs
2178
- </p>
2179
- <pre>
2180
- @person.try(:name)
2181
- </pre>
2182
- <p>
2183
- CREDIT: Chris Wanstrath
2184
- </p>
2185
- </div>
2186
- <div class="sourcecode">
2187
- <p class="source-link">[ <a href="javascript:toggleSource('M000413_source')" id="l_M000413_source">+</a> ]</p>
2188
- <div id="M000413_source" class="dyn-source">
2189
- <pre>
2190
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/try.rb, line 12</span>
2191
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">try</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">default</span>=<span class="ruby-keyword kw">nil</span>)
2192
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">method</span>
2193
- <span class="ruby-identifier">send</span> <span class="ruby-identifier">method</span>
2194
- <span class="ruby-keyword kw">else</span>
2195
- <span class="ruby-identifier">default</span>
2196
- <span class="ruby-keyword kw">end</span>
2197
- <span class="ruby-keyword kw">end</span>
2198
- </pre>
2199
- </div>
2200
- </div>
2201
- </div>
2202
- <div class="method">
2203
- <div class="title">
2204
- <a name="M000419"></a><b>val?</b>()
2205
- </div>
2206
- <div class="description">
2207
- <p>
2208
- Tests to see if something has value. An object is considered to have value
2209
- if it is not nil? and if it responds to empty?, is not empty.
2210
- </p>
2211
- <pre>
2212
- nil.val? #=&gt; false
2213
- [].val? #=&gt; false
2214
- 10.val? #=&gt; true
2215
- [nil].val? #=&gt; true
2216
- </pre>
2217
- </div>
2218
- <div class="sourcecode">
2219
- <p class="source-link">[ <a href="javascript:toggleSource('M000419_source')" id="l_M000419_source">+</a> ]</p>
2220
- <div id="M000419_source" class="dyn-source">
2221
- <pre>
2222
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/val.rb, line 12</span>
2223
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">val?</span>
2224
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">nil?</span>
2225
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">empty?</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:empty?</span>)
2226
- <span class="ruby-keyword kw">true</span>
2227
- <span class="ruby-keyword kw">end</span>
2228
- </pre>
2229
- </div>
2230
- </div>
2231
- </div>
2232
- <div class="method">
2233
- <div class="title">
2234
- <a name="M000403"></a><b>with</b>(obj=self, &amp;block)
2235
- </div>
2236
- <div class="description">
2237
- <p>
2238
- Like <a href="Kernel.html#M000415">returning</a> but exectures the block
2239
- via instance_eval.
2240
- </p>
2241
- <pre>
2242
- def foo
2243
- with values = [] do
2244
- self &lt;&lt; 'bar'
2245
- self &lt;&lt; 'baz'
2246
- end
2247
- end
2248
-
2249
- foo # =&gt; ['bar', 'baz']
2250
- </pre>
2251
- </div>
2252
- <div class="sourcecode">
2253
- <p class="source-link">[ <a href="javascript:toggleSource('M000403_source')" id="l_M000403_source">+</a> ]</p>
2254
- <div id="M000403_source" class="dyn-source">
2255
- <pre>
2256
- <span class="ruby-comment cmt"># File lib/core/facets/kernel/with.rb, line 15</span>
2257
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>(<span class="ruby-identifier">obj</span>=<span class="ruby-keyword kw">self</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
2258
- <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
2259
- <span class="ruby-keyword kw">end</span>
2260
- </pre>
2261
- </div>
2262
- </div>
2263
- </div>
2264
- </div>
2265
-
2266
- </div>
2267
-
2268
- </body>
2269
- </html>