opal-connect 0.0.6 → 0.0.7

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: 7c48a1310589caa7e36aaacb8acf6bff2a7ebec6
4
- data.tar.gz: 32ead59d5c2e1805cba7fd4d91da25ff985393c2
3
+ metadata.gz: 83e6293b5dbdeba0a0e8e18b2f3ca15f95f1211a
4
+ data.tar.gz: 4c1ee68c4524e0a4ae159554741fc16794ebac14
5
5
  SHA512:
6
- metadata.gz: 29062865078205f2074876c04030b7cccbff36096288a0dbda78849e8c6429375b75701af9ae7624ee3a6c8c7404e508e0bce570bf90bb2f19420079a8b09e06
7
- data.tar.gz: 108ca591eb61cead5a639110963d2f975044c01194ce620b04b64e900000a4f52f8a7b5b8a6b145d16059f88d38e8b13b2ba583dd5db5f7150ae3802a996f71e
6
+ metadata.gz: 9791c43599a091ce63bf40eebbc4e12804d6fdb4a1e13bffeb476af1a07a829ec78c003f9eccae4a0e3c0d1b82cd719787499aca9a6a78c3d0224f524fb763c6
7
+ data.tar.gz: 1fe4fd8d48d19000bc79aa84629228a94f9901ae94105b8273c6ea442a7fe56f18a49d4794ceb366951e1ea9d54cacb7d57f781fdf94f95021114ae2748ebaaf
@@ -84,7 +84,7 @@ module Opal
84
84
  @dom = Element[selector]
85
85
  else
86
86
  # multi-line
87
- if selector["\n"]
87
+ if selector["\n"] || selector['html']
88
88
  @dom = Oga.parse_html(selector)
89
89
  else
90
90
  @dom = cache[:html]
@@ -19,6 +19,12 @@ module Opal
19
19
  end
20
20
  end
21
21
 
22
+ module ClassMethods
23
+ def html!(&block)
24
+ HTML::DSL.scope!(self).html!(&block).to_html
25
+ end
26
+ end
27
+
22
28
  # http://erikonrails.snowedin.net/?p=379
23
29
  class DSL
24
30
  def initialize(tag, *args, &block)
@@ -17,7 +17,7 @@ module Opal
17
17
 
18
18
  unless File.exist? opal_file_path
19
19
  builder = Opal::Builder.new
20
- build_str = '`require("expose?$!expose?jQuery!jquery")`; require "opal"; require "opal-jquery"; require "opal/connect"; require "opal-parser";'
20
+ build_str = '`require("expose?$!expose?jQuery!jquery")`; require "opal"; require "opal-jquery"; require "opal/connect";'
21
21
  builder.build_str(build_str, '(inline)', { dynamic_require_severity: :ignore })
22
22
  File.write opal_file_path, builder.to_s
23
23
  end
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Connect
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
data/lib/opal/connect.rb CHANGED
@@ -211,13 +211,10 @@ module Opal
211
211
  module InstanceMethods
212
212
  if RUBY_ENGINE != 'opal'
213
213
  def render(method, *options, &block)
214
- if hl = Connect.options[:hot_reload]
215
- hl = {} unless hl.is_a? Hash
216
- hl = { host: 'http://localhost', port: 8080 }.merge hl
217
-
214
+ if Connect.options[:hot_reload]
218
215
  Connect.write_entry_file(self, method, *options)
219
216
 
220
- "#{public_send(method, *options, &block)}<script src='#{hl[:host]}:#{hl[:port]}/main.js'></script>"
217
+ "#{public_send(method, *options, &block)}"
221
218
  else
222
219
  js = Connect.build Connect.javascript(self, method, *options)
223
220
 
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal