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.
- checksums.yaml +4 -4
- data/.gitignore +2 -2
- data/.gitmodules +3 -3
- data/.jshintrc +17 -20
- data/.travis.yml +22 -11
- data/CHANGELOG.md +51 -1
- data/CODE_OF_CONDUCT.md +15 -0
- data/CONTRIBUTING.md +125 -9
- data/Gemfile +1 -1
- data/Guardfile +2 -2
- data/README.md +95 -29
- data/Rakefile +1 -1
- data/benchmark/benchmarks +103 -0
- data/benchmark/bm_array_flatten.rb +9 -0
- data/benchmark/bm_array_intersection_numbers.rb +7 -0
- data/benchmark/bm_array_intersection_objects.rb +7 -0
- data/benchmark/bm_array_intersection_strings.rb +7 -0
- data/benchmark/bm_array_join_ary.rb +9 -0
- data/benchmark/bm_array_minus_numbers.rb +7 -0
- data/benchmark/bm_array_minus_objects.rb +7 -0
- data/benchmark/bm_array_minus_strings.rb +7 -0
- data/benchmark/bm_array_union_numbers.rb +7 -0
- data/benchmark/bm_array_union_objects.rb +7 -0
- data/benchmark/bm_array_union_strings.rb +7 -0
- data/benchmark/bm_array_uniq_bang_numbers.rb +5 -0
- data/benchmark/bm_array_uniq_bang_objects.rb +5 -0
- data/benchmark/bm_array_uniq_bang_strings.rb +5 -0
- data/benchmark/bm_array_uniq_numbers.rb +5 -0
- data/benchmark/bm_array_uniq_objects.rb +5 -0
- data/benchmark/bm_array_uniq_strings.rb +5 -0
- data/benchmark/bm_dispatch_bind_table.rb +57 -0
- data/benchmark/bm_dispatch_code_gen.rb +65 -0
- data/benchmark/bm_dispatch_code_gen_if.rb +64 -0
- data/benchmark/bm_dispatch_hardcoded.rb +44 -0
- data/benchmark/bm_dispatch_send.rb +38 -0
- data/benchmark/bm_dispatch_send_table.rb +57 -0
- data/benchmark/bm_hash_assoc_object.rb +11 -0
- data/benchmark/bm_hash_assoc_string.rb +9 -0
- data/benchmark/bm_hash_clone_object.rb +9 -0
- data/benchmark/bm_hash_clone_string.rb +9 -0
- data/benchmark/bm_hash_delete_object.rb +11 -0
- data/benchmark/bm_hash_delete_string.rb +9 -0
- data/benchmark/bm_hash_each_key_object.rb +9 -0
- data/benchmark/bm_hash_each_key_string.rb +9 -0
- data/benchmark/bm_hash_each_object.rb +9 -0
- data/benchmark/bm_hash_each_string.rb +9 -0
- data/benchmark/bm_hash_each_value_object.rb +9 -0
- data/benchmark/bm_hash_each_value_string.rb +9 -0
- data/benchmark/bm_hash_element_reference_object.rb +11 -0
- data/benchmark/bm_hash_element_reference_string.rb +9 -0
- data/benchmark/bm_hash_element_set_object.rb +5 -0
- data/benchmark/bm_hash_element_set_string.rb +5 -0
- data/benchmark/bm_hash_equal_value_object.rb +14 -0
- data/benchmark/bm_hash_equal_value_string.rb +11 -0
- data/benchmark/bm_hash_fetch_object.rb +11 -0
- data/benchmark/bm_hash_fetch_string.rb +9 -0
- data/benchmark/bm_hash_flatten_object.rb +9 -0
- data/benchmark/bm_hash_flatten_string.rb +9 -0
- data/benchmark/bm_hash_has_key_object.rb +11 -0
- data/benchmark/bm_hash_has_key_string.rb +9 -0
- data/benchmark/bm_hash_has_value_object.rb +9 -0
- data/benchmark/bm_hash_has_value_string.rb +9 -0
- data/benchmark/bm_hash_hash_object.rb +9 -0
- data/benchmark/bm_hash_hash_string.rb +9 -0
- data/benchmark/bm_hash_inspect_object.rb +9 -0
- data/benchmark/bm_hash_inspect_string.rb +9 -0
- data/benchmark/bm_hash_invert_object.rb +9 -0
- data/benchmark/bm_hash_invert_string.rb +9 -0
- data/benchmark/bm_hash_keep_if_object.rb +9 -0
- data/benchmark/bm_hash_keep_if_string.rb +9 -0
- data/benchmark/bm_hash_key_object.rb +9 -0
- data/benchmark/bm_hash_key_string.rb +9 -0
- data/benchmark/bm_hash_keys_object.rb +9 -0
- data/benchmark/bm_hash_keys_string.rb +9 -0
- data/benchmark/bm_hash_literal_mixed_large.rb +3 -0
- data/benchmark/bm_hash_literal_mixed_small.rb +3 -0
- data/benchmark/bm_hash_literal_object_large.rb +4 -0
- data/benchmark/bm_hash_literal_object_small.rb +3 -0
- data/benchmark/bm_hash_literal_string_large.rb +4 -0
- data/benchmark/bm_hash_literal_string_small.rb +3 -0
- data/benchmark/bm_hash_merge_object.rb +22 -0
- data/benchmark/bm_hash_merge_string.rb +18 -0
- data/benchmark/bm_hash_rassoc_object.rb +9 -0
- data/benchmark/bm_hash_rassoc_string.rb +9 -0
- data/benchmark/bm_hash_rehash_object.rb +9 -0
- data/benchmark/bm_hash_rehash_string.rb +9 -0
- data/benchmark/bm_hash_reject_bang_object.rb +9 -0
- data/benchmark/bm_hash_reject_bang_string.rb +9 -0
- data/benchmark/bm_hash_reject_object.rb +9 -0
- data/benchmark/bm_hash_reject_string.rb +9 -0
- data/benchmark/bm_hash_replace_object.rb +18 -0
- data/benchmark/bm_hash_replace_string.rb +14 -0
- data/benchmark/bm_hash_select_bang_object.rb +9 -0
- data/benchmark/bm_hash_select_bang_string.rb +9 -0
- data/benchmark/bm_hash_select_object.rb +9 -0
- data/benchmark/bm_hash_select_string.rb +9 -0
- data/benchmark/bm_hash_shift_object.rb +10 -0
- data/benchmark/bm_hash_shift_string.rb +10 -0
- data/benchmark/bm_hash_to_a_object.rb +9 -0
- data/benchmark/bm_hash_to_a_string.rb +9 -0
- data/benchmark/bm_hash_to_h_object.rb +10 -0
- data/benchmark/bm_hash_to_h_string.rb +10 -0
- data/benchmark/bm_hash_values_object.rb +9 -0
- data/benchmark/bm_hash_values_string.rb +9 -0
- data/benchmark/run.rb +48 -0
- data/bin/opal-mspec +1 -1
- data/bin/opal-repl +4 -4
- data/docs/compiled_ruby.md +214 -56
- data/docs/configuring_gems.md +2 -2
- data/docs/faq.md +2 -2
- data/docs/getting_started.md +19 -2
- data/docs/jquery.md +5 -5
- data/docs/opal_parser.md +53 -0
- data/docs/unsupported_features.md +2 -2
- data/docs/upgrading.md +22 -0
- data/docs/using_sprockets.md +15 -0
- data/examples/rack/config.ru +13 -0
- data/examples/sinatra/config.ru +4 -5
- data/lib/mspec/opal/runner.rb +54 -11
- data/lib/opal.rb +1 -1
- data/lib/opal/builder.rb +1 -1
- data/lib/opal/builder_processors.rb +1 -1
- data/lib/opal/cli.rb +17 -13
- data/lib/opal/cli_options.rb +1 -1
- data/lib/opal/compiler.rb +12 -0
- data/lib/opal/config.rb +4 -0
- data/lib/opal/nodes/arglist.rb +5 -7
- data/lib/opal/nodes/call.rb +6 -1
- data/lib/opal/nodes/call_special.rb +74 -0
- data/lib/opal/nodes/def.rb +35 -28
- data/lib/opal/nodes/definitions.rb +3 -5
- data/lib/opal/nodes/for.rb +13 -0
- data/lib/opal/nodes/helpers.rb +15 -1
- data/lib/opal/nodes/if.rb +5 -5
- data/lib/opal/nodes/iter.rb +6 -1
- data/lib/opal/nodes/literal.rb +1 -1
- data/lib/opal/nodes/logic.rb +2 -2
- data/lib/opal/nodes/masgn.rb +1 -2
- data/lib/opal/nodes/module.rb +2 -1
- data/lib/opal/nodes/rescue.rb +10 -1
- data/lib/opal/nodes/scope.rb +8 -2
- data/lib/opal/nodes/singleton_class.rb +1 -1
- data/lib/opal/nodes/top.rb +11 -0
- data/lib/opal/nodes/variables.rb +4 -4
- data/lib/opal/parser.rb +21 -3
- data/lib/opal/parser/grammar.rb +3115 -2961
- data/lib/opal/parser/grammar.y +29 -6
- data/lib/opal/parser/lexer.rb +18 -8
- data/lib/opal/sprockets.rb +85 -0
- data/lib/opal/sprockets/processor.rb +11 -35
- data/lib/opal/sprockets/server.rb +3 -15
- data/lib/opal/version.rb +2 -2
- data/opal.gemspec +4 -4
- data/opal/README.md +9 -0
- data/opal/corelib/array.rb +433 -181
- data/opal/corelib/basic_object.rb +48 -4
- data/opal/corelib/boolean.rb +15 -6
- data/opal/corelib/class.rb +6 -5
- data/opal/corelib/comparable.rb +12 -0
- data/opal/corelib/complex.rb +282 -0
- data/opal/corelib/constants.rb +9 -0
- data/opal/corelib/enumerable.rb +83 -34
- data/opal/corelib/enumerator.rb +3 -1
- data/opal/corelib/error.rb +49 -10
- data/opal/corelib/file.rb +1 -0
- data/opal/corelib/hash.rb +353 -577
- data/opal/corelib/helpers.rb +20 -0
- data/opal/corelib/kernel.rb +114 -59
- data/opal/corelib/math.rb +470 -0
- data/opal/corelib/method.rb +11 -2
- data/opal/corelib/module.rb +96 -96
- data/opal/corelib/{nil_class.rb → nil.rb} +20 -1
- data/opal/corelib/number.rb +751 -0
- data/opal/corelib/numeric.rb +77 -437
- data/opal/corelib/proc.rb +81 -1
- data/opal/corelib/process.rb +27 -0
- data/opal/corelib/rational.rb +358 -0
- data/opal/corelib/regexp.rb +156 -27
- data/opal/corelib/runtime.js +724 -335
- data/opal/corelib/string.rb +93 -104
- data/opal/corelib/string/encoding.rb +177 -0
- data/opal/corelib/string/inheritance.rb +2 -0
- data/opal/corelib/struct.rb +105 -18
- data/opal/corelib/time.rb +267 -146
- data/opal/corelib/unsupported.rb +216 -0
- data/opal/corelib/variables.rb +0 -6
- data/opal/opal.rb +8 -22
- data/opal/opal/base.rb +9 -0
- data/opal/opal/mini.rb +17 -0
- data/spec/README.md +1 -1
- data/spec/filters/bugs/array.rb +38 -136
- data/spec/filters/bugs/{basic_object.rb → basicobject.rb} +14 -15
- data/spec/filters/bugs/class.rb +6 -12
- data/spec/filters/bugs/complex.rb +3 -0
- data/spec/filters/bugs/date.rb +162 -10
- data/spec/filters/bugs/enumerable.rb +31 -58
- data/spec/filters/bugs/enumerator.rb +42 -0
- data/spec/filters/bugs/exception.rb +66 -10
- data/spec/filters/bugs/float.rb +17 -0
- data/spec/filters/bugs/hash.rb +11 -97
- data/spec/filters/bugs/inheritance.rb +5 -0
- data/spec/filters/bugs/integer.rb +28 -0
- data/spec/filters/bugs/kernel.rb +304 -12
- data/spec/filters/bugs/language.rb +133 -399
- data/spec/filters/bugs/language_opal.rb +88 -0
- data/spec/filters/bugs/module.rb +203 -62
- data/spec/filters/bugs/numeric.rb +32 -0
- data/spec/filters/bugs/proc.rb +39 -0
- data/spec/filters/bugs/range.rb +148 -0
- data/spec/filters/bugs/regexp.rb +168 -0
- data/spec/filters/bugs/set.rb +46 -3
- data/spec/filters/bugs/singleton.rb +1 -2
- data/spec/filters/bugs/string.rb +59 -90
- data/spec/filters/bugs/strscan.rb +80 -0
- data/spec/filters/bugs/struct.rb +10 -20
- data/spec/filters/bugs/time.rb +17 -184
- data/spec/filters/bugs/unboundmethod.rb +22 -0
- data/spec/filters/unsupported/array.rb +163 -0
- data/spec/filters/unsupported/basicobject.rb +14 -0
- data/spec/filters/unsupported/bignum.rb +46 -0
- data/spec/filters/unsupported/class.rb +4 -0
- data/spec/filters/unsupported/delegator.rb +5 -0
- data/spec/filters/unsupported/enumerable.rb +11 -0
- data/spec/filters/unsupported/enumerator.rb +8 -9
- data/spec/filters/unsupported/fixnum.rb +14 -0
- data/spec/filters/unsupported/float.rb +41 -7
- data/spec/filters/unsupported/freeze.rb +45 -0
- data/spec/filters/unsupported/hash.rb +50 -0
- data/spec/filters/unsupported/integer.rb +3 -0
- data/spec/filters/unsupported/kernel.rb +31 -0
- data/spec/filters/unsupported/language.rb +17 -0
- data/spec/filters/unsupported/matchdata.rb +30 -0
- data/spec/filters/unsupported/math.rb +3 -0
- data/spec/filters/unsupported/module.rb +5 -3
- data/spec/filters/unsupported/pathname.rb +3 -0
- data/spec/filters/unsupported/privacy.rb +136 -0
- data/spec/filters/unsupported/proc.rb +3 -0
- data/spec/filters/unsupported/regexp.rb +59 -0
- data/spec/filters/unsupported/set.rb +4 -0
- data/spec/filters/unsupported/{marshal.rb → singleton.rb} +4 -2
- data/spec/filters/unsupported/{mutable_strings.rb → string.rb} +456 -336
- data/spec/filters/unsupported/struct.rb +3 -0
- data/spec/filters/unsupported/symbol.rb +5 -0
- data/spec/filters/unsupported/taint.rb +16 -0
- data/spec/filters/unsupported/thread.rb +5 -0
- data/spec/filters/unsupported/time.rb +197 -16
- data/spec/lib/cli_spec.rb +14 -4
- data/spec/lib/compiler_spec.rb +9 -1
- data/spec/lib/parser/call_spec.rb +18 -0
- data/spec/lib/parser/not_spec.rb +2 -8
- data/spec/lib/sprockets_spec.rb +24 -0
- data/spec/opal/core/array/intersection_spec.rb +38 -0
- data/spec/opal/core/array/minus_spec.rb +38 -0
- data/spec/opal/core/array/union_spec.rb +38 -0
- data/spec/opal/core/array/uniq_spec.rb +49 -0
- data/spec/opal/core/exception_spec.rb +7 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 2.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 3.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/index.rb +3 -0
- data/spec/opal/core/hash/internals_spec.rb +332 -0
- data/spec/opal/core/helpers_spec.rb +14 -0
- data/spec/opal/core/kernel/freeze_spec.rb +1 -1
- data/spec/opal/core/kernel/raise_spec.rb +13 -0
- data/spec/opal/core/kernel/require_tree_spec.rb +9 -0
- data/spec/opal/core/language/class_spec.rb +55 -0
- data/spec/opal/core/language/fixtures/send.rb +1 -0
- data/spec/opal/core/language/keyword_arguments_spec.rb +11 -0
- data/spec/opal/core/language/send_spec.rb +5 -0
- data/spec/opal/core/method/to_proc_spec.rb +28 -0
- data/spec/opal/core/module/name_spec.rb +0 -17
- data/spec/opal/core/runtime/bridged_classes_spec.rb +2 -2
- data/spec/opal/core/runtime/eval_spec.rb +1 -1
- data/spec/opal/core/runtime/method_missing_spec.rb +6 -0
- data/spec/opal/core/runtime_spec.rb +51 -0
- data/spec/opal/stdlib/js_spec.rb +66 -0
- data/spec/opal/stdlib/native/hash_spec.rb +36 -0
- data/spec/rubyspecs +152 -273
- data/spec/spec_helper.rb +10 -11
- data/stdlib/base64.rb +9 -9
- data/stdlib/benchmark.rb +551 -4
- data/stdlib/console.rb +94 -0
- data/stdlib/date.rb +1 -1
- data/stdlib/encoding.rb +1 -170
- data/stdlib/js.rb +56 -0
- data/stdlib/json.rb +9 -14
- data/stdlib/math.rb +1 -370
- data/stdlib/native.rb +133 -63
- data/stdlib/nodejs/file.rb +5 -0
- data/stdlib/nodejs/fileutils.rb +13 -6
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/README.md +1 -1
- data/stdlib/opal-parser.rb +1 -2
- data/stdlib/ostruct.rb +65 -6
- data/stdlib/pp.rb +2 -4
- data/stdlib/rbconfig.rb +1 -3
- data/stdlib/strscan.rb +164 -28
- data/tasks/benchmarking.rake +88 -0
- data/tasks/testing.rake +181 -55
- data/{lib/mspec/opal/special_calls.rb → tasks/testing/mspec_special_calls.rb} +1 -1
- data/{lib/mspec/opal/sprockets.js → tasks/testing/phantomjs1-sprockets.js} +17 -6
- data/test/opal/test_keyword.rb +590 -0
- data/vendored-minitest/minitest.rb +2 -2
- data/vendored-minitest/test/unit.rb +5 -0
- metadata +229 -62
- data/benchmarks/operators.rb +0 -11
- data/benchmarks/prova.js.rb +0 -13
- data/docs/libraries.md +0 -36
- data/lib/mspec/opal/new.html.erb +0 -1
- data/lib/mspec/opal/rake_task.rb +0 -248
- data/opal/corelib/match_data.rb +0 -128
- data/spec/filters/bugs/math.rb +0 -95
- data/spec/filters/bugs/nil.rb +0 -7
- data/spec/filters/bugs/opal.rb +0 -9
- data/spec/filters/bugs/regular_expressions.rb +0 -41
- data/spec/filters/bugs/stringscanner.rb +0 -33
- data/spec/filters/unsupported/encoding.rb +0 -102
- data/spec/filters/unsupported/frozen.rb +0 -92
- data/spec/filters/unsupported/hash_compare_by_identity.rb +0 -16
- data/spec/filters/unsupported/integer_size.rb +0 -59
- data/spec/filters/unsupported/method_added.rb +0 -10
- data/spec/filters/unsupported/private_constants.rb +0 -30
- data/spec/filters/unsupported/private_methods.rb +0 -55
- data/spec/filters/unsupported/random.rb +0 -4
- data/spec/filters/unsupported/rational_numbers.rb +0 -4
- data/spec/filters/unsupported/regular_expressions.rb +0 -137
- data/spec/filters/unsupported/ruby_exe.rb +0 -5
- data/spec/filters/unsupported/symbols.rb +0 -17
- data/spec/filters/unsupported/tainted.rb +0 -180
- data/spec/filters/unsupported/trusted.rb +0 -88
- data/stdlib/process.rb +0 -10
- data/tasks/documenting.rake +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1af59805d32671acdce95d17776362c714d82c6d
|
4
|
+
data.tar.gz: cbe41468214bfdd99902f85301182b37a4281a8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 280f8bc25e11405068eb0794bc3c094885f2b43266b9dfa8716e1f25009118a5c0556ed8b8d489f1f406cc862817753fb70065eda5e744c3f2f0de142607611b
|
7
|
+
data.tar.gz: d4ad1d81debb785c025807f6d18281dd191df37efef3afb2d548e611aa36ecb44bbe43846a8fe900f03cec73ec1be0159483d3c18f373eda3beda498bb16aa2b
|
data/.gitignore
CHANGED
data/.gitmodules
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
[submodule "spec/
|
2
|
-
path = spec/
|
3
|
-
url = https://github.com/
|
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" :
|
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
|
-
|
27
|
-
"-
|
28
|
-
"-
|
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
|
-
"-
|
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
|
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=
|
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
|
-
|
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
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -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
|
19
|
-
and
|
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 - `
|
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/
|
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
|
-
$
|
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/
|
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
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/
|
54
|
+
when %r{^spec/rubyspec} then mspec path
|
55
55
|
when %r{^opal/corelib}
|
56
56
|
name = File.basename(path, '.rb')
|
57
|
-
mspec "spec/
|
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"]
|