opal-connect 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/opal/connect/plugins/dom.rb +2 -2
- data/lib/opal/connect/plugins/scope.rb +9 -1
- data/lib/opal/connect/version.rb +1 -1
- data/lib/opal/connect.rb +16 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1d9d0e4b7880c010ff5b17ff9077031ed0df2e2
|
4
|
+
data.tar.gz: 592334826cfa7c6f4fafeca24cdb630967f433ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32529be9df5f1916fdad47bebd6fe9173ee93f775d63cdf809ecf5fe24d3bf8aeca84a70a47bf0c02de33ef018bfd8770e2b2e0306b703ee673be58345a2f167
|
7
|
+
data.tar.gz: ebc1ccc26a4fdc011e59286632f5d0f68003380d49b9e818660f884b6cd821e4a46064c4526dfc18dca893e4dacf25939f5b8167ee527f9f3e66f437c31c9f1e
|
@@ -42,7 +42,7 @@ module Opal
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def cache
|
45
|
-
@cache ||= (Connect.templates[self.
|
45
|
+
@cache ||= (Connect.templates[self.class_name] ||= {})
|
46
46
|
end
|
47
47
|
|
48
48
|
def html(scope = false, &block)
|
@@ -66,7 +66,7 @@ module Opal
|
|
66
66
|
|
67
67
|
module InstanceMethods
|
68
68
|
def cache
|
69
|
-
self.class.
|
69
|
+
@cache ||= Connect.templates[self.class.name]
|
70
70
|
end
|
71
71
|
|
72
72
|
def dom(selector = false)
|
@@ -33,7 +33,15 @@ module Opal
|
|
33
33
|
if new_scope
|
34
34
|
@_scope = new(*args).scope(new_scope || Connect.options[:scope])
|
35
35
|
else
|
36
|
-
@_scope
|
36
|
+
@_scope ||= Connect.options[:scope]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def method_missing(method, *args, &block)
|
41
|
+
if scope && scope.respond_to?(method, true)
|
42
|
+
scope.send(method, *args, &block)
|
43
|
+
else
|
44
|
+
super
|
37
45
|
end
|
38
46
|
end
|
39
47
|
end
|
data/lib/opal/connect/version.rb
CHANGED
data/lib/opal/connect.rb
CHANGED
@@ -39,7 +39,18 @@ module Opal
|
|
39
39
|
end
|
40
40
|
|
41
41
|
unless block_given?
|
42
|
-
options[:setup_blocks].each
|
42
|
+
options[:setup_blocks].each do |b|
|
43
|
+
klass = Class.new do
|
44
|
+
include Opal::Connect
|
45
|
+
|
46
|
+
class << self
|
47
|
+
attr_accessor :class_name
|
48
|
+
end
|
49
|
+
end
|
50
|
+
klass.class_name = b[:klass].name
|
51
|
+
|
52
|
+
klass.instance_exec(&b[:block])
|
53
|
+
end
|
43
54
|
end
|
44
55
|
end
|
45
56
|
|
@@ -160,7 +171,10 @@ module Opal
|
|
160
171
|
def setup(&block)
|
161
172
|
if block_given?
|
162
173
|
@_setup_block = block
|
163
|
-
Connect.options[:setup_blocks] <<
|
174
|
+
Connect.options[:setup_blocks] << {
|
175
|
+
block: @_setup_block,
|
176
|
+
klass: self
|
177
|
+
}
|
164
178
|
end
|
165
179
|
|
166
180
|
@_setup_block
|