opal-jquery 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/opal/jquery/version.rb +1 -1
- data/opal-jquery.gemspec +1 -1
- data/opal/opal-jquery/element.rb +1 -13
- data/spec/element/method_missing_spec.rb +6 -2
- metadata +4 -4
data/lib/opal/jquery/version.rb
CHANGED
data/opal-jquery.gemspec
CHANGED
@@ -15,6 +15,6 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
16
|
s.require_paths = ['lib']
|
17
17
|
|
18
|
-
s.add_runtime_dependency 'opal', '>= 0.4.
|
18
|
+
s.add_runtime_dependency 'opal', '>= 0.4.4'
|
19
19
|
s.add_development_dependency 'opal-spec', '>= 0.3.0'
|
20
20
|
end
|
data/opal/opal-jquery/element.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Element
|
2
2
|
%x{
|
3
|
-
var root =
|
3
|
+
var root = $opal.global, dom_class;
|
4
4
|
|
5
5
|
if (root.jQuery) {
|
6
6
|
dom_class = jQuery
|
@@ -89,18 +89,6 @@ class Element
|
|
89
89
|
alias_native :slide_toggle, :slideToggle
|
90
90
|
alias_native :fade_toggle, :fadeToggle
|
91
91
|
|
92
|
-
# Missing methods are assumed to be jquery plugins. These are called by
|
93
|
-
# the given symbol name.
|
94
|
-
def method_missing(symbol, *args, &block)
|
95
|
-
%x{
|
96
|
-
if (#{self}[#{symbol}]) {
|
97
|
-
return #{self}[#{symbol}].apply(#{self}, args);
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
|
-
super
|
102
|
-
end
|
103
|
-
|
104
92
|
def to_n
|
105
93
|
self
|
106
94
|
end
|
@@ -11,8 +11,12 @@ require "spec_helper"
|
|
11
11
|
};
|
12
12
|
}
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
class Element
|
15
|
+
expose :opal_specs_extension, :opal_specs_args
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "Element#exposes" do
|
19
|
+
it "exposes jquery plugins by given name" do
|
16
20
|
Element.new.opal_specs_extension.should eq("foo_bar_baz")
|
17
21
|
end
|
18
22
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-jquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
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: 2013-
|
12
|
+
date: 2013-08-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: opal
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.4.
|
21
|
+
version: 0.4.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.4.
|
29
|
+
version: 0.4.4
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: opal-spec
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|