opal 0.8.1 → 0.9.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (331) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -2
  3. data/.gitmodules +3 -3
  4. data/.jshintrc +17 -20
  5. data/.travis.yml +22 -11
  6. data/CHANGELOG.md +51 -1
  7. data/CODE_OF_CONDUCT.md +15 -0
  8. data/CONTRIBUTING.md +125 -9
  9. data/Gemfile +1 -1
  10. data/Guardfile +2 -2
  11. data/README.md +95 -29
  12. data/Rakefile +1 -1
  13. data/benchmark/benchmarks +103 -0
  14. data/benchmark/bm_array_flatten.rb +9 -0
  15. data/benchmark/bm_array_intersection_numbers.rb +7 -0
  16. data/benchmark/bm_array_intersection_objects.rb +7 -0
  17. data/benchmark/bm_array_intersection_strings.rb +7 -0
  18. data/benchmark/bm_array_join_ary.rb +9 -0
  19. data/benchmark/bm_array_minus_numbers.rb +7 -0
  20. data/benchmark/bm_array_minus_objects.rb +7 -0
  21. data/benchmark/bm_array_minus_strings.rb +7 -0
  22. data/benchmark/bm_array_union_numbers.rb +7 -0
  23. data/benchmark/bm_array_union_objects.rb +7 -0
  24. data/benchmark/bm_array_union_strings.rb +7 -0
  25. data/benchmark/bm_array_uniq_bang_numbers.rb +5 -0
  26. data/benchmark/bm_array_uniq_bang_objects.rb +5 -0
  27. data/benchmark/bm_array_uniq_bang_strings.rb +5 -0
  28. data/benchmark/bm_array_uniq_numbers.rb +5 -0
  29. data/benchmark/bm_array_uniq_objects.rb +5 -0
  30. data/benchmark/bm_array_uniq_strings.rb +5 -0
  31. data/benchmark/bm_dispatch_bind_table.rb +57 -0
  32. data/benchmark/bm_dispatch_code_gen.rb +65 -0
  33. data/benchmark/bm_dispatch_code_gen_if.rb +64 -0
  34. data/benchmark/bm_dispatch_hardcoded.rb +44 -0
  35. data/benchmark/bm_dispatch_send.rb +38 -0
  36. data/benchmark/bm_dispatch_send_table.rb +57 -0
  37. data/benchmark/bm_hash_assoc_object.rb +11 -0
  38. data/benchmark/bm_hash_assoc_string.rb +9 -0
  39. data/benchmark/bm_hash_clone_object.rb +9 -0
  40. data/benchmark/bm_hash_clone_string.rb +9 -0
  41. data/benchmark/bm_hash_delete_object.rb +11 -0
  42. data/benchmark/bm_hash_delete_string.rb +9 -0
  43. data/benchmark/bm_hash_each_key_object.rb +9 -0
  44. data/benchmark/bm_hash_each_key_string.rb +9 -0
  45. data/benchmark/bm_hash_each_object.rb +9 -0
  46. data/benchmark/bm_hash_each_string.rb +9 -0
  47. data/benchmark/bm_hash_each_value_object.rb +9 -0
  48. data/benchmark/bm_hash_each_value_string.rb +9 -0
  49. data/benchmark/bm_hash_element_reference_object.rb +11 -0
  50. data/benchmark/bm_hash_element_reference_string.rb +9 -0
  51. data/benchmark/bm_hash_element_set_object.rb +5 -0
  52. data/benchmark/bm_hash_element_set_string.rb +5 -0
  53. data/benchmark/bm_hash_equal_value_object.rb +14 -0
  54. data/benchmark/bm_hash_equal_value_string.rb +11 -0
  55. data/benchmark/bm_hash_fetch_object.rb +11 -0
  56. data/benchmark/bm_hash_fetch_string.rb +9 -0
  57. data/benchmark/bm_hash_flatten_object.rb +9 -0
  58. data/benchmark/bm_hash_flatten_string.rb +9 -0
  59. data/benchmark/bm_hash_has_key_object.rb +11 -0
  60. data/benchmark/bm_hash_has_key_string.rb +9 -0
  61. data/benchmark/bm_hash_has_value_object.rb +9 -0
  62. data/benchmark/bm_hash_has_value_string.rb +9 -0
  63. data/benchmark/bm_hash_hash_object.rb +9 -0
  64. data/benchmark/bm_hash_hash_string.rb +9 -0
  65. data/benchmark/bm_hash_inspect_object.rb +9 -0
  66. data/benchmark/bm_hash_inspect_string.rb +9 -0
  67. data/benchmark/bm_hash_invert_object.rb +9 -0
  68. data/benchmark/bm_hash_invert_string.rb +9 -0
  69. data/benchmark/bm_hash_keep_if_object.rb +9 -0
  70. data/benchmark/bm_hash_keep_if_string.rb +9 -0
  71. data/benchmark/bm_hash_key_object.rb +9 -0
  72. data/benchmark/bm_hash_key_string.rb +9 -0
  73. data/benchmark/bm_hash_keys_object.rb +9 -0
  74. data/benchmark/bm_hash_keys_string.rb +9 -0
  75. data/benchmark/bm_hash_literal_mixed_large.rb +3 -0
  76. data/benchmark/bm_hash_literal_mixed_small.rb +3 -0
  77. data/benchmark/bm_hash_literal_object_large.rb +4 -0
  78. data/benchmark/bm_hash_literal_object_small.rb +3 -0
  79. data/benchmark/bm_hash_literal_string_large.rb +4 -0
  80. data/benchmark/bm_hash_literal_string_small.rb +3 -0
  81. data/benchmark/bm_hash_merge_object.rb +22 -0
  82. data/benchmark/bm_hash_merge_string.rb +18 -0
  83. data/benchmark/bm_hash_rassoc_object.rb +9 -0
  84. data/benchmark/bm_hash_rassoc_string.rb +9 -0
  85. data/benchmark/bm_hash_rehash_object.rb +9 -0
  86. data/benchmark/bm_hash_rehash_string.rb +9 -0
  87. data/benchmark/bm_hash_reject_bang_object.rb +9 -0
  88. data/benchmark/bm_hash_reject_bang_string.rb +9 -0
  89. data/benchmark/bm_hash_reject_object.rb +9 -0
  90. data/benchmark/bm_hash_reject_string.rb +9 -0
  91. data/benchmark/bm_hash_replace_object.rb +18 -0
  92. data/benchmark/bm_hash_replace_string.rb +14 -0
  93. data/benchmark/bm_hash_select_bang_object.rb +9 -0
  94. data/benchmark/bm_hash_select_bang_string.rb +9 -0
  95. data/benchmark/bm_hash_select_object.rb +9 -0
  96. data/benchmark/bm_hash_select_string.rb +9 -0
  97. data/benchmark/bm_hash_shift_object.rb +10 -0
  98. data/benchmark/bm_hash_shift_string.rb +10 -0
  99. data/benchmark/bm_hash_to_a_object.rb +9 -0
  100. data/benchmark/bm_hash_to_a_string.rb +9 -0
  101. data/benchmark/bm_hash_to_h_object.rb +10 -0
  102. data/benchmark/bm_hash_to_h_string.rb +10 -0
  103. data/benchmark/bm_hash_values_object.rb +9 -0
  104. data/benchmark/bm_hash_values_string.rb +9 -0
  105. data/benchmark/run.rb +48 -0
  106. data/bin/opal-mspec +1 -1
  107. data/bin/opal-repl +4 -4
  108. data/docs/compiled_ruby.md +214 -56
  109. data/docs/configuring_gems.md +2 -2
  110. data/docs/faq.md +2 -2
  111. data/docs/getting_started.md +19 -2
  112. data/docs/jquery.md +5 -5
  113. data/docs/opal_parser.md +53 -0
  114. data/docs/unsupported_features.md +2 -2
  115. data/docs/upgrading.md +22 -0
  116. data/docs/using_sprockets.md +15 -0
  117. data/examples/rack/config.ru +13 -0
  118. data/examples/sinatra/config.ru +4 -5
  119. data/lib/mspec/opal/runner.rb +54 -11
  120. data/lib/opal.rb +1 -1
  121. data/lib/opal/builder.rb +1 -1
  122. data/lib/opal/builder_processors.rb +1 -1
  123. data/lib/opal/cli.rb +17 -13
  124. data/lib/opal/cli_options.rb +1 -1
  125. data/lib/opal/compiler.rb +12 -0
  126. data/lib/opal/config.rb +4 -0
  127. data/lib/opal/nodes/arglist.rb +5 -7
  128. data/lib/opal/nodes/call.rb +6 -1
  129. data/lib/opal/nodes/call_special.rb +74 -0
  130. data/lib/opal/nodes/def.rb +35 -28
  131. data/lib/opal/nodes/definitions.rb +3 -5
  132. data/lib/opal/nodes/for.rb +13 -0
  133. data/lib/opal/nodes/helpers.rb +15 -1
  134. data/lib/opal/nodes/if.rb +5 -5
  135. data/lib/opal/nodes/iter.rb +6 -1
  136. data/lib/opal/nodes/literal.rb +1 -1
  137. data/lib/opal/nodes/logic.rb +2 -2
  138. data/lib/opal/nodes/masgn.rb +1 -2
  139. data/lib/opal/nodes/module.rb +2 -1
  140. data/lib/opal/nodes/rescue.rb +10 -1
  141. data/lib/opal/nodes/scope.rb +8 -2
  142. data/lib/opal/nodes/singleton_class.rb +1 -1
  143. data/lib/opal/nodes/top.rb +11 -0
  144. data/lib/opal/nodes/variables.rb +4 -4
  145. data/lib/opal/parser.rb +21 -3
  146. data/lib/opal/parser/grammar.rb +3115 -2961
  147. data/lib/opal/parser/grammar.y +29 -6
  148. data/lib/opal/parser/lexer.rb +18 -8
  149. data/lib/opal/sprockets.rb +85 -0
  150. data/lib/opal/sprockets/processor.rb +11 -35
  151. data/lib/opal/sprockets/server.rb +3 -15
  152. data/lib/opal/version.rb +2 -2
  153. data/opal.gemspec +4 -4
  154. data/opal/README.md +9 -0
  155. data/opal/corelib/array.rb +433 -181
  156. data/opal/corelib/basic_object.rb +48 -4
  157. data/opal/corelib/boolean.rb +15 -6
  158. data/opal/corelib/class.rb +6 -5
  159. data/opal/corelib/comparable.rb +12 -0
  160. data/opal/corelib/complex.rb +282 -0
  161. data/opal/corelib/constants.rb +9 -0
  162. data/opal/corelib/enumerable.rb +83 -34
  163. data/opal/corelib/enumerator.rb +3 -1
  164. data/opal/corelib/error.rb +49 -10
  165. data/opal/corelib/file.rb +1 -0
  166. data/opal/corelib/hash.rb +353 -577
  167. data/opal/corelib/helpers.rb +20 -0
  168. data/opal/corelib/kernel.rb +114 -59
  169. data/opal/corelib/math.rb +470 -0
  170. data/opal/corelib/method.rb +11 -2
  171. data/opal/corelib/module.rb +96 -96
  172. data/opal/corelib/{nil_class.rb → nil.rb} +20 -1
  173. data/opal/corelib/number.rb +751 -0
  174. data/opal/corelib/numeric.rb +77 -437
  175. data/opal/corelib/proc.rb +81 -1
  176. data/opal/corelib/process.rb +27 -0
  177. data/opal/corelib/rational.rb +358 -0
  178. data/opal/corelib/regexp.rb +156 -27
  179. data/opal/corelib/runtime.js +724 -335
  180. data/opal/corelib/string.rb +93 -104
  181. data/opal/corelib/string/encoding.rb +177 -0
  182. data/opal/corelib/string/inheritance.rb +2 -0
  183. data/opal/corelib/struct.rb +105 -18
  184. data/opal/corelib/time.rb +267 -146
  185. data/opal/corelib/unsupported.rb +216 -0
  186. data/opal/corelib/variables.rb +0 -6
  187. data/opal/opal.rb +8 -22
  188. data/opal/opal/base.rb +9 -0
  189. data/opal/opal/mini.rb +17 -0
  190. data/spec/README.md +1 -1
  191. data/spec/filters/bugs/array.rb +38 -136
  192. data/spec/filters/bugs/{basic_object.rb → basicobject.rb} +14 -15
  193. data/spec/filters/bugs/class.rb +6 -12
  194. data/spec/filters/bugs/complex.rb +3 -0
  195. data/spec/filters/bugs/date.rb +162 -10
  196. data/spec/filters/bugs/enumerable.rb +31 -58
  197. data/spec/filters/bugs/enumerator.rb +42 -0
  198. data/spec/filters/bugs/exception.rb +66 -10
  199. data/spec/filters/bugs/float.rb +17 -0
  200. data/spec/filters/bugs/hash.rb +11 -97
  201. data/spec/filters/bugs/inheritance.rb +5 -0
  202. data/spec/filters/bugs/integer.rb +28 -0
  203. data/spec/filters/bugs/kernel.rb +304 -12
  204. data/spec/filters/bugs/language.rb +133 -399
  205. data/spec/filters/bugs/language_opal.rb +88 -0
  206. data/spec/filters/bugs/module.rb +203 -62
  207. data/spec/filters/bugs/numeric.rb +32 -0
  208. data/spec/filters/bugs/proc.rb +39 -0
  209. data/spec/filters/bugs/range.rb +148 -0
  210. data/spec/filters/bugs/regexp.rb +168 -0
  211. data/spec/filters/bugs/set.rb +46 -3
  212. data/spec/filters/bugs/singleton.rb +1 -2
  213. data/spec/filters/bugs/string.rb +59 -90
  214. data/spec/filters/bugs/strscan.rb +80 -0
  215. data/spec/filters/bugs/struct.rb +10 -20
  216. data/spec/filters/bugs/time.rb +17 -184
  217. data/spec/filters/bugs/unboundmethod.rb +22 -0
  218. data/spec/filters/unsupported/array.rb +163 -0
  219. data/spec/filters/unsupported/basicobject.rb +14 -0
  220. data/spec/filters/unsupported/bignum.rb +46 -0
  221. data/spec/filters/unsupported/class.rb +4 -0
  222. data/spec/filters/unsupported/delegator.rb +5 -0
  223. data/spec/filters/unsupported/enumerable.rb +11 -0
  224. data/spec/filters/unsupported/enumerator.rb +8 -9
  225. data/spec/filters/unsupported/fixnum.rb +14 -0
  226. data/spec/filters/unsupported/float.rb +41 -7
  227. data/spec/filters/unsupported/freeze.rb +45 -0
  228. data/spec/filters/unsupported/hash.rb +50 -0
  229. data/spec/filters/unsupported/integer.rb +3 -0
  230. data/spec/filters/unsupported/kernel.rb +31 -0
  231. data/spec/filters/unsupported/language.rb +17 -0
  232. data/spec/filters/unsupported/matchdata.rb +30 -0
  233. data/spec/filters/unsupported/math.rb +3 -0
  234. data/spec/filters/unsupported/module.rb +5 -3
  235. data/spec/filters/unsupported/pathname.rb +3 -0
  236. data/spec/filters/unsupported/privacy.rb +136 -0
  237. data/spec/filters/unsupported/proc.rb +3 -0
  238. data/spec/filters/unsupported/regexp.rb +59 -0
  239. data/spec/filters/unsupported/set.rb +4 -0
  240. data/spec/filters/unsupported/{marshal.rb → singleton.rb} +4 -2
  241. data/spec/filters/unsupported/{mutable_strings.rb → string.rb} +456 -336
  242. data/spec/filters/unsupported/struct.rb +3 -0
  243. data/spec/filters/unsupported/symbol.rb +5 -0
  244. data/spec/filters/unsupported/taint.rb +16 -0
  245. data/spec/filters/unsupported/thread.rb +5 -0
  246. data/spec/filters/unsupported/time.rb +197 -16
  247. data/spec/lib/cli_spec.rb +14 -4
  248. data/spec/lib/compiler_spec.rb +9 -1
  249. data/spec/lib/parser/call_spec.rb +18 -0
  250. data/spec/lib/parser/not_spec.rb +2 -8
  251. data/spec/lib/sprockets_spec.rb +24 -0
  252. data/spec/opal/core/array/intersection_spec.rb +38 -0
  253. data/spec/opal/core/array/minus_spec.rb +38 -0
  254. data/spec/opal/core/array/union_spec.rb +38 -0
  255. data/spec/opal/core/array/uniq_spec.rb +49 -0
  256. data/spec/opal/core/exception_spec.rb +7 -0
  257. data/spec/opal/core/fixtures/require_tree_with_dot/file 1.rb +1 -0
  258. data/spec/opal/core/fixtures/require_tree_with_dot/file 2.rb +1 -0
  259. data/spec/opal/core/fixtures/require_tree_with_dot/file 3.rb +1 -0
  260. data/spec/opal/core/fixtures/require_tree_with_dot/index.rb +3 -0
  261. data/spec/opal/core/hash/internals_spec.rb +332 -0
  262. data/spec/opal/core/helpers_spec.rb +14 -0
  263. data/spec/opal/core/kernel/freeze_spec.rb +1 -1
  264. data/spec/opal/core/kernel/raise_spec.rb +13 -0
  265. data/spec/opal/core/kernel/require_tree_spec.rb +9 -0
  266. data/spec/opal/core/language/class_spec.rb +55 -0
  267. data/spec/opal/core/language/fixtures/send.rb +1 -0
  268. data/spec/opal/core/language/keyword_arguments_spec.rb +11 -0
  269. data/spec/opal/core/language/send_spec.rb +5 -0
  270. data/spec/opal/core/method/to_proc_spec.rb +28 -0
  271. data/spec/opal/core/module/name_spec.rb +0 -17
  272. data/spec/opal/core/runtime/bridged_classes_spec.rb +2 -2
  273. data/spec/opal/core/runtime/eval_spec.rb +1 -1
  274. data/spec/opal/core/runtime/method_missing_spec.rb +6 -0
  275. data/spec/opal/core/runtime_spec.rb +51 -0
  276. data/spec/opal/stdlib/js_spec.rb +66 -0
  277. data/spec/opal/stdlib/native/hash_spec.rb +36 -0
  278. data/spec/rubyspecs +152 -273
  279. data/spec/spec_helper.rb +10 -11
  280. data/stdlib/base64.rb +9 -9
  281. data/stdlib/benchmark.rb +551 -4
  282. data/stdlib/console.rb +94 -0
  283. data/stdlib/date.rb +1 -1
  284. data/stdlib/encoding.rb +1 -170
  285. data/stdlib/js.rb +56 -0
  286. data/stdlib/json.rb +9 -14
  287. data/stdlib/math.rb +1 -370
  288. data/stdlib/native.rb +133 -63
  289. data/stdlib/nodejs/file.rb +5 -0
  290. data/stdlib/nodejs/fileutils.rb +13 -6
  291. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/README.md +1 -1
  292. data/stdlib/opal-parser.rb +1 -2
  293. data/stdlib/ostruct.rb +65 -6
  294. data/stdlib/pp.rb +2 -4
  295. data/stdlib/rbconfig.rb +1 -3
  296. data/stdlib/strscan.rb +164 -28
  297. data/tasks/benchmarking.rake +88 -0
  298. data/tasks/testing.rake +181 -55
  299. data/{lib/mspec/opal/special_calls.rb → tasks/testing/mspec_special_calls.rb} +1 -1
  300. data/{lib/mspec/opal/sprockets.js → tasks/testing/phantomjs1-sprockets.js} +17 -6
  301. data/test/opal/test_keyword.rb +590 -0
  302. data/vendored-minitest/minitest.rb +2 -2
  303. data/vendored-minitest/test/unit.rb +5 -0
  304. metadata +229 -62
  305. data/benchmarks/operators.rb +0 -11
  306. data/benchmarks/prova.js.rb +0 -13
  307. data/docs/libraries.md +0 -36
  308. data/lib/mspec/opal/new.html.erb +0 -1
  309. data/lib/mspec/opal/rake_task.rb +0 -248
  310. data/opal/corelib/match_data.rb +0 -128
  311. data/spec/filters/bugs/math.rb +0 -95
  312. data/spec/filters/bugs/nil.rb +0 -7
  313. data/spec/filters/bugs/opal.rb +0 -9
  314. data/spec/filters/bugs/regular_expressions.rb +0 -41
  315. data/spec/filters/bugs/stringscanner.rb +0 -33
  316. data/spec/filters/unsupported/encoding.rb +0 -102
  317. data/spec/filters/unsupported/frozen.rb +0 -92
  318. data/spec/filters/unsupported/hash_compare_by_identity.rb +0 -16
  319. data/spec/filters/unsupported/integer_size.rb +0 -59
  320. data/spec/filters/unsupported/method_added.rb +0 -10
  321. data/spec/filters/unsupported/private_constants.rb +0 -30
  322. data/spec/filters/unsupported/private_methods.rb +0 -55
  323. data/spec/filters/unsupported/random.rb +0 -4
  324. data/spec/filters/unsupported/rational_numbers.rb +0 -4
  325. data/spec/filters/unsupported/regular_expressions.rb +0 -137
  326. data/spec/filters/unsupported/ruby_exe.rb +0 -5
  327. data/spec/filters/unsupported/symbols.rb +0 -17
  328. data/spec/filters/unsupported/tainted.rb +0 -180
  329. data/spec/filters/unsupported/trusted.rb +0 -88
  330. data/stdlib/process.rb +0 -10
  331. data/tasks/documenting.rake +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee5e9d9c86a2c36d1a5c7b19bac3611ac4f4cac7
