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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a4f723259bbc5caf0cf55ca0439762264fe2828
4
- data.tar.gz: b572c93f4beeb56dbf818d10cdf0fa4abefed563
3
+ metadata.gz: 7ef662424f8bb11baa278d0bf6533507f85b5a9b
4
+ data.tar.gz: 420e337deeea7e370069c8efcf1c42eace4422ca
5
5
  SHA512:
6
- metadata.gz: 7b380aa3445e9c5e2beaa8f777fa73363eae33f1348f2f1fdb0d7fa5661e3e23c815dc1c59887955e3bc723d8701fd97fe190ffe82d6523e05354cc985241681
7
- data.tar.gz: db0df05c4c75d3c7593eeb8bce395887458ebc1fe89f10b9d4a7b6fe731bc179919ffd288782f7082582f66412550f6bbf596f9d0212e2c4815d92fa42abfbde
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
- Class.new { include Opal::Connect }.instance_exec(&block) if block_given?
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
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Connect
3
- VERSION = "0.0.12"
3
+ VERSION = "0.0.13"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj