immutable-ruby 0.0.4 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. checksums.yaml +4 -4
  2. data/lib/immutable/core_ext/enumerable.rb +1 -1
  3. data/lib/immutable/core_ext/io.rb +1 -1
  4. data/lib/immutable/core_ext.rb +2 -2
  5. data/lib/immutable/deque.rb +17 -17
  6. data/lib/immutable/enumerable.rb +10 -10
  7. data/lib/immutable/hash.rb +24 -24
  8. data/lib/immutable/list.rb +36 -36
  9. data/lib/immutable/nested.rb +8 -8
  10. data/lib/immutable/set.rb +30 -30
  11. data/lib/immutable/sorted_set.rb +30 -26
  12. data/lib/immutable/trie.rb +2 -2
  13. data/lib/immutable/vector.rb +40 -35
  14. data/lib/immutable/version.rb +1 -1
  15. data/lib/immutable.rb +9 -9
  16. metadata +36 -699
  17. data/lib/immutable/core_ext/struct.rb +0 -9
  18. data/spec/fixtures/io_spec.txt +0 -3
  19. data/spec/lib/immutable/core_ext/array_spec.rb +0 -13
  20. data/spec/lib/immutable/core_ext/enumerable_spec.rb +0 -29
  21. data/spec/lib/immutable/core_ext/io_spec.rb +0 -28
  22. data/spec/lib/immutable/deque/clear_spec.rb +0 -33
  23. data/spec/lib/immutable/deque/construction_spec.rb +0 -29
  24. data/spec/lib/immutable/deque/copying_spec.rb +0 -19
  25. data/spec/lib/immutable/deque/dequeue_spec.rb +0 -34
  26. data/spec/lib/immutable/deque/empty_spec.rb +0 -39
  27. data/spec/lib/immutable/deque/enqueue_spec.rb +0 -27
  28. data/spec/lib/immutable/deque/first_spec.rb +0 -17
  29. data/spec/lib/immutable/deque/inspect_spec.rb +0 -23
  30. data/spec/lib/immutable/deque/last_spec.rb +0 -17
  31. data/spec/lib/immutable/deque/marshal_spec.rb +0 -33
  32. data/spec/lib/immutable/deque/new_spec.rb +0 -43
  33. data/spec/lib/immutable/deque/pop_spec.rb +0 -36
  34. data/spec/lib/immutable/deque/pretty_print_spec.rb +0 -23
  35. data/spec/lib/immutable/deque/push_spec.rb +0 -36
  36. data/spec/lib/immutable/deque/random_modification_spec.rb +0 -33
  37. data/spec/lib/immutable/deque/rotate_spec.rb +0 -68
  38. data/spec/lib/immutable/deque/shift_spec.rb +0 -29
  39. data/spec/lib/immutable/deque/size_spec.rb +0 -19
  40. data/spec/lib/immutable/deque/to_a_spec.rb +0 -26
  41. data/spec/lib/immutable/deque/to_ary_spec.rb +0 -35
  42. data/spec/lib/immutable/deque/to_list_spec.rb +0 -24
  43. data/spec/lib/immutable/deque/unshift_spec.rb +0 -30
  44. data/spec/lib/immutable/hash/all_spec.rb +0 -53
  45. data/spec/lib/immutable/hash/any_spec.rb +0 -53
  46. data/spec/lib/immutable/hash/assoc_spec.rb +0 -51
  47. data/spec/lib/immutable/hash/clear_spec.rb +0 -42
  48. data/spec/lib/immutable/hash/construction_spec.rb +0 -38
  49. data/spec/lib/immutable/hash/copying_spec.rb +0 -13
  50. data/spec/lib/immutable/hash/default_proc_spec.rb +0 -72
  51. data/spec/lib/immutable/hash/delete_spec.rb +0 -39
  52. data/spec/lib/immutable/hash/dig_spec.rb +0 -34
  53. data/spec/lib/immutable/hash/each_spec.rb +0 -77
  54. data/spec/lib/immutable/hash/each_with_index_spec.rb +0 -29
  55. data/spec/lib/immutable/hash/empty_spec.rb +0 -43
  56. data/spec/lib/immutable/hash/eql_spec.rb +0 -75
  57. data/spec/lib/immutable/hash/except_spec.rb +0 -42
  58. data/spec/lib/immutable/hash/fetch_spec.rb +0 -57
  59. data/spec/lib/immutable/hash/fetch_values_spec.rb +0 -22
  60. data/spec/lib/immutable/hash/find_spec.rb +0 -43
  61. data/spec/lib/immutable/hash/flat_map_spec.rb +0 -35
  62. data/spec/lib/immutable/hash/flatten_spec.rb +0 -98
  63. data/spec/lib/immutable/hash/get_spec.rb +0 -79
  64. data/spec/lib/immutable/hash/has_key_spec.rb +0 -31
  65. data/spec/lib/immutable/hash/has_value_spec.rb +0 -27
  66. data/spec/lib/immutable/hash/hash_spec.rb +0 -29
  67. data/spec/lib/immutable/hash/inspect_spec.rb +0 -30
  68. data/spec/lib/immutable/hash/invert_spec.rb +0 -30
  69. data/spec/lib/immutable/hash/key_spec.rb +0 -27
  70. data/spec/lib/immutable/hash/keys_spec.rb +0 -15
  71. data/spec/lib/immutable/hash/map_spec.rb +0 -45
  72. data/spec/lib/immutable/hash/marshal_spec.rb +0 -28
  73. data/spec/lib/immutable/hash/merge_spec.rb +0 -82
  74. data/spec/lib/immutable/hash/min_max_spec.rb +0 -45
  75. data/spec/lib/immutable/hash/new_spec.rb +0 -70
  76. data/spec/lib/immutable/hash/none_spec.rb +0 -48
  77. data/spec/lib/immutable/hash/partition_spec.rb +0 -35
  78. data/spec/lib/immutable/hash/pretty_print_spec.rb +0 -34
  79. data/spec/lib/immutable/hash/put_spec.rb +0 -111
  80. data/spec/lib/immutable/hash/reduce_spec.rb +0 -35
  81. data/spec/lib/immutable/hash/reject_spec.rb +0 -61
  82. data/spec/lib/immutable/hash/reverse_each_spec.rb +0 -27
  83. data/spec/lib/immutable/hash/sample_spec.rb +0 -13
  84. data/spec/lib/immutable/hash/select_spec.rb +0 -57
  85. data/spec/lib/immutable/hash/size_spec.rb +0 -51
  86. data/spec/lib/immutable/hash/slice_spec.rb +0 -44
  87. data/spec/lib/immutable/hash/sort_spec.rb +0 -26
  88. data/spec/lib/immutable/hash/store_spec.rb +0 -75
  89. data/spec/lib/immutable/hash/subset_spec.rb +0 -42
  90. data/spec/lib/immutable/hash/superset_spec.rb +0 -42
  91. data/spec/lib/immutable/hash/take_spec.rb +0 -35
  92. data/spec/lib/immutable/hash/to_a_spec.rb +0 -13
  93. data/spec/lib/immutable/hash/to_hash_spec.rb +0 -21
  94. data/spec/lib/immutable/hash/to_proc_spec.rb +0 -39
  95. data/spec/lib/immutable/hash/update_in_spec.rb +0 -79
  96. data/spec/lib/immutable/hash/values_at_spec.rb +0 -33
  97. data/spec/lib/immutable/hash/values_spec.rb +0 -23
  98. data/spec/lib/immutable/list/add_spec.rb +0 -25
  99. data/spec/lib/immutable/list/all_spec.rb +0 -57
  100. data/spec/lib/immutable/list/any_spec.rb +0 -49
  101. data/spec/lib/immutable/list/append_spec.rb +0 -38
  102. data/spec/lib/immutable/list/at_spec.rb +0 -29
  103. data/spec/lib/immutable/list/break_spec.rb +0 -69
  104. data/spec/lib/immutable/list/cadr_spec.rb +0 -38
  105. data/spec/lib/immutable/list/chunk_spec.rb +0 -28
  106. data/spec/lib/immutable/list/clear_spec.rb +0 -24
  107. data/spec/lib/immutable/list/combination_spec.rb +0 -33
  108. data/spec/lib/immutable/list/compact_spec.rb +0 -34
  109. data/spec/lib/immutable/list/compare_spec.rb +0 -30
  110. data/spec/lib/immutable/list/cons_spec.rb +0 -25
  111. data/spec/lib/immutable/list/construction_spec.rb +0 -110
  112. data/spec/lib/immutable/list/copying_spec.rb +0 -19
  113. data/spec/lib/immutable/list/count_spec.rb +0 -36
  114. data/spec/lib/immutable/list/cycle_spec.rb +0 -28
  115. data/spec/lib/immutable/list/delete_at_spec.rb +0 -18
  116. data/spec/lib/immutable/list/delete_spec.rb +0 -16
  117. data/spec/lib/immutable/list/drop_spec.rb +0 -30
  118. data/spec/lib/immutable/list/drop_while_spec.rb +0 -38
  119. data/spec/lib/immutable/list/each_slice_spec.rb +0 -51
  120. data/spec/lib/immutable/list/each_spec.rb +0 -40
  121. data/spec/lib/immutable/list/each_with_index_spec.rb +0 -28
  122. data/spec/lib/immutable/list/empty_spec.rb +0 -23
  123. data/spec/lib/immutable/list/eql_spec.rb +0 -61
  124. data/spec/lib/immutable/list/fill_spec.rb +0 -49
  125. data/spec/lib/immutable/list/find_all_spec.rb +0 -70
  126. data/spec/lib/immutable/list/find_index_spec.rb +0 -35
  127. data/spec/lib/immutable/list/find_spec.rb +0 -42
  128. data/spec/lib/immutable/list/flat_map_spec.rb +0 -51
  129. data/spec/lib/immutable/list/flatten_spec.rb +0 -30
  130. data/spec/lib/immutable/list/grep_spec.rb +0 -46
  131. data/spec/lib/immutable/list/group_by_spec.rb +0 -41
  132. data/spec/lib/immutable/list/hash_spec.rb +0 -21
  133. data/spec/lib/immutable/list/head_spec.rb +0 -19
  134. data/spec/lib/immutable/list/include_spec.rb +0 -35
  135. data/spec/lib/immutable/list/index_spec.rb +0 -37
  136. data/spec/lib/immutable/list/indices_spec.rb +0 -61
  137. data/spec/lib/immutable/list/init_spec.rb +0 -28
  138. data/spec/lib/immutable/list/inits_spec.rb +0 -28
  139. data/spec/lib/immutable/list/insert_spec.rb +0 -46
  140. data/spec/lib/immutable/list/inspect_spec.rb +0 -29
  141. data/spec/lib/immutable/list/intersperse_spec.rb +0 -28
  142. data/spec/lib/immutable/list/join_spec.rb +0 -63
  143. data/spec/lib/immutable/list/last_spec.rb +0 -23
  144. data/spec/lib/immutable/list/ltlt_spec.rb +0 -19
  145. data/spec/lib/immutable/list/map_spec.rb +0 -45
  146. data/spec/lib/immutable/list/maximum_spec.rb +0 -39
  147. data/spec/lib/immutable/list/merge_by_spec.rb +0 -51
  148. data/spec/lib/immutable/list/merge_spec.rb +0 -59
  149. data/spec/lib/immutable/list/minimum_spec.rb +0 -39
  150. data/spec/lib/immutable/list/multithreading_spec.rb +0 -47
  151. data/spec/lib/immutable/list/none_spec.rb +0 -47
  152. data/spec/lib/immutable/list/one_spec.rb +0 -49
  153. data/spec/lib/immutable/list/partition_spec.rb +0 -115
  154. data/spec/lib/immutable/list/permutation_spec.rb +0 -55
  155. data/spec/lib/immutable/list/pop_spec.rb +0 -25
  156. data/spec/lib/immutable/list/product_spec.rb +0 -23
  157. data/spec/lib/immutable/list/reduce_spec.rb +0 -53
  158. data/spec/lib/immutable/list/reject_spec.rb +0 -45
  159. data/spec/lib/immutable/list/reverse_spec.rb +0 -34
  160. data/spec/lib/immutable/list/rotate_spec.rb +0 -36
  161. data/spec/lib/immutable/list/sample_spec.rb +0 -13
  162. data/spec/lib/immutable/list/select_spec.rb +0 -70
  163. data/spec/lib/immutable/list/size_spec.rb +0 -25
  164. data/spec/lib/immutable/list/slice_spec.rb +0 -229
  165. data/spec/lib/immutable/list/sorting_spec.rb +0 -46
  166. data/spec/lib/immutable/list/span_spec.rb +0 -76
  167. data/spec/lib/immutable/list/split_at_spec.rb +0 -43
  168. data/spec/lib/immutable/list/subsequences_spec.rb +0 -23
  169. data/spec/lib/immutable/list/sum_spec.rb +0 -23
  170. data/spec/lib/immutable/list/tail_spec.rb +0 -30
  171. data/spec/lib/immutable/list/tails_spec.rb +0 -28
  172. data/spec/lib/immutable/list/take_spec.rb +0 -30
  173. data/spec/lib/immutable/list/take_while_spec.rb +0 -46
  174. data/spec/lib/immutable/list/to_a_spec.rb +0 -39
  175. data/spec/lib/immutable/list/to_ary_spec.rb +0 -41
  176. data/spec/lib/immutable/list/to_list_spec.rb +0 -19
  177. data/spec/lib/immutable/list/to_set_spec.rb +0 -17
  178. data/spec/lib/immutable/list/transpose_spec.rb +0 -19
  179. data/spec/lib/immutable/list/union_spec.rb +0 -31
  180. data/spec/lib/immutable/list/uniq_spec.rb +0 -35
  181. data/spec/lib/immutable/list/zip_spec.rb +0 -23
  182. data/spec/lib/immutable/nested/construction_spec.rb +0 -101
  183. data/spec/lib/immutable/set/add_spec.rb +0 -77
  184. data/spec/lib/immutable/set/all_spec.rb +0 -51
  185. data/spec/lib/immutable/set/any_spec.rb +0 -51
  186. data/spec/lib/immutable/set/clear_spec.rb +0 -33
  187. data/spec/lib/immutable/set/compact_spec.rb +0 -30
  188. data/spec/lib/immutable/set/construction_spec.rb +0 -18
  189. data/spec/lib/immutable/set/copying_spec.rb +0 -13
  190. data/spec/lib/immutable/set/count_spec.rb +0 -36
  191. data/spec/lib/immutable/set/delete_spec.rb +0 -71
  192. data/spec/lib/immutable/set/difference_spec.rb +0 -49
  193. data/spec/lib/immutable/set/disjoint_spec.rb +0 -25
  194. data/spec/lib/immutable/set/each_spec.rb +0 -45
  195. data/spec/lib/immutable/set/empty_spec.rb +0 -44
  196. data/spec/lib/immutable/set/eqeq_spec.rb +0 -103
  197. data/spec/lib/immutable/set/eql_spec.rb +0 -109
  198. data/spec/lib/immutable/set/exclusion_spec.rb +0 -47
  199. data/spec/lib/immutable/set/find_spec.rb +0 -35
  200. data/spec/lib/immutable/set/first_spec.rb +0 -28
  201. data/spec/lib/immutable/set/flatten_spec.rb +0 -46
  202. data/spec/lib/immutable/set/grep_spec.rb +0 -57
  203. data/spec/lib/immutable/set/grep_v_spec.rb +0 -59
  204. data/spec/lib/immutable/set/group_by_spec.rb +0 -59
  205. data/spec/lib/immutable/set/hash_spec.rb +0 -22
  206. data/spec/lib/immutable/set/include_spec.rb +0 -60
  207. data/spec/lib/immutable/set/inspect_spec.rb +0 -47
  208. data/spec/lib/immutable/set/intersect_spec.rb +0 -25
  209. data/spec/lib/immutable/set/intersection_spec.rb +0 -52
  210. data/spec/lib/immutable/set/join_spec.rb +0 -64
  211. data/spec/lib/immutable/set/map_spec.rb +0 -59
  212. data/spec/lib/immutable/set/marshal_spec.rb +0 -28
  213. data/spec/lib/immutable/set/maximum_spec.rb +0 -36
  214. data/spec/lib/immutable/set/minimum_spec.rb +0 -36
  215. data/spec/lib/immutable/set/new_spec.rb +0 -53
  216. data/spec/lib/immutable/set/none_spec.rb +0 -47
  217. data/spec/lib/immutable/set/one_spec.rb +0 -47
  218. data/spec/lib/immutable/set/partition_spec.rb +0 -52
  219. data/spec/lib/immutable/set/product_spec.rb +0 -23
  220. data/spec/lib/immutable/set/reduce_spec.rb +0 -55
  221. data/spec/lib/immutable/set/reject_spec.rb +0 -50
  222. data/spec/lib/immutable/set/reverse_each_spec.rb +0 -38
  223. data/spec/lib/immutable/set/sample_spec.rb +0 -13
  224. data/spec/lib/immutable/set/select_spec.rb +0 -73
  225. data/spec/lib/immutable/set/size_spec.rb +0 -17
  226. data/spec/lib/immutable/set/sorting_spec.rb +0 -65
  227. data/spec/lib/immutable/set/subset_spec.rb +0 -51
  228. data/spec/lib/immutable/set/sum_spec.rb +0 -23
  229. data/spec/lib/immutable/set/superset_spec.rb +0 -51
  230. data/spec/lib/immutable/set/to_a_spec.rb +0 -30
  231. data/spec/lib/immutable/set/to_list_spec.rb +0 -35
  232. data/spec/lib/immutable/set/to_set_spec.rb +0 -19
  233. data/spec/lib/immutable/set/union_spec.rb +0 -63
  234. data/spec/lib/immutable/sorted_set/above_spec.rb +0 -51
  235. data/spec/lib/immutable/sorted_set/add_spec.rb +0 -62
  236. data/spec/lib/immutable/sorted_set/at_spec.rb +0 -24
  237. data/spec/lib/immutable/sorted_set/below_spec.rb +0 -51
  238. data/spec/lib/immutable/sorted_set/between_spec.rb +0 -51
  239. data/spec/lib/immutable/sorted_set/clear_spec.rb +0 -43
  240. data/spec/lib/immutable/sorted_set/copying_spec.rb +0 -20
  241. data/spec/lib/immutable/sorted_set/delete_at_spec.rb +0 -18
  242. data/spec/lib/immutable/sorted_set/delete_spec.rb +0 -89
  243. data/spec/lib/immutable/sorted_set/difference_spec.rb +0 -22
  244. data/spec/lib/immutable/sorted_set/disjoint_spec.rb +0 -25
  245. data/spec/lib/immutable/sorted_set/drop_spec.rb +0 -55
  246. data/spec/lib/immutable/sorted_set/drop_while_spec.rb +0 -34
  247. data/spec/lib/immutable/sorted_set/each_spec.rb +0 -28
  248. data/spec/lib/immutable/sorted_set/empty_spec.rb +0 -34
  249. data/spec/lib/immutable/sorted_set/eql_spec.rb +0 -120
  250. data/spec/lib/immutable/sorted_set/exclusion_spec.rb +0 -22
  251. data/spec/lib/immutable/sorted_set/fetch_spec.rb +0 -64
  252. data/spec/lib/immutable/sorted_set/find_index_spec.rb +0 -40
  253. data/spec/lib/immutable/sorted_set/first_spec.rb +0 -18
  254. data/spec/lib/immutable/sorted_set/from_spec.rb +0 -51
  255. data/spec/lib/immutable/sorted_set/group_by_spec.rb +0 -57
  256. data/spec/lib/immutable/sorted_set/include_spec.rb +0 -23
  257. data/spec/lib/immutable/sorted_set/inspect_spec.rb +0 -37
  258. data/spec/lib/immutable/sorted_set/intersect_spec.rb +0 -25
  259. data/spec/lib/immutable/sorted_set/intersection_spec.rb +0 -28
  260. data/spec/lib/immutable/sorted_set/last_spec.rb +0 -36
  261. data/spec/lib/immutable/sorted_set/map_spec.rb +0 -51
  262. data/spec/lib/immutable/sorted_set/marshal_spec.rb +0 -36
  263. data/spec/lib/immutable/sorted_set/maximum_spec.rb +0 -36
  264. data/spec/lib/immutable/sorted_set/minimum_spec.rb +0 -19
  265. data/spec/lib/immutable/sorted_set/new_spec.rb +0 -137
  266. data/spec/lib/immutable/sorted_set/reverse_each_spec.rb +0 -28
  267. data/spec/lib/immutable/sorted_set/sample_spec.rb +0 -13
  268. data/spec/lib/immutable/sorted_set/select_spec.rb +0 -61
  269. data/spec/lib/immutable/sorted_set/size_spec.rb +0 -17
  270. data/spec/lib/immutable/sorted_set/slice_spec.rb +0 -256
  271. data/spec/lib/immutable/sorted_set/sorting_spec.rb +0 -56
  272. data/spec/lib/immutable/sorted_set/subset_spec.rb +0 -47
  273. data/spec/lib/immutable/sorted_set/superset_spec.rb +0 -47
  274. data/spec/lib/immutable/sorted_set/take_spec.rb +0 -54
  275. data/spec/lib/immutable/sorted_set/take_while_spec.rb +0 -33
  276. data/spec/lib/immutable/sorted_set/to_set_spec.rb +0 -17
  277. data/spec/lib/immutable/sorted_set/union_spec.rb +0 -58
  278. data/spec/lib/immutable/sorted_set/up_to_spec.rb +0 -52
  279. data/spec/lib/immutable/sorted_set/util_spec.rb +0 -48
  280. data/spec/lib/immutable/sorted_set/values_at_spec.rb +0 -33
  281. data/spec/lib/immutable/vector/add_spec.rb +0 -67
  282. data/spec/lib/immutable/vector/any_spec.rb +0 -69
  283. data/spec/lib/immutable/vector/assoc_spec.rb +0 -45
  284. data/spec/lib/immutable/vector/bsearch_spec.rb +0 -65
  285. data/spec/lib/immutable/vector/clear_spec.rb +0 -33
  286. data/spec/lib/immutable/vector/combination_spec.rb +0 -81
  287. data/spec/lib/immutable/vector/compact_spec.rb +0 -29
  288. data/spec/lib/immutable/vector/compare_spec.rb +0 -31
  289. data/spec/lib/immutable/vector/concat_spec.rb +0 -34
  290. data/spec/lib/immutable/vector/copying_spec.rb +0 -20
  291. data/spec/lib/immutable/vector/count_spec.rb +0 -17
  292. data/spec/lib/immutable/vector/delete_at_spec.rb +0 -53
  293. data/spec/lib/immutable/vector/delete_spec.rb +0 -30
  294. data/spec/lib/immutable/vector/dig_spec.rb +0 -30
  295. data/spec/lib/immutable/vector/drop_spec.rb +0 -41
  296. data/spec/lib/immutable/vector/drop_while_spec.rb +0 -54
  297. data/spec/lib/immutable/vector/each_index_spec.rb +0 -40
  298. data/spec/lib/immutable/vector/each_spec.rb +0 -44
  299. data/spec/lib/immutable/vector/each_with_index_spec.rb +0 -39
  300. data/spec/lib/immutable/vector/empty_spec.rb +0 -41
  301. data/spec/lib/immutable/vector/eql_spec.rb +0 -76
  302. data/spec/lib/immutable/vector/fetch_spec.rb +0 -64
  303. data/spec/lib/immutable/vector/fill_spec.rb +0 -88
  304. data/spec/lib/immutable/vector/first_spec.rb +0 -18
  305. data/spec/lib/immutable/vector/flat_map_spec.rb +0 -50
  306. data/spec/lib/immutable/vector/flatten_spec.rb +0 -58
  307. data/spec/lib/immutable/vector/get_spec.rb +0 -74
  308. data/spec/lib/immutable/vector/group_by_spec.rb +0 -57
  309. data/spec/lib/immutable/vector/include_spec.rb +0 -30
  310. data/spec/lib/immutable/vector/insert_spec.rb +0 -68
  311. data/spec/lib/immutable/vector/inspect_spec.rb +0 -49
  312. data/spec/lib/immutable/vector/join_spec.rb +0 -58
  313. data/spec/lib/immutable/vector/last_spec.rb +0 -45
  314. data/spec/lib/immutable/vector/length_spec.rb +0 -45
  315. data/spec/lib/immutable/vector/ltlt_spec.rb +0 -65
  316. data/spec/lib/immutable/vector/map_spec.rb +0 -51
  317. data/spec/lib/immutable/vector/marshal_spec.rb +0 -31
  318. data/spec/lib/immutable/vector/maximum_spec.rb +0 -33
  319. data/spec/lib/immutable/vector/minimum_spec.rb +0 -33
  320. data/spec/lib/immutable/vector/multiply_spec.rb +0 -47
  321. data/spec/lib/immutable/vector/new_spec.rb +0 -50
  322. data/spec/lib/immutable/vector/partition_spec.rb +0 -52
  323. data/spec/lib/immutable/vector/permutation_spec.rb +0 -91
  324. data/spec/lib/immutable/vector/pop_spec.rb +0 -26
  325. data/spec/lib/immutable/vector/product_spec.rb +0 -70
  326. data/spec/lib/immutable/vector/reduce_spec.rb +0 -55
  327. data/spec/lib/immutable/vector/reject_spec.rb +0 -43
  328. data/spec/lib/immutable/vector/repeated_combination_spec.rb +0 -77
  329. data/spec/lib/immutable/vector/repeated_permutation_spec.rb +0 -93
  330. data/spec/lib/immutable/vector/reverse_each_spec.rb +0 -31
  331. data/spec/lib/immutable/vector/reverse_spec.rb +0 -21
  332. data/spec/lib/immutable/vector/rindex_spec.rb +0 -36
  333. data/spec/lib/immutable/vector/rotate_spec.rb +0 -73
  334. data/spec/lib/immutable/vector/sample_spec.rb +0 -13
  335. data/spec/lib/immutable/vector/select_spec.rb +0 -63
  336. data/spec/lib/immutable/vector/set_spec.rb +0 -174
  337. data/spec/lib/immutable/vector/shift_spec.rb +0 -27
  338. data/spec/lib/immutable/vector/shuffle_spec.rb +0 -43
  339. data/spec/lib/immutable/vector/slice_spec.rb +0 -240
  340. data/spec/lib/immutable/vector/sorting_spec.rb +0 -56
  341. data/spec/lib/immutable/vector/sum_spec.rb +0 -17
  342. data/spec/lib/immutable/vector/take_spec.rb +0 -42
  343. data/spec/lib/immutable/vector/take_while_spec.rb +0 -34
  344. data/spec/lib/immutable/vector/to_a_spec.rb +0 -41
  345. data/spec/lib/immutable/vector/to_ary_spec.rb +0 -34
  346. data/spec/lib/immutable/vector/to_list_spec.rb +0 -30
  347. data/spec/lib/immutable/vector/to_set_spec.rb +0 -21
  348. data/spec/lib/immutable/vector/transpose_spec.rb +0 -48
  349. data/spec/lib/immutable/vector/uniq_spec.rb +0 -76
  350. data/spec/lib/immutable/vector/unshift_spec.rb +0 -28
  351. data/spec/lib/immutable/vector/update_in_spec.rb +0 -82
  352. data/spec/lib/immutable/vector/values_at_spec.rb +0 -33
  353. data/spec/lib/immutable/vector/zip_spec.rb +0 -57
  354. data/spec/lib/load_spec.rb +0 -42
  355. data/spec/spec_helper.rb +0 -96
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4dfc5d75d70e963c56837a552ac1902889f05f2fd73a3995c69959815780594
4
- data.tar.gz: b9daefb94ad6bd5e3bf3a0bc7b74265a9d97188856ab78508f2cdf813b342636
3
+ metadata.gz: 54e4768953f4e1a9afbfc0d8496bdb563ae850419c905ea4dce78b560c88da3c
4
+ data.tar.gz: 9237a022ed3107aad98adfaed510cbd4b76367b06aab7a2d6a1f8dc2d6d3c911
5
5
  SHA512:
