opal 0.7.0.beta1 → 0.7.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.gitmodules +1 -1
- data/.inch.yml +19 -0
- data/.travis.yml +10 -7
- data/CHANGELOG.md +23 -0
- data/README.md +2 -2
- data/Rakefile +43 -1
- data/bin/opal +6 -1
- data/lib/mspec/opal/rake_task.rb +10 -31
- data/lib/mspec/opal/runner.rb +44 -1
- data/lib/mspec/opal/special_calls.rb +25 -0
- data/lib/opal/builder.rb +1 -1
- data/lib/opal/builder_processors.rb +4 -23
- data/lib/opal/cli.rb +17 -11
- data/lib/opal/cli_options.rb +1 -1
- data/lib/opal/cli_runners.rb +1 -0
- data/lib/opal/cli_runners/apple_script.rb +65 -0
- data/lib/opal/cli_runners/nodejs.rb +9 -3
- data/lib/opal/cli_runners/phantomjs.rb +2 -2
- data/lib/opal/cli_runners/server.rb +7 -5
- data/lib/opal/compiler.rb +1 -1
- data/lib/opal/nodes/call.rb +3 -2
- data/lib/opal/nodes/constants.rb +3 -3
- data/lib/opal/nodes/def.rb +7 -7
- data/lib/opal/nodes/defined.rb +2 -2
- data/lib/opal/nodes/definitions.rb +1 -1
- data/lib/opal/nodes/literal.rb +1 -1
- data/lib/opal/nodes/logic.rb +1 -1
- data/lib/opal/nodes/masgn.rb +1 -1
- data/lib/opal/nodes/module.rb +1 -1
- data/lib/opal/nodes/rescue.rb +1 -1
- data/lib/opal/nodes/scope.rb +1 -1
- data/lib/opal/nodes/super.rb +3 -3
- data/lib/opal/nodes/top.rb +11 -9
- data/lib/opal/nodes/variables.rb +39 -6
- data/lib/opal/nodes/yield.rb +3 -3
- data/lib/opal/parser.rb +3 -1
- data/lib/opal/parser/lexer.rb +8 -2
- data/lib/opal/paths.rb +13 -3
- data/lib/opal/sprockets/server.rb +1 -1
- data/lib/opal/version.rb +1 -1
- data/opal.gemspec +1 -1
- data/opal/corelib/array.rb +29 -20
- data/opal/corelib/array/inheritance.rb +3 -3
- data/opal/corelib/basic_object.rb +3 -1
- data/opal/corelib/class.rb +1 -1
- data/opal/corelib/comparable.rb +6 -5
- data/opal/corelib/dir.rb +4 -4
- data/opal/corelib/enumerable.rb +25 -25
- data/opal/corelib/enumerator.rb +16 -14
- data/opal/corelib/error.rb +13 -4
- data/opal/corelib/hash.rb +511 -162
- data/opal/corelib/helpers.rb +1 -1
- data/opal/corelib/kernel.rb +60 -44
- data/opal/corelib/match_data.rb +1 -10
- data/opal/corelib/method.rb +1 -1
- data/opal/corelib/module.rb +62 -32
- data/opal/corelib/nil_class.rb +1 -6
- data/opal/corelib/numeric.rb +6 -3
- data/opal/corelib/proc.rb +1 -1
- data/opal/corelib/regexp.rb +15 -6
- data/opal/corelib/runtime.js +57 -36
- data/opal/corelib/string.rb +38 -2
- data/opal/corelib/string/inheritance.rb +3 -3
- data/opal/corelib/struct.rb +1 -1
- data/opal/corelib/time.rb +46 -3
- data/spec/filters/bugs/date.rb +15 -0
- data/spec/filters/bugs/enumerator.rb +7 -0
- data/spec/filters/bugs/exception.rb +12 -0
- data/spec/filters/bugs/hash.rb +0 -18
- data/spec/filters/bugs/match_data.rb +13 -0
- data/spec/filters/bugs/module.rb +13 -0
- data/spec/filters/bugs/numeric.rb +2 -0
- data/spec/filters/bugs/regexp.rb +0 -2
- data/spec/filters/bugs/stringscanner.rb +8 -0
- data/spec/filters/bugs/time.rb +1 -1
- data/spec/filters/unsupported/float.rb +1 -0
- data/spec/filters/unsupported/symbols.rb +10 -0
- data/spec/filters/unsupported/tainted.rb +3 -0
- data/spec/filters/unsupported/trusted.rb +3 -0
- data/spec/lib/compiler_spec.rb +2 -2
- data/spec/lib/parser/call_spec.rb +7 -0
- data/spec/opal/core/date_spec.rb +49 -8
- data/spec/opal/core/exception_spec.rb +13 -0
- data/spec/opal/core/fixtures/require_tree_files/nested/nested 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/nested/nested 2.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/other/other 1.rb +1 -0
- data/spec/opal/core/kernel/require_tree_spec.rb +3 -1
- data/spec/opal/core/language/predefined_spec.rb +43 -0
- data/spec/opal/stdlib/promise/rescue_spec.rb +9 -0
- data/spec/opal/stdlib/promise/then_spec.rb +9 -0
- data/spec/opal/stdlib/promise/trace_spec.rb +9 -0
- data/spec/rubyspecs +40 -19
- data/spec/spec_helper.rb +10 -5
- data/stdlib/date.rb +68 -8
- data/stdlib/fileutils.rb +0 -0
- data/stdlib/iconv.rb +0 -0
- data/stdlib/json.rb +16 -3
- data/stdlib/native.rb +36 -17
- data/stdlib/nodejs.rb +3 -0
- data/stdlib/nodejs/dir.rb +1 -1
- data/stdlib/nodejs/file.rb +2 -2
- data/stdlib/nodejs/io.rb +1 -1
- data/stdlib/nodejs/process.rb +2 -2
- data/stdlib/nodejs/require.rb +5 -7
- data/stdlib/nodejs/runtime.rb +3 -2
- data/stdlib/pathname.rb +25 -1
- data/stdlib/promise.rb +16 -0
- data/stdlib/set.rb +48 -4
- data/stdlib/strscan.rb +12 -1
- data/stdlib/yaml.rb +1 -0
- metadata +27 -7
- data/spec/opal/core/language/symbol_spec.rb +0 -40
@@ -1,40 +0,0 @@
|
|
1
|
-
describe "A Symbol literal" do
|
2
|
-
it "is a ':' followed by any number of valid characters" do
|
3
|
-
a = :foo
|
4
|
-
a.should be_kind_of(Symbol)
|
5
|
-
# FIXME: this doesnt work as Symbols are Strings
|
6
|
-
#a.inspect.should == ':foo'
|
7
|
-
end
|
8
|
-
|
9
|
-
it "is a ':' followed by any valid variable, method, or constant name" do
|
10
|
-
# Add more of these?
|
11
|
-
[ :Foo,
|
12
|
-
:foo,
|
13
|
-
:@foo,
|
14
|
-
:@@foo,
|
15
|
-
:$foo,
|
16
|
-
:_,
|
17
|
-
:~,
|
18
|
-
:-,
|
19
|
-
:FOO,
|
20
|
-
:_Foo,
|
21
|
-
:&,
|
22
|
-
:_9
|
23
|
-
].each { |s| s.should be_kind_of(Symbol) }
|
24
|
-
end
|
25
|
-
|
26
|
-
it "is a ':' followed by a single- or double-quoted string that may contain otherwise invalid characters" do
|
27
|
-
[ [:'foo bar', ':"foo bar"'],
|
28
|
-
[:'++', ':"++"'],
|
29
|
-
[:'9', ':"9"'],
|
30
|
-
[:"foo #{1 + 1}", ':"foo 2"']
|
31
|
-
].each {
|
32
|
-
# FIXME: Symbols are Strings, so #inspect wont work
|
33
|
-
1.should == 1
|
34
|
-
}
|
35
|
-
end
|
36
|
-
|
37
|
-
it "may contain '::' in the string" do
|
38
|
-
:'Some::Class'.should be_kind_of(Symbol)
|
39
|
-
end
|
40
|
-
end
|