opal-connect 0.0.7 → 0.0.8

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: 83e6293b5dbdeba0a0e8e18b2f3ca15f95f1211a
4
- data.tar.gz: 4c1ee68c4524e0a4ae159554741fc16794ebac14
3
+ metadata.gz: 9cff9dcf8a66a0ca2119adcf3fce943b40b03cba
4
+ data.tar.gz: c875f500590d114afef77540202d8825291a9874
5
5
  SHA512:
6
- metadata.gz: 9791c43599a091ce63bf40eebbc4e12804d6fdb4a1e13bffeb476af1a07a829ec78c003f9eccae4a0e3c0d1b82cd719787499aca9a6a78c3d0224f524fb763c6
7
- data.tar.gz: 1fe4fd8d48d19000bc79aa84629228a94f9901ae94105b8273c6ea442a7fe56f18a49d4794ceb366951e1ea9d54cacb7d57f781fdf94f95021114ae2748ebaaf
6
+ metadata.gz: 7e8fbfe0d1925ed42764343cec7ebd1629c56ec4ef980d8110a4dfd5b282967ad94faddfeb8b3137004ef88afce88b4bc2e4e17fd4da0ba249145f5f42a9aa0e
7
+ data.tar.gz: 662b9cbeafd47b5f3b7b0a682315112b9e4473ee9214c11dcdd3d59ad7d30f193a947652d96291c2e38946da36152117b881f05e07679085c29ad1f287b1cc83
@@ -69,6 +69,7 @@ module Opal
69
69
  @dom ||= Instance.new selector, cache, self
70
70
  end
71
71
  end
72
+ alias element dom
72
73
  end
73
74
 
74
75
  class Instance
@@ -96,6 +97,8 @@ module Opal
96
97
  end
97
98
  end
98
99
 
100
+ alias element dom
101
+
99
102
  def set html
100
103
  @dom = Instance.new(html, cache, scope)
101
104
  @dom.save!
@@ -219,7 +222,7 @@ module Opal
219
222
  end
220
223
  end
221
224
 
222
- self
225
+ # self
223
226
  end
224
227
 
225
228
  def prepend(content = false, &block)
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Connect
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
data/lib/opal/connect.rb CHANGED
@@ -211,10 +211,19 @@ module Opal
211
211
  module InstanceMethods
212
212
  if RUBY_ENGINE != 'opal'
213
213
  def render(method, *options, &block)
214
- if Connect.options[:hot_reload]
214
+ if hl = Connect.options[:hot_reload]
215
215
  Connect.write_entry_file(self, method, *options)
216
216
 
217
- "#{public_send(method, *options, &block)}"
217
+ html = "#{public_send(method, *options, &block)}"
218
+
219
+ if hl.is_a?(Hash) && file_name = hl[:javascript_file_name]
220
+ hl = {} unless hl.is_a? Hash
221
+ hl = { host: 'http://localhost', port: 8080 }.merge hl
222
+
223
+ html = "#{html}<script src='#{hl[:host]}:#{hl[:port]}/#{file_name}.js'></script>"
224
+ end
225
+
226
+ html
218
227
  else
219
228
  js = Connect.build Connect.javascript(self, method, *options)
220
229
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal