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.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.gitmodules +1 -1
  4. data/.inch.yml +19 -0
  5. data/.travis.yml +10 -7
  6. data/CHANGELOG.md +23 -0
  7. data/README.md +2 -2
  8. data/Rakefile +43 -1
  9. data/bin/opal +6 -1
  10. data/lib/mspec/opal/rake_task.rb +10 -31
  11. data/lib/mspec/opal/runner.rb +44 -1
  12. data/lib/mspec/opal/special_calls.rb +25 -0
  13. data/lib/opal/builder.rb +1 -1
  14. data/lib/opal/builder_processors.rb +4 -23
  15. data/lib/opal/cli.rb +17 -11
  16. data/lib/opal/cli_options.rb +1 -1
  17. data/lib/opal/cli_runners.rb +1 -0
  18. data/lib/opal/cli_runners/apple_script.rb +65 -0
  19. data/lib/opal/cli_runners/nodejs.rb +9 -3
  20. data/lib/opal/cli_runners/phantomjs.rb +2 -2
  21. data/lib/opal/cli_runners/server.rb +7 -5
  22. data/lib/opal/compiler.rb +1 -1
  23. data/lib/opal/nodes/call.rb +3 -2
  24. data/lib/opal/nodes/constants.rb +3 -3
  25. data/lib/opal/nodes/def.rb +7 -7
  26. data/lib/opal/nodes/defined.rb +2 -2
  27. data/lib/opal/nodes/definitions.rb +1 -1
  28. data/lib/opal/nodes/literal.rb +1 -1
  29. data/lib/opal/nodes/logic.rb +1 -1
  30. data/lib/opal/nodes/masgn.rb +1 -1
  31. data/lib/opal/nodes/module.rb +1 -1
  32. data/lib/opal/nodes/rescue.rb +1 -1
  33. data/lib/opal/nodes/scope.rb +1 -1
  34. data/lib/opal/nodes/super.rb +3 -3
  35. data/lib/opal/nodes/top.rb +11 -9
  36. data/lib/opal/nodes/variables.rb +39 -6
  37. data/lib/opal/nodes/yield.rb +3 -3
  38. data/lib/opal/parser.rb +3 -1
  39. data/lib/opal/parser/lexer.rb +8 -2
  40. data/lib/opal/paths.rb +13 -3
  41. data/lib/opal/sprockets/server.rb +1 -1
  42. data/lib/opal/version.rb +1 -1
  43. data/opal.gemspec +1 -1
  44. data/opal/corelib/array.rb +29 -20
  45. data/opal/corelib/array/inheritance.rb +3 -3
  46. data/opal/corelib/basic_object.rb +3 -1
  47. data/opal/corelib/class.rb +1 -1
  48. data/opal/corelib/comparable.rb +6 -5
  49. data/opal/corelib/dir.rb +4 -4
  50. data/opal/corelib/enumerable.rb +25 -25
  51. data/opal/corelib/enumerator.rb +16 -14
  52. data/opal/corelib/error.rb +13 -4
  53. data/opal/corelib/hash.rb +511 -162
  54. data/opal/corelib/helpers.rb +1 -1
  55. data/opal/corelib/kernel.rb +60 -44
  56. data/opal/corelib/match_data.rb +1 -10
  57. data/opal/corelib/method.rb +1 -1
  58. data/opal/corelib/module.rb +62 -32
  59. data/opal/corelib/nil_class.rb +1 -6
  60. data/opal/corelib/numeric.rb +6 -3
  61. data/opal/corelib/proc.rb +1 -1
  62. data/opal/corelib/regexp.rb +15 -6
  63. data/opal/corelib/runtime.js +57 -36
  64. data/opal/corelib/string.rb +38 -2
  65. data/opal/corelib/string/inheritance.rb +3 -3
  66. data/opal/corelib/struct.rb +1 -1
  67. data/opal/corelib/time.rb +46 -3
  68. data/spec/filters/bugs/date.rb +15 -0
  69. data/spec/filters/bugs/enumerator.rb +7 -0
  70. data/spec/filters/bugs/exception.rb +12 -0
  71. data/spec/filters/bugs/hash.rb +0 -18
  72. data/spec/filters/bugs/match_data.rb +13 -0
  73. data/spec/filters/bugs/module.rb +13 -0
  74. data/spec/filters/bugs/numeric.rb +2 -0
  75. data/spec/filters/bugs/regexp.rb +0 -2
  76. data/spec/filters/bugs/stringscanner.rb +8 -0
  77. data/spec/filters/bugs/time.rb +1 -1
  78. data/spec/filters/unsupported/float.rb +1 -0
  79. data/spec/filters/unsupported/symbols.rb +10 -0
  80. data/spec/filters/unsupported/tainted.rb +3 -0
  81. data/spec/filters/unsupported/trusted.rb +3 -0
  82. data/spec/lib/compiler_spec.rb +2 -2
  83. data/spec/lib/parser/call_spec.rb +7 -0
  84. data/spec/opal/core/date_spec.rb +49 -8
  85. data/spec/opal/core/exception_spec.rb +13 -0
  86. data/spec/opal/core/fixtures/require_tree_files/nested/nested 1.rb +1 -0
  87. data/spec/opal/core/fixtures/require_tree_files/nested/nested 2.rb +1 -0
  88. data/spec/opal/core/fixtures/require_tree_files/other/other 1.rb +1 -0
  89. data/spec/opal/core/kernel/require_tree_spec.rb +3 -1
  90. data/spec/opal/core/language/predefined_spec.rb +43 -0
  91. data/spec/opal/stdlib/promise/rescue_spec.rb +9 -0
  92. data/spec/opal/stdlib/promise/then_spec.rb +9 -0
  93. data/spec/opal/stdlib/promise/trace_spec.rb +9 -0
  94. data/spec/rubyspecs +40 -19
  95. data/spec/spec_helper.rb +10 -5
  96. data/stdlib/date.rb +68 -8
  97. data/stdlib/fileutils.rb +0 -0
  98. data/stdlib/iconv.rb +0 -0
  99. data/stdlib/json.rb +16 -3
  100. data/stdlib/native.rb +36 -17
  101. data/stdlib/nodejs.rb +3 -0
  102. data/stdlib/nodejs/dir.rb +1 -1
  103. data/stdlib/nodejs/file.rb +2 -2
  104. data/stdlib/nodejs/io.rb +1 -1
  105. data/stdlib/nodejs/process.rb +2 -2
  106. data/stdlib/nodejs/require.rb +5 -7
  107. data/stdlib/nodejs/runtime.rb +3 -2
  108. data/stdlib/pathname.rb +25 -1
  109. data/stdlib/promise.rb +16 -0
  110. data/stdlib/set.rb +48 -4
  111. data/stdlib/strscan.rb +12 -1
  112. data/stdlib/yaml.rb +1 -0
  113. metadata +27 -7
  114. 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