6
- metadata.gz: 306f0ef37c0ba06cf729b230f8eb6ec850cf6ff6130fea45eaf125d307078617f8688bc02b2dd6a75aae11134a45172f7ca11a12e6693409c36d5f00b7f18fc0
7
- data.tar.gz: '0039ef718ca215f12d6826ea6803c7e404fd211536095c5a4995ca04e30b0effefa11951a640bca03b37ee9834ff94bac7acd9d1ccaf2d08ba449204850e42cb'
6
+ metadata.gz: 7aa2208347fcce032af7b0885cb5088ea7d93573dd54c59fbebf7d98bd962be8880533c3c0fabe92fb7cfc5eddf1a9cc06cb60a0180ee55507d09dde7b2a0396
7
+ data.tar.gz: f10991e1881c42941d9723eb0acc569126b06716273852089c7f25a3bf2e5fefc25e1d5c767682dbb75d88a52da9dc12aee90627c7e1a92cf513f586aab3ef42
@@ -1,4 +1,4 @@
1
- require "immutable/list"
1
+ require 'immutable/list'
2
2
 
3
3
  # Monkey-patches to Ruby's built-in `Enumerable` module.
4
4
  # @see http://www.ruby-doc.org/core/Enumerable.html
@@ -1,4 +1,4 @@
1
- require "immutable/list"
1
+ require 'immutable/list'
2
2
 
3
3
  # Monkey-patches to Ruby's built-in `IO` class.
4
4
  # @see http://www.ruby-doc.org/core/IO.html
@@ -1,2 +1,2 @@
1
- require "immutable/core_ext/enumerable"
2
- require "immutable/core_ext/io"
1
+ require 'immutable/core_ext/enumerable'
2
+ require 'immutable/core_ext/io'
@@ -1,4 +1,4 @@
1
- require "immutable/list"
1
+ require 'immutable/list'
2
2
 
3
3
  module Immutable
4
4
 
@@ -48,7 +48,7 @@ module Immutable
48
48
  #
49
49
  # @return [Deque]
50
50
  def empty
51
- @empty ||= self.new
51
+ @empty ||= new
52
52
  end
53
53
 
54
54
  # "Raw" allocation of a new `Deque`. Used internally to create a new
@@ -86,7 +86,7 @@ module Immutable
86
86
  def size
87
87
  @front.size + @rear.size
88
88
  end
89
- alias :length :size
89
+ alias length size
90
90
 
91
91
  # Return the first item in the `Deque`. If the deque is empty, return `nil`.
92
92
  #
@@ -122,9 +122,9 @@ module Immutable
122
122
  # @param n [Integer] number of positions to move elements by
123
123
  # @return [Deque]
124
124
  def rotate(n)
125
- return self.class.empty if self.empty?
125
+ return self.class.empty if empty?
126
126
 
127
- n %= self.size
127
+ n %= size
128
128
  return self if n == 0
129
129
 
130
130
  a, b = @front, @rear
@@ -132,7 +132,7 @@ module Immutable
132
132
  if b.size >= n
133
133
  n.times { a = a.cons(b.head); b = b.tail }
134
134
  else
135
- (self.size - n).times { b = b.cons(a.head); a = a.tail }
135
+ (size - n).times { b = b.cons(a.head); a = a.tail }
136
136
  end
137
137
 
138
138
  self.class.alloc(a, b)
@@ -149,7 +149,7 @@ module Immutable
149
149
  def push(item)
150
150
  self.class.alloc(@front, @rear.cons(item))
151
151
  end
152
- alias :enqueue :push
152
+ alias enqueue push
153
153
 
154
154
  # Return a new `Deque` with the last item removed.
155
155
  #
@@ -198,7 +198,7 @@ module Immutable
198
198
 
199
199
  self.class.alloc(front.tail, rear)
200
200
  end
201
- alias :dequeue :shift
201
+ alias dequeue shift
202
202
 
203
203
  # Return an empty `Deque` instance, of the same class as this one. Useful if you
