wedge 0.1.78 → 0.2.0

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: ac088a0773d950f12a613d80bfd7da102211a275
4
- data.tar.gz: 44ee096e0d28c29827b3abebf15f0e7ff8534234
3
+ metadata.gz: 3cc2ac92d6123dd277d83d4fab758ba933fe8192
4
+ data.tar.gz: 88b67e5949b1f3ee451f9ff9ec7fbe0dd24f4fed
5
5
  SHA512:
6
- metadata.gz: cd9135fc482bd487c9e815a0f722219d72cb9b5cdadd1b6f4ce36e75063f36d31a5212a1abc3027aeb9c8768745856454e1c0b143f48448fd6fd0ea99eaf074d
7
- data.tar.gz: 05c080da68d44f4ca80c0a63a406f21036cbe39d75baad11539973b2f2553cef2418e47780477b4ca7979ddc8bffefd6301f273493afd0121ba5c287dba7b824
6
+ metadata.gz: 6f49f7b7ce844c662393f0a850d7ba48827167bd2f16f13a002e0f6f63a11d14e6135d96ba28238c2ec400e5eccfd9b3a5a1a762f2a3ae16943b797fd017b13e
7
+ data.tar.gz: 9f051c6e624981cdc1d65459216d4182e01081f67944215d25bf6fceb8ed1c0a729a51deddc24f0286853a21873f91e8211280c95cb7a41f8bb1d4b9bae05608
@@ -205,7 +205,11 @@ class Wedge
205
205
 
206
206
  res = JSON.from_object(`response`)
207
207
 
208
- blk.call res[:body], res
208
+ results = blk.call res[:body], res
209
+
210
+ # Element.trigger 'wedge:call-finished'
211
+
212
+ results
209
213
  end
210
214
  else
211
215
  data = {
@@ -377,9 +381,17 @@ class Wedge
377
381
  )
378
382
 
379
383
  compiled_opts = Base64.encode64 client_data.to_json
380
- javascript = <<-JS
381
- Wedge.javascript('#{config.path}', JSON.parse(Base64.decode64('#{compiled_opts}')))
382
- JS
384
+
385
+ begin
386
+ javascript = <<-JS
387
+ Wedge.javascript('#{config.path}', JSON.parse(Base64.decode64('#{compiled_opts}')), '#{javascript_path(config.path)}')
388
+ JS
389
+ rescue
390
+ javascript = <<-JS
391
+ Wedge.javascript('#{config.path}', JSON.parse(Base64.decode64('#{compiled_opts}')))
392
+ JS
393
+ end
394
+
383
395
  "<script>#{Opal.compile(javascript)}</script>"
384
396
  end
385
397
  alias_method :javscript, :wedge_javascript
data/lib/wedge/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Wedge
2
- VERSION = '0.1.78'
2
+ VERSION = '0.2.0'
3
3
  end
data/lib/wedge.rb CHANGED
@@ -203,7 +203,7 @@ class Wedge
203
203
  end
204
204
 
205
205
  # Return the opal javascript.
206
- def javascript(path_name = 'wedge', options = {})
206
+ def javascript(path_name = 'wedge', options = {}, url = false)
207
207
  path_name = path_name.to_s
208
208
 
209
209
  if server?
@@ -216,13 +216,13 @@ class Wedge
216
216
  cache = options[:cache_assets]
217
217
 
218
218
  if !Wedge.config.debug
219
- url = "#{Wedge.assets_url_with_host}/#{options[:path]}.js"
219
+ url ||= "#{Wedge.assets_url_with_host}/#{options[:path]}.js"
220
220
 
221
221
  `jQuery.ajax({ url: url, dataType: "script", cache: cache }).done(function() {`
222
222
  trigger_javascript_loaded path_name, options
223
223
  `}).fail(function(jqxhr, settings, exception){ window.console.log(exception); })`
224
224
  else
225
- url = "#{Wedge.assets_url_with_host}/wedge/list_assets.call"
225
+ url ||= "#{Wedge.assets_url_with_host}/wedge/list_assets.call"
226
226
  payload = { path_name: path_name}
227
227
  headers = {
228
228
  'X-CSRF-TOKEN' => Element.find('meta[name=_csrf]').attr('content'),
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wedge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.78
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-20 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal-wedge