4
- data.tar.gz: 1067110e4a386c8f6fb9a3cfd015ff22e8333edf
3
+ metadata.gz: 1af59805d32671acdce95d17776362c714d82c6d
4
+ data.tar.gz: cbe41468214bfdd99902f85301182b37a4281a8a
5
5
  SHA512:
6
- metadata.gz: 5bccdee86e7e84447adecf51649c206794a4d17d3afb1ed29cf9f856825c5337ae46c1fefe3edd1f83d6bc3cf91f1931c396c8483d6ce43514149f5bddaa8fe6
7
- data.tar.gz: a24da3eb375260399cd35b4cf237ce2ae836964b2c5357c3e8d1c8934a40d1735c4a4ed8c54a55b92db425a1286547ef2bcd81332fe6585675c60e10362b4484
6
+ metadata.gz: 280f8bc25e11405068eb0794bc3c094885f2b43266b9dfa8716e1f25009118a5c0556ed8b8d489f1f406cc862817753fb70065eda5e744c3f2f0de142607611b
7
+ data.tar.gz: d4ad1d81debb785c025807f6d18281dd191df37efef3afb2d548e611aa36ecb44bbe43846a8fe900f03cec73ec1be0159483d3c18f373eda3beda498bb16aa2b
data/.gitignore CHANGED
@@ -13,5 +13,5 @@ build/
13
13
  .ruby-version
14
14
  .rvmrc
15
15
 
16
- # Ignore the rubyspec dir from recent releases (0.9+)
17
- /spec/rubyspec
16
+ # Ignore the location of the older (0.8 and below) rubyspec submodule location
17
+ spec/corelib
data/.gitmodules CHANGED
@@ -1,6 +1,6 @@
1
- [submodule "spec/corelib"]
2
- path = spec/corelib
3
- url = https://github.com/opal/rubyspec
1
+ [submodule "spec/rubyspec"]
2
+ path = spec/rubyspec
3
+ url = https://github.com/ruby/rubyspec.git
4
4
  [submodule "test/cruby"]
5
5
  path = test/cruby
6
6
  url = https://github.com/ruby/ruby.git
data/.jshintrc CHANGED
@@ -5,9 +5,8 @@
5
5
  "eqeqeq" : true, // Prohibit the use of == and != in favor of === and !==
6
6
  "es3" : true, // Adhere to ECMAScript 3 specification
7
7
  "forin" : true, // Require all for in loops to filter object's items (hasOwnProperty)
8
- "latedef" : true, // Prohibit the use of a variable before it was defined
8
+ "latedef" : "nofunc", // Prohibit the use of a variable before it was defined (allow function declarations to be ignored)
9
9
  "noarg" : true, // Prohibit the use of arguments.caller and arguments.callee
10
- "nonbsp" : true, // Warn about "non-breaking whitespace" characters
11
10
  "undef" : true, // Prohibit the use of explicitly undeclared variables
12
11
  "unused" : true, // Warn when you define and never use your variables
13
12
 
@@ -15,7 +14,8 @@
15
14
  "Opal": true,
16
15
  "OpalNode": true,
17
16
  "callPhantom": true,
18
- "JSON": true
17
+ "JSON": true,
18
+ "Pippo": true
19
19
  },
20
20
 
21
21
  "browser": true,
@@ -23,29 +23,26 @@
23
23
 
24
24
  // Currently the following checks are failing:
25
25
 
26
- "-W003": false, // 'variable' was used before it was defined
27
- "-W004": false, // 'variable' is already defined
28
- "-W018": false, // Confusing use of '!'
26
+ // To investigate:
27
+ "-W053": false, // Do not use String as a constructor
28
+ "-W069": false, // ['prop'] is better written in dot notation
29
+ "-W089": false, // The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype
30
+
31
+ // Compiler:
29
32
  "-W021": false, // '$ClassName' is a function
30
- "-W024": false, // Expected an identifier and instead saw 'eval' (a reserved word)
31
33
  "-W027": false, // Unreachable ';' after 'return'
32
- "-W032": false, // Unnecessary semicolon
33
34
  "-W030": false, // Expected an assignment or function call and instead saw an expression
35
+ "-W032": false, // Unnecessary semicolon
34
36
  "-W033": false, // Missing semicolon
35
- "-W038": false, // 'variable' used out of scope
36
- "-W041": false, // Use '===' to compare with 'true'
37
- "-W049": false, // Unexpected escaped character '<' in regular expression
38
- "-W053": false, // Do not use String as a constructor
39
- "-W058": false, // Missing '()' invoking a constructor
40
- "-W061": false, // eval can be harmful
41
- "-W065": false, // Missing radix parameter
42
- "-W069": false, // ['prop'] is better written in dot notation
43
- "-W080": false, // It's not necessary to initialize 'result' to 'undefined'
37
+ "-W067": false, // Bad invocation
44
38
  "-W083": false, // Don't make functions within a loop
45
- "-W086": false, // Expected a 'break' statement before 'case'
46
- "-W089": false, // The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype
47
39
  "-W093": false, // Did you mean to return a conditional instead of an assignment?
48
40
  "-W098": false, // 'variable' is defined but never used
49
41
  "-W116": false, // Expected '===' and instead saw '=='
50
- "-W120": false // You might be leaking a variable ($ClassName) here
42
+ "-W120": false, // You might be leaking a variable ($ClassName) here
43
+
44
+ // Keeping these:
45
+ "-W061": false, // eval can be harmful
46
+ "-W086": false, // Expected a 'break' statement before 'case'
47
+ "-W100": false // This character may get silently deleted by one or more browsers
51
48
  }
data/.travis.yml CHANGED
@@ -5,8 +5,6 @@ sudo: false
5
5
  cache:
6
6
  bundler: true
7
7
  directories:
8
- - test/cruby
9
- - spec/corelib
10
8
  - /home/travis/.nvm/
11
9
 
12
10
  matrix:
@@ -14,7 +12,19 @@ matrix:
14
12
 
15
13
  include:
16
14
  - rvm: 2.2
17
- env: RUN=default TZ="/usr/share/zoneinfo/Pacific/Fiji"
15
+ env: RUN=jshint SUITE=core
16
+
17
+ - rvm: 2.2
18
+ env: RUN=jshint SUITE=stdlib
19
+
20
+ - rvm: 2.2
21
+ env: RUN=mspec_opal_node
22
+
23
+ - rvm: 2.2
24
+ env: RUN=mspec_rubyspec_node TZ="/usr/share/zoneinfo/Pacific/Fiji"
25
+
26
+ - rvm: 2.2.3
27
+ env: RUN=mspec_rubyspec_phantom
18
28
 
19
29
  - rvm: 2.2
20
30
  env: RUN=rspec TILT_VERSION=2.0.1
@@ -22,12 +32,12 @@ matrix:
22
32
  - rvm: 2.1
23
33
  env: RUN=rspec
24
34
 
35
+ - rvm: 2.0
36
+ env: RUN="rspec"
37
+
25
38
  - rvm: 1.9.3
26
39
  env: RUN=rspec
27
40
 
28
- - rvm: 2.0.0
29
- env: RUN="rspec mspec_phantom"
30
-
31
41
  - rvm: rbx
32
42
  env: RUN=rspec
33
43
 
@@ -37,14 +47,13 @@ matrix:
37
47
  - rvm: jruby-head
38
48
  env: RUN=rspec
39
49
 
50
+ allow_failures:
40
51
  - rvm: 2.2
41
- script:
42
- - npm install -g jshint
43
- - bundle exec rake lint
52
+ env: RUN=jshint SUITE=stdlib
44
53
 
45
- allow_failures:
46
- - rvm: 1.8.7
47
54
  - rvm: 1.9.3
55
+ - rvm: 2.1
56
+ - rvm: 2.0
48
57
  - rvm: rbx
49
58
  - rvm: jruby
50
59
  - rvm: jruby-head
@@ -55,6 +64,8 @@ before_install:
55
64
  - node -v
56
65
  - phantomjs -v
57
66
  - git submodule update --init
67
+ - npm install -g jshint
68
+ - npm install -g uglify-js
58
69
 
59
70
  script:
60
71
  - "bundle exec rake $RUN"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,44 @@
1
+ ## 0.9.0 (edge)
2
+
3
+ * A `console` wrapper has been added to the stdlib, requiring it will make available the `$console` global variable.
4
+
5
+ * `Kernel#pp` no longer forwards arguments directly to `console.log`, this behavior has been replaced by stdlib's own `console.rb` (see above).
6
+
7
+ * `method_added`, `method_removed` and `method_undefined` reflection now works.
8
+
9
+ * `singleton_method_added`, `singleton_method_removed` and `singleton_method_undefined` reflection now works.
10
+
11
+ * Now you can bridge a native class to a Ruby class that inherits from another Ruby class
12
+
13
+ * `Numeric` semantics are now compliant with Ruby.
14
+
15
+ * `Complex` has been fully implemented.
16
+
17
+ * `Rational` has been fully implemented.
18
+
19
+ * `Opal::Sprockets.javascript_include_tag` has been add to allow easy debug mode (i.e. with source maps) when including a sprockets asset into an HTML page.
20
+
21
+ * `Opal::Processor.load_asset_code(sprockets, name)` has been deprecated in favor of `Opal::Sprockets.load_asset(name, sprockets)`.
22
+
23
+ * `Struct#hash` now works properly based on struct contents
24
+
25
+ * No longer crashes when calling a method with an opt arg followed by an optional kwarg when called without the kwarg
26
+
27
+ * Newly compliant with RubySpec:
28
+ * `Enumerable#chunk`
29
+
30
+ * Operator methods (e.g. `+`, `<`, etc.) can be handled by `method_missing`
31
+
32
+ * `OpenStruct` - fixed `#method missing`, `#inspect`, `#to_s`, `#delete_field`. Fully compliant except for frozen and marshal behavior.
33
+
34
+ * Fix issue where passing a block after a parameter and a hash was causing block to not be passed (e.g. `method1 some_param, 'a' => 1, &block`)
35
+
36
+ * `Kernel#raise` now properly re-raises exceptions (regardless of how many levels deep you are) and works properly if supplied a class that has an exception method.
37
+
38
+ * `Exception#exception`, `Exception::exception`, `Exception#message`, and `Exception#to_s` are fully implemented
39
+
40
+ * Method defs issued inside `Module#instance_eval` and `Class#instance_eval`, and the respective `exec` now create class methods
41
+
1
42
  ## 0.8.1 2015-10-12