204
204
  # have multiple subclasses of `Deque` and want to treat them polymorphically.
@@ -223,15 +223,15 @@ module Immutable
223
223
  return true if other.equal?(self)
224
224
  instance_of?(other.class) && to_ary.eql?(other.to_ary)
225
225
  end
226
- alias :== :eql?
226
+ alias == eql?
227
227
 
228
228
  # Return an `Array` with the same elements, in the same order.
229
229
  # @return [Array]
230
230
  def to_a
231
- @front.to_a.concat(@rear.to_a.tap { |a| a.reverse! })
231
+ @front.to_a.concat(@rear.to_a.tap(&:reverse!))
232
232
  end
233
- alias :entries :to_a
234
- alias :to_ary :to_a
233
+ alias entries to_a
234
+ alias to_ary to_a
235
235
 
236
236
  # Return a {List} with the same elements, in the same order.
237
237
  # @return [Immutable::List]
@@ -248,8 +248,8 @@ module Immutable
248
248
  result = "#{self.class}["
249
249
  i = 0
250
250
  @front.each { |obj| result << ', ' if i > 0; result << obj.inspect; i += 1 }
251
- @rear.to_a.tap { |a| a.reverse! }.each { |obj| result << ', ' if i > 0; result << obj.inspect; i += 1 }
252
- result << "]"
251
+ @rear.to_a.tap(&:reverse!).each { |obj| result << ', ' if i > 0; result << obj.inspect; i += 1 }
252
+ result << ']'
253
253
  end
254
254
 
255
255
  # Return `self`. Since this is an immutable object duplicates are
@@ -258,13 +258,13 @@ module Immutable
258
258
  def dup
259
259
  self
260
260
  end
261
- alias :clone :dup
261
+ alias clone dup
262
262
 
263
263
  # @private
264
264
  def pretty_print(pp)
265
- pp.group(1, "#{self.class}[", "]") do
265
+ pp.group(1, "#{self.class}[", ']') do
266
266
  pp.breakable ''
267
- pp.seplist(self.to_a) { |obj| obj.pretty_print(pp) }
267
+ pp.seplist(to_a) { |obj| obj.pretty_print(pp) }
268
268
  end
269
269
  end
270
270
 
@@ -15,7 +15,7 @@ module Immutable
15
15
  return enum_for(:reject) if not block_given?
16
16
  select { |item| !yield(item) }
17
17
  end
18
- alias :delete_if :reject
18
+ alias delete_if reject
19
19
 
20
20
  # Return a new collection with all `nil` elements removed.
21
21
  def compact
@@ -91,15 +91,15 @@ module Immutable
91
91
  # Compare with `other`, and return 0, 1, or -1 if it is (respectively) equal to,
92
92
  # greater than, or less than this collection.
93
93
  def <=>(other)
94
- return 0 if self.equal?(other)
95
- enum1, enum2 = self.to_enum, other.to_enum
94
+ return 0 if equal?(other)
95
+ enum1, enum2 = to_enum, other.to_enum
96
96
  loop do
97
97
  item1 = enum1.next
98
98
  item2 = enum2.next
99
99
  comp = (item1 <=> item2)
100
100
  return comp if comp != 0
101
101
  end
102
- size1, size2 = self.size, other.size
102
+ size1, size2 = size, other.size
103
103
  return 0 if size1 == size2
104
104
  size1 > size2 ? 1 : -1
105
105
  end
@@ -107,14 +107,14 @@ module Immutable
107
107
  # Return true if `other` contains the same elements, in the same order.
108
108
  # @return [Boolean]
109
109
  def ==(other)
110
- self.eql?(other) || (other.respond_to?(:to_ary) && to_ary == other.to_ary)
110
+ eql?(other) || (other.respond_to?(:to_ary) && to_ary == other.to_ary)
111
111
  end
112
112
 
113
113
  # Convert all the elements into strings and join them together, separated by
114
114
  # `separator`. By default, the `separator` is `$,`, the global default string
115
115
  # separator, which is normally `nil`.
116
116
  def join(separator = $,)
117
- result = ""
117
+ result = ''
118
118
  if separator
119
119
  each_with_index { |obj, i| result << separator if i > 0; result << obj.to_s }
120
120
  else
@@ -132,19 +132,19 @@ module Immutable
132
132
  def inspect
133
133
  result = "#{self.class}["
134
134
  each_with_index { |obj, i| result << ', ' if i > 0; result << obj.inspect }
135
- result << "]"
135
+ result << ']'
136
136
  end
137
137
 
138
138
  # @private
139
139
  def pretty_print(pp)
140
- pp.group(1, "#{self.class}[", "]") do
140
+ pp.group(1, "#{self.class}[", ']') do
141
141
  pp.breakable ''
142
142
  pp.seplist(self) { |obj| obj.pretty_print(pp) }
143
143
  end
144
144
  end
145
145
 
146
- alias :to_ary :to_a
147
- alias :index :find_index
146
+ alias to_ary to_a
147
+ alias index find_index
148
148
 
149
149
  ## Compatibility fixes
150
150
 
@@ -1,8 +1,8 @@
1
- require "immutable/undefined"
2
- require "immutable/enumerable"
3
- require "immutable/trie"
4
- require "immutable/set"
5
- require "immutable/vector"
1
+ require 'immutable/undefined'
2
+ require 'immutable/enumerable'
3
+ require 'immutable/trie'
4
+ require 'immutable/set'
5
+ require 'immutable/vector'
6
6
 
7
7
  module Immutable
8
8
 
@@ -78,7 +78,7 @@ module Immutable
78
78
  #
79
79
  # @return [Hash]
80
80
  def empty
81
- @empty ||= self.new
81
+ @empty ||= new
82
82
  end
83
83
 
84
84
  # "Raw" allocation of a new `Hash`. Used internally to create a new
@@ -119,7 +119,7 @@ module Immutable
119
119
  def size
120
120
  @trie.size
121
121
  end
122
- alias :length :size
122
+ alias length size
123
123
 
124
124
  # Return `true` if this `Hash` contains no key/value pairs.
125
125
  #
@@ -140,9 +140,9 @@ module Immutable
140
140
  def key?(key)
141
141
  @trie.key?(key)
142
142
  end
143
- alias :has_key? :key?
144
- alias :include? :key?
145
- alias :member? :key?
143
+ alias has_key? key?
144
+ alias include? key?
145
+ alias member? key?
146
146
 
147
147
  # Return `true` if this `Hash` has one or more keys which map to the provided value.
148
148
  #
@@ -155,7 +155,7 @@ module Immutable
155
155
  each { |k,v| return true if value == v }
156
156
  false
157
157
  end
158
- alias :has_value? :value?
158
+ alias has_value? value?
159
159
 
160
160
  # Retrieve the value corresponding to the provided key object. If not found, and
161
161
  # this `Hash` has a default block, the default block is called to provide the
@@ -182,7 +182,7 @@ module Immutable
182
182
  @default.call(key)
183
183
  end
184
184
  end
185
- alias :[] :get
185
+ alias [] get
186
186
 
187
187
  # Retrieve the value corresponding to the given key object, or use the provided
188
188
  # default value or block, or otherwise raise a `KeyError`.
@@ -293,7 +293,7 @@ module Immutable
293
293
  # @return [Hash]
294
294
  def update_in(*key_path, &block)
295
295
  if key_path.empty?
296
- raise ArgumentError, "must have at least one key in path"
296
+ raise ArgumentError, 'must have at least one key in path'
297
297
  end
298
298
  key = key_path[0]
299
299
  if key_path.size == 1
@@ -348,7 +348,7 @@ module Immutable
348
348
  @trie.each(&block)
349
349
  self
350
350
  end
351
- alias :each_pair :each
351
+ alias each_pair each
352
352
 
353
353
  # Call the block once for each key/value pair in this `Hash`, passing the key/value
354
354
  # pair as parameters. Iteration order will be the opposite of {#each}.
@@ -423,7 +423,7 @@ module Immutable
423
423
  return self if empty?
424
424
  self.class.new(super, &@default)
425
425
  end
