opal 0.3.28 → 0.3.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -10,5 +10,5 @@ end
10
10
 
11
11
  # running tests on command line
12
12
  group :testing do
13
- gem 'opal-spec', :git => 'git://github.com/opal/opal-spec.git'
13
+ gem 'opal-spec'
14
14
  end
data/core/class.rb CHANGED
@@ -73,6 +73,10 @@ class Class
73
73
  prototype[method] = donator[method];
74
74
  }
75
75
 
76
+ if (prototype._smethods) {
77
+ prototype._sdonate(methods);
78
+ }
79
+
76
80
  if (klass.$included_in) {
77
81
  klass._donate(methods.slice(), true);
78
82
  }
data/core/kernel.rb CHANGED
@@ -198,7 +198,7 @@ module Kernel
198
198
  %x{
199
199
  for (var i = 0; i < strs.length; i++) {
200
200
  if(strs[i] instanceof Array) {
201
- #{ puts *strs }
201
+ #{ puts *`strs[i]` }
202
202
  } else {
203
203
  __opal.puts(#{ `strs[i]`.to_s });
204
204
  }
data/lib/opal/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Opal
2
- VERSION = '0.3.28'
2
+ VERSION = '0.3.29'
3
3
  end
@@ -0,0 +1,47 @@
1
+ module ClassExtendSpecs
2
+ module M1
3
+ def foo
4
+ :class_foo
5
+ end
6
+
7
+ def bar
8
+ :class_bar
9
+ end
10
+ end
11
+
12
+ class C1
13
+ extend M1
14
+ end
15
+
16
+ class C2 < C1
17
+ end
18
+
19
+ class C3 < C1
20
+ end
21
+
22
+ class C4 < C3
23
+ end
24
+ end
25
+
26
+ describe "Class#extend" do
27
+ it "class should get module methods added as class methods" do
28
+ ClassExtendSpecs::C1.foo.should == :class_foo
29
+ ClassExtendSpecs::C1.bar.should == :class_bar
30
+ end
31
+
32
+ it "class should add included methods to its .methods array" do
33
+ ClassExtendSpecs::C1.methods.include?(:foo).should be_true
34
+ ClassExtendSpecs::C1.methods.include?(:bar).should be_true
35
+ end
36
+
37
+ it "subclasses should have methods defined from superclass" do
38
+ ClassExtendSpecs::C2.foo.should == :class_foo
39
+ ClassExtendSpecs::C2.bar.should == :class_bar
40
+
41
+ ClassExtendSpecs::C3.foo.should == :class_foo
42
+ ClassExtendSpecs::C3.bar.should == :class_bar
43
+
44
+ ClassExtendSpecs::C4.foo.should == :class_foo
45
+ ClassExtendSpecs::C4.bar.should == :class_bar
46
+ end
47
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.28
4
+ version: 0.3.29
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-27 00:00:00.000000000Z
12
+ date: 2012-10-28 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Ruby runtime and core library for javascript.
15
15
  email: adam.beynon@gmail.com
@@ -128,6 +128,7 @@ files:
128
128
  - spec/core/boolean/to_s_spec.rb
129
129
  - spec/core/boolean/xor_spec.rb
130
130
  - spec/core/class/bridge_class_spec.rb
131
+ - spec/core/class/extend_spec.rb
131
132
  - spec/core/class/fixtures/classes.rb
132
133
  - spec/core/class/instance_methods_spec.rb
133
134
  - spec/core/class/last_value_spec.rb
@@ -507,6 +508,7 @@ test_files:
507
508
  - spec/core/boolean/to_s_spec.rb
508
509
  - spec/core/boolean/xor_spec.rb
509
510
  - spec/core/class/bridge_class_spec.rb
511
+ - spec/core/class/extend_spec.rb
510
512
  - spec/core/class/fixtures/classes.rb
511
513
  - spec/core/class/instance_methods_spec.rb
512
514
  - spec/core/class/last_value_spec.rb