2
43
 
3
44
  * Use official Sprockets processor cache keys API:
@@ -7,7 +48,6 @@
7
48
 
8
49
  * Fix an issue for which a Pathname was passed instead of a String to Sprockets.
9
50
 
10
-
11
51
  ## 0.8.0 2015-07-16
12
52
 
13
53
  * Update to Sprockets v3.0.
@@ -20,6 +60,16 @@
20
60
 
21
61
  * Fix `Promise#always`.
22
62
 
63
+ * Update to Sprockets v3.0.
64
+
65
+ * Delegate dependency management directly to Sprockets (when used) making sourcemaps swift again.
66
+ This means code generated by sprockets will always need to be bootstrapped via `Opal.load` or `Opal.require`.
67
+ Luckily `Opal::Processor.load_asset_code(sprockets, name)` does just that in the right way.
68
+
69
+ * Enable operator inlining by default in the compiler.
70
+
71
+ * Fix `Promise#always`.
72
+
23
73
  * Fix `String#split` when no match is found and a limit is provided
24
74
 
25
75
  * Fix `require_tree(".")` when used from file at the root of the assets paths
@@ -0,0 +1,15 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of overtly sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ This code of conduct applies both within project spaces and in public spaces where an individual explicitly associates their presence with the project; non-project related material on accounts explicitly marked as personal should not be considered to be so associated.
12
+
13
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
14
+
15
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/CONTRIBUTING.md CHANGED
@@ -6,7 +6,7 @@ using opal (or related libraries) then use the
6
6
  [#opal](http://webchat.freenode.net/?channels=opal) irc channel on
7
7
  FreeNode.
8
8
 
9
- ## Contributing
9
+ ## Contributing (TL;DR)
10
10
 
11
11
  1. Before opening a new issue, search for previous discussions including closed
12
12
  ones. Add comments there if a similar issue is found.
@@ -15,8 +15,13 @@ ones. Add comments there if a similar issue is found.
15
15
 
16
16
  3. Before sending pull requests make sure all tests run and pass (see below).
17
17
 
18
- 4. Make sure to use a similar coding style to the rest of the code base. In ruby
19
- and javascript code we use 2 spaces (no tabs).
18
+ 4. Make sure to use a similar coding style to the rest of the code base. In Ruby
19
+ and JavaScript code we use 2 spaces (no tabs).
20
+
21
+ 5. Make sure to have updated all the relevant documentation, both for API and
22
+ the guides.
23
+
24
+ If unsure about having satisfied any of the above points ask in the [Gitter channel](https://gitter.im/opal/opal) or just open the issue/pull-request asking for help. There's a good chance someone will help you through the necessary steps.
20
25
 
21
26
  ## Quick Start
22
27
 
@@ -30,6 +35,7 @@ Get dependencies:
30
35
 
31
36
  ```
32
37
  $ bundle install
38
+ $ npm install -g jshint
33
39
  ```
34
40
 
35
41
  RubySpec related repos must be cloned as a git submodules:
@@ -52,24 +58,31 @@ You are now ready to make your first contribution to Opal! At a high level, your
52
58
 
53
59
  ## Down The Rabbit Hole
54
60
 
55
- Before making changes to Opal source, you need to understand a little about how the test suite works. Every spec that Opal test suite executes is listed in `spec/rubyspecs` file. Each line in that file is a path to either a spec file or a directory full of spec files. If it's a path to a directory, all spec files in that directory will be executed when you run the test suite. All paths are relative to the top-level `specs` directory. Let's follow one of these paths - `corelib/core/string/sub_spec` - and see where it goes.
61
+ Before making changes to Opal source, you need to understand a little about how the test suite works. Every spec that Opal test suite executes is listed in `spec/rubyspecs` file. Each line in that file is a path to either a spec file or a directory full of spec files. If it's a path to a directory, all spec files in that directory will be executed when you run the test suite. All paths are relative to the top-level `specs` directory. Let's follow one of these paths - `rubyspec/core/string/sub_spec` - and see where it goes.
56
62
 
57
- Navigating to `spec/corelib/core` directory, you see that it contains multiple sub-directories, usually named after the Ruby class or module. Drilling further down into `spec/corelib/core/string` you see all the spec files for the various `String` behaviors under test, usually named by a method name followed by `_spec.rb`. Opening `spec/corelib/core/string/sub_spec.rb` you finally see the code that checks the correctness of Opal's implementation of `String#sub` method's behavior.
63
+ Navigating to `spec/rubyspec/core` directory, you see that it contains multiple sub-directories, usually named after the Ruby class or module. Drilling further down into `spec/rubyspec/core/string` you see all the spec files for the various `String` behaviors under test, usually named by a method name followed by `_spec.rb`. Opening `spec/rubyspec/core/string/sub_spec.rb` you finally see the code that checks the correctness of Opal's implementation of `String#sub` method's behavior.
58
64
 
59
65
  When you execute `$ bundle exec rake`, the code in this file is executed, along with all the other specs in the entire test suite. It's a good idea to run the entire test suite when you feel you reached a certain milestone in the course of making your changes (exactly what that means is up to you), and definitely do `$ bundle exec rake` before commiting your changes to make sure they have not introduced regressions or other unintended side effects.
60
66
 
61
67
  But you will want to run tests as often as possible, after every small change, and running the entire test suite will slow you down. You need to be able to execute a single spec that is concerned with the feature you are currently working on. To accomplish this, just add `PATTERN` to your spec invocation command, like this:
68
+
62
69
  ```
63
- $ bundle exec rake mspec_node PATTERN=spec/corelib/core/string/sub_spec.rb
70
+ $ env PATTERN="spec/rubyspec/core/string/sub_spec.rb" bundle exec rake mspec_node
71
+ ```
72
+
73
+ This will make sure that only `spec/rubyspec/core/string/sub_spec.rb` is run, and no other specs are executed. Globs can be used too:
74
+
75
+ ```
76
+ $ env PATTERN="spec/rubyspec/core/string/*_spec.rb" bundle exec rake mspec_node
64
77
  ```
65
- This will make sure that only `spec/corelib/core/string/sub_spec.rb` is run, and no other specs are executed.
66
78
 
67
79
  Another way to quickly validate ideas and play with your changes is to use `opal-repl`, a tool similar to `irb`. Running `opal-repl` drops you into an interactive environment with your current version of Opal loaded, including any changes you have made.
80
+
68
81
  ```
69
82
  $ bundle exec opal-repl
70
83
  >> 2 + 2
71
84
  => 4
72
- >>
85
+ >>
73
86
  ```
74
87
 
75
88
  When quickly iterating on an idea, even `opal-repl` may feel a bit too heavy, because after making a change in Opal, you must `exit` from `opal-repl` and do `$ bundle exec opal-repl` again to load Opal with your latest changes. In this case, you can run `opal` with the `-e` option, which executes a piece of code you pass to it once, then returns to the shell. This means that in order to run it again after making another adjustment to Opal, all you have to do is hit the up arrow key on your keyboard and press the enter key. This is the fastest way to go from making a change in Opal to seeing its effect.
@@ -81,8 +94,111 @@ hello
81
94
  $
82
95
  ```
83
96
 
84
- Let's recap what we covered so far. `spec/rubyspecs` is the "master list" of all the specs that get executed when you do `$ bundle exec rake`. You know where to find individual specs, inspect them, and execute them selectively or in bulk. But how do you know which specs to work on? You may be tempted to compare the contents of one of the directories in `spec/corelib/core` with the list of paths in `spec/rubyspecs`, add the missing paths to the "master list", run `$ bundle exec rake`, and start fixing the failures by implementing the missing features. However, chances are that as you are reading this, there are plenty of failing tests in the specs that are already listed in `spec/rubyspecs`. How can that be if `$ bundle exec rake` runs green? To understand this, you need to get acquainted with the concept of spec filters.
97
+ Let's recap what we covered so far. `spec/rubyspecs` is the "master list" of all the specs that get executed when you do `$ bundle exec rake`. You know where to find individual specs, inspect them, and execute them selectively or in bulk. But how do you know which specs to work on? You may be tempted to compare the contents of one of the directories in `spec/rubyspec/core` with the list of paths in `spec/rubyspecs`, add the missing paths to the "master list", run `$ bundle exec rake`, and start fixing the failures by implementing the missing features. However, chances are that as you are reading this, there are plenty of failing tests in the specs that are already listed in `spec/rubyspecs`. How can that be if `$ bundle exec rake` runs green? To understand this, you need to get acquainted with the concept of spec filters.
85
98
 
86
99
  There are two types of spec filters in the Opal project: `spec/filters/bugs` and `spec/filters/unsupported`. Both filters have the same effect: any spec failures that are noted inside any of the files inside of these directories are ignored when running the spec suite, i.e. they are not reported as failures. Even though their effect is the same, the purpose of `bugs` and `unsupported` filters is different. As the name suggests, `unsupported` filters list _permanent_ failures, things that other Ruby implementations can do that Opal cannot and will never be able to do (by design and by virtue of being implemented on top of JavaScript running in the browser environment). `bugs` filters, on the other hand, are _temporary_ failures, problems that need to be worked on. Problems that Opal needs your help with. Think of the `bugs` directory and the files contained within it as your "TO DO" list for contributing to Opal.
87
100
 
88
101
  Comment out any of the `fail` lines in any of the files in the `spec/filters/bugs` directory, run `$bundle exec rake`, and watch it fail. Make it pass and submit a pull request - that's all there is to it :) Happy hacking!
102
+
103
+ ## Benchmarking
104
+
105
+ There are two ways to benchmark Opal's performance: one way is to write a program (or a set of programs) that takes sufficently long time to execute, then measure the execution time, and the other is to execute a specific RubySpec example (or a set of examples) multiple times, then measure the execution time. Let's call the former "traditional benchmarking", and the latter "RubySpec benchmarking".
106
+
107
+ Regardless of which of the two types of benchmarking above you happen to be doing, the reporting of benchmark results works the same way: `bundle exec rake bench:report`.
108
+
109
+ It's important to understand that benchmarking in Opal works on the principle of a single, shared benchmarking workspace, a *bench*, where the results of each benchmark run that you perform get automatically saved. When you do `bundle exec rake bench:report`, you get a combined report of all of the benchmark results that are currently sitting in your workspace. This means you can check out an older commit, run benchmarks, checkout a newer commit, run benchmarks, then run the report to see the results from the two commits side-by-side. After you're done, (or before starting a new benchmarking session), you can do `bundle exec rake bench:clear` to reset your workspace to a clean slate.
110
+
111
+ You can get a list of all the available benchmarking commands by running `bundle exec rake -T | grep bench` as shown below.
112
+ ```
113
+ $ bundle exec rake -T | grep bench
114
+
115
+ rake bench:clear # Delete all benchmark results
116
+ rake bench:opal # Benchmark Opal
117
+ rake bench:report # Combined report of all benchmark results
118
+ rake bench:ruby # Benchmark Ruby
119
+ ```
120
+
121
+ ### Traditional Benchmarking
122
+
123
+ At the root of the opal project tree is a folder called `benchmark` that contains a file called `benchmarks`. This file lists all of the benchmarks that will be run if you do `bundle exec bench:opal` without specifying any particular benchmark file(s) as parameters to this rake task. In the example below, I pick which benchmarks to run by passing their file paths as parameters to the rake task.
124
+
125
+ Start with a clean slate:
126
+ ```
127
+ $ bundle exec rake bench:clear
128
+
129
+ rm tmp/bench/*
130
+ ```
131
+
132
+ Run two benchmark programs from the MRI benchmarking suite by passing their file paths as parameters:
133
+ (Note: passing params to Rake tasks is tricky - notice there is no space after the comma!)
134
+ ```
135
+ $ bundle exec rake bench:opal[test/cruby/benchmark/bm_app_answer.rb,test/cruby/benchmark/bm_app_factorial.rb]
136
+
137
+ bundle exec opal benchmark/run.rb test/cruby/benchmark/bm_app_answer.rb test/cruby/benchmark/bm_app_factorial.rb | tee tmp/bench/Opal1
138
+ test/cruby/benchmark/bm_app_answer.rb 0.7710001468658447
139
+ test/cruby/benchmark/bm_app_factorial.rb 0.0820000171661377
140
+ ===============================================
141
+ Executed 2 benchmarks in 0.8530001640319824 sec
142
+ ```
143
+
144
+ In this case, I want to see how Opal's results stack up against MRI's results, so I will run the same set of benchmarks for Ruby:
145
+ ```
146
+ $ bundle exec rake bench:ruby[test/cruby/benchmark/bm_app_answer.rb,test/cruby/benchmark/bm_app_factorial.rb]
147
+
148
+ bundle exec ruby benchmark/run.rb test/cruby/benchmark/bm_app_answer.rb test/cruby/benchmark/bm_app_factorial.rb | tee tmp/bench/Ruby1
149
+ test/cruby/benchmark/bm_app_answer.rb 0.04913724200014258
150
+ test/cruby/benchmark/bm_app_factorial.rb 1.3288652799965348
151
+ ===============================================
152
+ Executed 2 benchmarks in 1.3780025219966774 sec
153
+ ```
154
+
155
+ Now I'm ready to see the result of the two runs side-by-side:
156
+ ```
157
+ $ bundle exec rake bench:report
158
+
159
+ Benchmark Opal1 Ruby1
160
+ test/cruby/benchmark/bm_app_answer.rb 0.771 0.049
161
+ test/cruby/benchmark/bm_app_factorial.rb 0.082 1.329
162
+ ```
163
+
164
+ If I were to continue running benchmarks, more columns would be added to the report. You can select which columns you want to display (and in what order) by passing their names as params to the rake task like so: `bundle exec rake bench:report[Ruby1,Opal1]`
165
+
166
+ ### RubySpec Benchmarking
167
+
168
+ This type of benchmarking relies on a feature of MSpec whereby you can ask it to execute every example in a given spec multiple times. Adding `BM=<number of times>` to your regular spec suite invocation command will hook into this MSpec functionality, collect timing information, and dump the results into the benchmarking workspace, making them available for reporting. Below is an example run with a single spec and `BM` set to `100`, meaning each example in the spec would be run 100 times.
169
+
170
+ ```
171
+ $ bundle exec rake mspec_node PATTERN=spec/rubyspec/core/array/permutation_spec.rb BM=100
172
+ [44, :filters]
173
+ [1, :custom]
174
+ mkdir -p tmp
175
+ mkdir -p tmp/bench
176
+ ruby -rbundler/setup -rmspec/opal/special_calls bin/opal -gmspec -Ispec -Ilib -smspec/helpers/tmp -smspec/helpers/environment -smspec/guards/block_device -smspec/guards/endian -rnodejs/io -rnodejs/kernel -Dwarning -A tmp/mspec_node.rb -c > tmp/mspec_node.js
177
+ jshint --verbose tmp/mspec_node.js
178
+ NODE_PATH=stdlib/nodejs/node_modules node tmp/mspec_node.js
179
+ ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
180
+ Finished
181
+ 1200 examples, 0 failures (time taken: 0.7880001068115234)
182
+
183
+ Benchmark results have been written to tmp/bench/Spec1
184
+ To view the results, run bundle exec rake bench:report
185
+ ```
186
+
187
+ Now let's see the report:
188
+ (Spec names can be very long, scroll to the right to see the numbers)
189
+ ```
190
+ $ bundle exec rake bench:report
191
+ Benchmark Spec1
192
+ Array#permutation_returns_an_Enumerator_of_all_permutations_when_called_without_a_block_or_arguments 0.117
193
+ Array#permutation_returns_an_Enumerator_of_permutations_of_given_length_when_called_with_an_argument_but_no_block 0.064
194
+ Array#permutation_yields_all_permutations_to_the_block_then_returns_self_when_called_with_block_but_no_arguments 0.076
195
+ Array#permutation_yields_all_permutations_of_given_length_to_the_block_then_returns_self_when_called_with_block_and_argument 0.072
196
+ Array#permutation_returns_the_empty_permutation_([[]])_when_the_given_length_is_0 0.029
197
+ Array#permutation_returns_the_empty_permutation([])_when_called_on_an_empty_Array 0.029
198
+ Array#permutation_returns_no_permutations_when_the_given_length_has_no_permutations 0.029
199
+ Array#permutation_handles_duplicate_elements_correctly 0.081
200
+ Array#permutation_handles_nested_Arrays_correctly 0.085
201
+ Array#permutation_truncates_Float_arguments 0.063
202
+ Array#permutation_returns_an_Enumerator_which_works_as_expected_even_when_the_array_was_modified 0.056
203
+ Array#permutation_generates_from_a_defensive_copy,_ignoring_mutations 0.038
204
+ ```
data/Gemfile CHANGED
@@ -23,4 +23,4 @@ unless ENV['CI']
23
23
  gem 'terminal-notifier-guard'
24
24
  end
25
25
 
26
- gem 'mspec', github: 'rubyspec/mspec'
26
+ gem 'mspec', github: 'ruby/mspec'
data/Guardfile CHANGED
@@ -51,10 +51,10 @@ class ::Guard::Opal < Plugin
51
51
  case path
52
52
  when %r{grammar\.y$} then system 'rake racc'
53
53
  when %r{^spec/lib} then rspec path
54
- when %r{^spec/corelib} then mspec path
54
+ when %r{^spec/rubyspec} then mspec path
55
55
  when %r{^opal/corelib}
56
56
  name = File.basename(path, '.rb')
57
- mspec "spec/corelib/core/#{name}/**/*_spec.rb"
57
+ mspec "spec/rubyspec/core/#{name}/**/*_spec.rb"
58
58
  when %r{^lib/opal/(.*)\.rb$}
59
59
  name = $1
60
60
  specs = Dir["spec/lib/#{name}_spec.rb"]