426
- alias :collect :map
426
+ alias collect map
427
427
 
428
428
  # Return a new `Hash` with all the key/value pairs for which the block returns true.
429
429
  #
@@ -439,8 +439,8 @@ module Immutable
439
439
  return enum_for(:select) unless block_given?
440
440
  derive_new_hash(@trie.select(&block))
441
441
  end
442
- alias :find_all :select
443
- alias :keep_if :select
442
+ alias find_all select
443
+ alias keep_if select
444
444
 
445
445
  # Yield `[key, value]` pairs until one is found for which the block returns true.
446
446
  # Return that `[key, value]` pair. If the block never returns true, return `nil`.
@@ -458,7 +458,7 @@ module Immutable
458
458
  each { |entry| return entry if yield entry }
459
459
  nil
460
460
  end
461
- alias :detect :find
461
+ alias detect find
462
462
 
463
463
  # Return a new `Hash` containing all the key/value pairs from this `Hash` and
464
464
  # `other`. If no block is provided, the value for entries with colliding keys
@@ -485,7 +485,7 @@ module Immutable
485
485
  def merge(other)
486
486
  trie = if block_given?
487
487
  other.reduce(@trie) do |trie, (key, value)|
488
- if entry = trie.get(key)
488
+ if (entry = trie.get(key))
489
489
  trie.put(key, yield(key, entry[1], value))
490
490
  else
491
491
  trie.put(key, value)
@@ -771,7 +771,7 @@ module Immutable
771
771
  # @param other [Object] The object to compare with
772
772
  # @return [Boolean]
773
773
  def ==(other)
774
- self.eql?(other) || (other.respond_to?(:to_hash) && to_hash == other.to_hash)
774
+ eql?(other) || (other.respond_to?(:to_hash) && to_hash == other.to_hash)
775
775
  end
776
776
 
777
777
  # Return true if this `Hash` is a proper superset of `other`, which means
@@ -840,7 +840,7 @@ module Immutable
840
840
  result << key.inspect << ' => ' << val.inspect
841
841
  i += 1
842
842
  end
843
- result << "]"
843
+ result << ']'
844
844
  end
845
845
 
846
846
  # Return `self`. Since this is an immutable object duplicates are
@@ -849,7 +849,7 @@ module Immutable
849
849
  def dup
850
850
  self
851
851
  end
852
- alias :clone :dup
852
+ alias clone dup
853
853
 
854
854
  # Allows this `Hash` to be printed at the `pry` console, or using `pp` (from the
855
855
  # Ruby standard library), in a way which takes the amount of horizontal space on
@@ -858,7 +858,7 @@ module Immutable
858
858
  #
859
859
  # @private
860
860
  def pretty_print(pp)
861
- pp.group(1, "#{self.class}[", "]") do
861
+ pp.group(1, "#{self.class}[", ']') do
862
862
  pp.breakable ''
863
863
  pp.seplist(self, nil) do |key, val|
864
864
  pp.group do
@@ -883,7 +883,7 @@ module Immutable
883
883
  end
884
884
  output
885
885
  end
886
- alias :to_h :to_hash
886
+ alias to_h to_hash
887
887
 
888
888
  # Return a `Proc` which accepts a key as an argument and returns the value.
889
889
  # The `Proc` behaves like {#get} (when the key is missing, it returns nil or
@@ -1,11 +1,11 @@
1
- require "thread"
2
- require "set"
3
- require "concurrent"
1
+ require 'thread'
2
+ require 'set'
3
+ require 'concurrent'
4
4
 
5
- require "immutable/undefined"
6
- require "immutable/enumerable"
7
- require "immutable/hash"
8
- require "immutable/set"
5
+ require 'immutable/undefined'
6
+ require 'immutable/enumerable'
7
+ require 'immutable/hash'
8
+ require 'immutable/set'
9
9
 
10
10
  module Immutable
11
11
  class << self
@@ -175,7 +175,7 @@ module Immutable
175
175
  end
176
176
  result
177
177
  end
178
- alias :length :size
178
+ alias length size
179
179
 
180
180
  # Create a new `List` with `item` added at the front. This is a constant
181
181
  # time operation.
@@ -189,7 +189,7 @@ module Immutable
189
189
  def add(item)
190
190
  Cons.new(item, self)
191
191
  end
192
- alias :cons :add
192
+ alias cons add
193
193
 
194
194
  # Create a new `List` with `item` added at the end. This is much less efficient
195
195
  # than adding items at the front.
@@ -235,7 +235,7 @@ module Immutable
235
235
  Cons.new(yield(head), tail.map(&block))
236
236
  end
237
237
  end
238
- alias :collect :map
238
+ alias collect map
239
239
 
240
240
  # Return a `List` which is realized by transforming each item into a `List`,
241
241
  # and flattening the resulting lists.
@@ -268,15 +268,15 @@ module Immutable
268
268
  return enum_for(:select) unless block_given?
269
269
  LazyList.new do
270
270
  list = self
271
- while true
271
+ loop do
272
272
  break list if list.empty?
273
273
  break Cons.new(list.head, list.tail.select(&block)) if yield(list.head)
274
274
  list = list.tail
275
275
  end
276
276
  end
277
277
  end
278
- alias :find_all :select
279
- alias :keep_if :select
278
+ alias find_all select
279
+ alias keep_if select
280
280
 
281
281
  # Return a `List` which contains all elements up to, but not including, the
282
282
  # first element for which the block returns `nil` or `false`.
@@ -380,8 +380,8 @@ module Immutable
380
380
  Cons.new(head, tail.append(other))
381
381
  end
382
382
  end
383
- alias :concat :append
384
- alias :+ :append
383
+ alias concat append
384
+ alias + append
385
385
 
386
386
  # Return a `List` with the same items, but in reverse order.
387
387
  #
@@ -440,7 +440,7 @@ module Immutable
440
440
  def transpose
441
441
  return EmptyList if empty?
442
442
  LazyList.new do
443
- next EmptyList if any? { |list| list.empty? }
443
+ next EmptyList if any?(&:empty?)
444
444
  heads, tails = EmptyList, EmptyList
445
445
  reverse_each { |list| heads, tails = heads.cons(list.head), tails.cons(list.tail) }
446
446
  Cons.new(heads, tails.transpose)
@@ -477,7 +477,7 @@ module Immutable
477
477
  # @return [Vector]
478
478
  # @raise [TypeError] if count is not an integer.
479
479
  def rotate(count = 1)
480
- raise TypeError, "expected Integer" if not count.is_a?(Integer)
480
+ raise TypeError, 'expected Integer' if not count.is_a?(Integer)
481
481
  return self if empty? || (count % size) == 0
482
482
  count = (count >= 0) ? count % size : (size - (~count % size) - 1)
483
483
  drop(count).append(take(count))
