opal-connect 0.0.12 → 0.0.13
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.rb +10 -1
- data/lib/opal/connect/version.rb +1 -1
- 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: 7ef662424f8bb11baa278d0bf6533507f85b5a9b
|
4
|
+
data.tar.gz: 420e337deeea7e370069c8efcf1c42eace4422ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: feaf9a7bab608966b709ec38bedbecb2dcdf72c62647524f89feb381de6f3e7926ca6377c9c21471d7d4bb1d4738baeb198ffff1c80f5a81c15ada25a5a8f591
|
7
|
+
data.tar.gz: 3123e9949594dc7fd069bf3673ff669e6bb638f43e75e9e6869911520187180d19e55ad5720c59ab39c2bd2ffb4206baa87ba457975aaf55625c3dbf206c62dd
|
data/lib/opal/connect.rb
CHANGED
@@ -35,6 +35,10 @@ module Opal
|
|
35
35
|
|
36
36
|
# make sure we include the default plugins with connect
|
37
37
|
options[:plugins].each { |plug| Connect.plugin plug }
|
38
|
+
|
39
|
+
unless block_given?
|
40
|
+
options[:setup_blocks].each { |b| Class.new { include Opal::Connect }.instance_exec(&b) }
|
41
|
+
end
|
38
42
|
end
|
39
43
|
|
40
44
|
def included(klass)
|
@@ -152,7 +156,12 @@ module Opal
|
|
152
156
|
end
|
153
157
|
|
154
158
|
def setup(&block)
|
155
|
-
|
159
|
+
if block_given?
|
160
|
+
@_setup_block = block
|
161
|
+
Connect.options[:setup_blocks] << @_setup_block
|
162
|
+
end
|
163
|
+
|
164
|
+
@_setup_block
|
156
165
|
end
|
157
166
|
|
158
167
|
# Load a new plugin into the current class. A plugin can be a module
|
data/lib/opal/connect/version.rb
CHANGED