opal 0.3.20 → 0.3.21
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -7
- data/.rspec +2 -0
- data/.travis.yml +11 -0
- data/Gemfile +8 -2
- data/LICENSE +2 -3
- data/README.md +106 -239
- data/Rakefile +58 -16
- data/bin/opal +1 -0
- data/core/array.rb +180 -160
- data/core/basic_object.rb +8 -4
- data/core/boolean.rb +6 -6
- data/core/class.rb +9 -15
- data/core/dir.rb +89 -0
- data/core/enumerable.rb +83 -86
- data/core/error.rb +9 -4
- data/core/file.rb +85 -0
- data/core/hash.rb +67 -67
- data/core/kernel.rb +38 -42
- data/core/module.rb +57 -54
- data/core/numeric.rb +41 -41
- data/core/proc.rb +1 -5
- data/core/range.rb +11 -11
- data/core/regexp.rb +27 -22
- data/core/runtime.js +152 -221
- data/core/string.rb +86 -73
- data/core/time.rb +22 -18
- data/docs/post.html +9 -0
- data/docs/pre.html +32 -0
- data/lib/opal.rb +43 -3
- data/lib/opal/builder.rb +9 -26
- data/lib/opal/grammar.rb +1 -1
- data/lib/opal/grammar.y +1 -1
- data/lib/opal/lexer.rb +21 -15
- data/lib/opal/parser.rb +100 -111
- data/lib/opal/rake_task.rb +66 -0
- data/lib/opal/scope.rb +13 -5
- data/lib/opal/version.rb +1 -1
- data/opal.gemspec +2 -0
- data/spec/browser_spec.rb +28 -0
- data/spec/builder/lib_name_for_spec.rb +1 -6
- data/spec/grammar/alias_spec.rb +1 -1
- data/spec/grammar/and_spec.rb +1 -1
- data/spec/grammar/array_spec.rb +1 -1
- data/spec/grammar/attrasgn_spec.rb +1 -1
- data/spec/grammar/begin_spec.rb +1 -1
- data/spec/grammar/block_spec.rb +1 -1
- data/spec/grammar/break_spec.rb +1 -1
- data/spec/grammar/call_spec.rb +1 -1
- data/spec/grammar/class_spec.rb +1 -1
- data/spec/grammar/const_spec.rb +1 -1
- data/spec/grammar/cvar_spec.rb +1 -1
- data/spec/grammar/def_spec.rb +1 -1
- data/spec/grammar/false_spec.rb +1 -1
- data/spec/grammar/file_spec.rb +1 -1
- data/spec/grammar/gvar_spec.rb +1 -1
- data/spec/grammar/hash_spec.rb +1 -1
- data/spec/grammar/iasgn_spec.rb +1 -1
- data/spec/grammar/if_spec.rb +1 -1
- data/spec/grammar/iter_spec.rb +1 -1
- data/spec/grammar/ivar_spec.rb +1 -1
- data/spec/grammar/lambda_spec.rb +1 -1
- data/spec/grammar/lasgn_spec.rb +1 -1
- data/spec/grammar/line_spec.rb +1 -1
- data/spec/grammar/lvar_spec.rb +1 -1
- data/spec/grammar/masgn_spec.rb +1 -1
- data/spec/grammar/module_spec.rb +1 -1
- data/spec/grammar/nil_spec.rb +1 -1
- data/spec/grammar/not_spec.rb +1 -1
- data/spec/grammar/op_asgn1_spec.rb +1 -1
- data/spec/grammar/op_asgn2_spec.rb +1 -1
- data/spec/grammar/or_spec.rb +1 -1
- data/spec/grammar/return_spec.rb +1 -1
- data/spec/grammar/sclass_spec.rb +1 -1
- data/spec/grammar/self_spec.rb +1 -1
- data/spec/grammar/str_spec.rb +1 -1
- data/spec/grammar/super_spec.rb +1 -1
- data/spec/grammar/true_spec.rb +1 -1
- data/spec/grammar/undef_spec.rb +1 -1
- data/spec/grammar/unless_spec.rb +1 -1
- data/spec/grammar/while_spec.rb +1 -1
- data/spec/grammar/xstr_spec.rb +1 -1
- data/spec/grammar/yield_spec.rb +1 -1
- data/spec/spec_helper.rb +6 -1
- data/test/core/array/minus_spec.rb +13 -0
- data/test/core/enumerable/drop_while_spec.rb +0 -5
- data/test/core/range/case_compare_spec.rb +0 -1
- data/test/index.html +1 -1
- data/test/index.min.html +12 -0
- data/test/language/alias_spec.rb +0 -4
- data/test/language/fixtures/next.rb +62 -0
- data/test/language/metaclass_spec.rb +4 -4
- data/test/language/next_spec.rb +0 -63
- data/test/language/send_spec.rb +0 -5
- data/test/language/singleton_class_spec.rb +4 -0
- data/test/opal/array/subclassing_spec.rb +1 -1
- data/test/opal/class/bridge_class_spec.rb +2 -2
- data/test/opal/runtime/class_hierarchy_spec.rb +1 -2
- data/test/opal/runtime/method_missing_spec.rb +17 -0
- data/test/spec_helper.rb +4 -1
- metadata +32 -28
- data/docs/CNAME +0 -1
- data/docs/Rakefile +0 -55
- data/docs/css/styles.css +0 -50
- data/docs/css/syntax.css +0 -63
- data/docs/layout/post.html +0 -3
- data/docs/layout/pre.html +0 -11
- data/examples/dependencies/.gitignore +0 -1
- data/examples/dependencies/Gemfile +0 -6
- data/examples/dependencies/README.md +0 -41
- data/examples/dependencies/Rakefile +0 -10
- data/examples/dependencies/app.rb +0 -19
- data/examples/dependencies/build/.gitkeep +0 -0
- data/examples/dependencies/index.html +0 -13
- data/examples/hello_world/.gitignore +0 -1
- data/examples/hello_world/Gemfile +0 -3
- data/examples/hello_world/README.md +0 -27
- data/examples/hello_world/Rakefile +0 -23
- data/examples/hello_world/app.rb +0 -7
- data/examples/hello_world/index.html +0 -12
- data/lib/opal/builder_task.rb +0 -91
- data/spec/builder/build_order_spec.rb +0 -20
- data/test/opal/runtime/_methods_spec.rb +0 -48
@@ -1,20 +0,0 @@
|
|
1
|
-
require File.expand_path('../../spec_helper', __FILE__)
|
2
|
-
|
3
|
-
describe "Builder#build_order" do
|
4
|
-
before do
|
5
|
-
@builder = Opal::Builder.new
|
6
|
-
end
|
7
|
-
|
8
|
-
it "should return the list of files in the right order to build" do
|
9
|
-
@builder.build_order({ "a" => [], "b" => ["a"] }).should == ["a", "b"]
|
10
|
-
@builder.build_order({ "c" => ["d"], "d" => [] }).should == ["d", "c"]
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should ignore dependencies not in local files" do
|
14
|
-
@builder.build_order({ "a" => ["b", "c"], "c" => [] }).should == ["c", "a"]
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should include any files that don't get required" do
|
18
|
-
@builder.build_order({ "a" => [], "b" => [], "c" => [] }).should == ["a", "b", "c"]
|
19
|
-
end
|
20
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
class RuntimeMethodsSpec
|
2
|
-
end
|
3
|
-
|
4
|
-
class RuntimeMethodsSpec2
|
5
|
-
def foo; end
|
6
|
-
def bar; end
|
7
|
-
end
|
8
|
-
|
9
|
-
class RuntimeMethodsSpec3
|
10
|
-
def woosh; end
|
11
|
-
end
|
12
|
-
|
13
|
-
class RuntimeMethodsSpec3
|
14
|
-
def kapow; end
|
15
|
-
end
|
16
|
-
|
17
|
-
module RuntimeMethodsSpec4
|
18
|
-
def ding; end
|
19
|
-
end
|
20
|
-
|
21
|
-
module RuntimeMethodsSpec4
|
22
|
-
def dong; end
|
23
|
-
end
|
24
|
-
|
25
|
-
class RuntimeMethodsSpec5
|
26
|
-
include RuntimeMethodsSpec4
|
27
|
-
|
28
|
-
def thor; end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe "Class._methods private array" do
|
32
|
-
it "should store a list of all defined methods on classes as jsid's" do
|
33
|
-
`#{RuntimeMethodsSpec}._methods`.should == []
|
34
|
-
`#{RuntimeMethodsSpec2}._methods`.should == ['$foo', '$bar']
|
35
|
-
end
|
36
|
-
|
37
|
-
it "correctly adds methods when reopening classes" do
|
38
|
-
`#{RuntimeMethodsSpec3}._methods`.should == ['$woosh', '$kapow']
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should store methods for modules" do
|
42
|
-
`#{RuntimeMethodsSpec4}._methods`.should == ['$ding', '$dong']
|
43
|
-
end
|
44
|
-
|
45
|
-
it "should not include methods from included modules" do
|
46
|
-
`#{RuntimeMethodsSpec5}._methods`.should == ['$thor']
|
47
|
-
end
|
48
|
-
end
|