@@ -640,7 +640,7 @@ module Immutable
640
640
  Cons.new(head, tail.union(other, items.add(head)))
641
641
  end
642
642
  end
643
- alias :| :union
643
+ alias | union
644
644
 
645
645
  # Return a `List` with all elements except the last one.
646
646
  #
@@ -742,7 +742,7 @@ module Immutable
742
742
  chunk(number).each(&block)
743
743
  self
744
744
  end
745
- alias :each_slice :each_chunk
745
+ alias each_slice each_chunk
746
746
 
747
747
  # Return a new `List` with all nested lists recursively "flattened out",
748
748
  # that is, their elements inserted into the new `List` in the place where
@@ -776,7 +776,7 @@ module Immutable
776
776
  def group_by(&block)
777
777
  group_by_with(EmptyList, &block)
778
778
  end
779
- alias :group :group_by
779
+ alias group group_by
780
780
 
781
781
  # Retrieve the item at `index`. Negative indices count back from the end of
782
782
  # the list (-1 is the last item). If `index` is invalid (either too high or
@@ -868,7 +868,7 @@ module Immutable
868
868
  list.take(length)
869
869
  end
870
870
  end
871
- alias :[] :slice
871
+ alias [] slice
872
872
 
873
873
  # Return a `List` of indices of matching objects.
874
874
  #
@@ -895,7 +895,7 @@ module Immutable
895
895
  return EmptyList if empty?
896
896
  LazyList.new do
897
897
  node = self
898
- while true
898
+ loop do
899
899
  break Cons.new(i, node.tail.indices(Undefined, i + 1, &block)) if yield(node.head)
900
900
  node = node.tail
901
901
  break EmptyList if node.empty?
@@ -1187,7 +1187,7 @@ module Immutable
1187
1187
  def dup
1188
1188
  self
1189
1189
  end
1190
- alias :clone :dup
1190
+ alias clone dup
1191
1191
 
1192
1192
  # Return `self`.
1193
1193
  # @return [List]
@@ -1201,9 +1201,9 @@ module Immutable
1201
1201
  #
1202
1202
  # @return [String]
1203
1203
  def inspect
1204
- result = "Immutable::List["
1204
+ result = 'Immutable::List['
1205
1205
  each_with_index { |obj, i| result << ', ' if i > 0; result << obj.inspect }
1206
- result << "]"
1206
+ result << ']'
1207
1207
  end
1208
1208
 
1209
1209
  # Allows this `List` to be printed at the `pry` console, or using `pp` (from the
@@ -1213,7 +1213,7 @@ module Immutable
1213
1213
  #
1214
1214
  # @private
1215
1215
  def pretty_print(pp)
1216
- pp.group(1, "Immutable::List[", "]") do
1216
+ pp.group(1, 'Immutable::List[', ']') do
1217
1217
  pp.breakable ''
1218
1218
  pp.seplist(self) { |obj| obj.pretty_print(pp) }
1219
1219
  end
@@ -1290,7 +1290,7 @@ module Immutable
1290
1290
  def size
1291
1291
  @size ||= super
1292
1292
  end
1293
- alias :length :size
1293
+ alias length size
1294
1294
 
1295
1295
  def cached_size?
1296
1296
  @size != nil
@@ -1319,7 +1319,7 @@ module Immutable
1319
1319
  realize if @atomic.value != 2
1320
1320
  @head
1321
1321
  end
1322
- alias :first :head
1322
+ alias first head
1323
1323
 
1324
1324
  def tail
1325
1325
  realize if @atomic.value != 2
@@ -1334,7 +1334,7 @@ module Immutable
1334
1334
  def size
1335
1335
  @size ||= super
1336
1336
  end
1337
- alias :length :size
1337
+ alias length size
1338
1338
 
1339
1339
  def cached_size?
1340
1340
  @size != nil
@@ -1346,7 +1346,7 @@ module Immutable
1346
1346
  MUTEX = Mutex.new
1347
1347
 
1348
1348
  def realize
1349
- while true
1349
+ loop do
1350
1350
  # try to "claim" the right to run the block which realizes target
1351
1351
  if @atomic.compare_and_set(0,1) # full memory barrier here
1352
1352
  begin
@@ -1392,7 +1392,7 @@ module Immutable
1392
1392
  realize if @head == Undefined
1393
1393
  @head
1394
1394
  end
1395
- alias :first :head
1395
+ alias first head
1396
1396
 
1397
1397
  def tail
1398
1398
  realize if @tail == Undefined
@@ -1407,7 +1407,7 @@ module Immutable
1407
1407
  def size
1408
1408
  @size ||= super
1409
1409
  end
1410
- alias :length :size
1410
+ alias length size
1411
1411
 
1412
1412
  def cached_size?
1413
1413
  @size != nil
@@ -1455,7 +1455,7 @@ module Immutable
1455
1455
  mutex = @mutex
1456
1456
  mutex && mutex.synchronize do
1457
1457
  return if @head != Undefined # another thread got ahead of us
1458
- while true
1458
+ loop do
1459
1459
  if !@buffer.empty?
1460
1460
  @head = @buffer.shift
1461
1461
  @tail = Partitioned.new(@partitioner, @buffer, @mutex)
@@ -1516,7 +1516,7 @@ module Immutable
1516
1516
  mutex = @mutex
1517
1517
  mutex && mutex.synchronize do
1518
1518
  return if @head != Undefined # another thread got ahead of us
1519
- while true
1519
+ loop do
1520
1520
  if !@buffer.empty?
1521
1521
  @head = @buffer.shift
1522
1522
  @tail = Left.new(@splitter, @buffer, @mutex)
@@ -1568,7 +1568,7 @@ module Immutable
1568
1568
  def head
1569
1569
  nil
1570
1570
  end
1571
- alias :first :head
1571
+ alias first head
1572
1572
 
1573
1573
  # There are no subsequent elements, so return an empty list.
1574
1574
  # @return [self]
@@ -1585,7 +1585,7 @@ module Immutable
1585
1585
  def size
1586
1586
  0
1587
1587
  end
1588
- alias :length :size
1588
+ alias length size
1589
1589
 
1590
1590
  def cached_size?
1591
1591
  true
@@ -1,11 +1,11 @@
1
- require "set"
2
- require "immutable/hash"
3
- require "immutable/set"
4
- require "immutable/vector"
5
- require "immutable/sorted_set"
6
- require "immutable/list"
7
- require "immutable/deque"
8
- require "immutable/core_ext/struct"
1
+ require 'set'
2
+ require 'sorted_set'
3
+ require 'immutable/hash'
4
+ require 'immutable/set'
5
+ require 'immutable/vector'
6
+ require 'immutable/sorted_set'
7
+ require 'immutable/list'
8
+ require 'immutable/deque'
9
9
 
10
10
  module Immutable
11
11
  class << self