volt 0.9.7.pre5 → 0.9.7.pre6

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: 3cdc140dec9dafbccfdc80fbe5f9e98695b46394
4
- data.tar.gz: c4e30bbd6a618229e594cfdbff8b40f4dcedaae8
3
+ metadata.gz: cfd1a4dab6a6fff697409671f83ecc96ebc6f3e7
4
+ data.tar.gz: 908b34d10825b339c58e450413c5fb0629507b89
5
5
  SHA512:
6
- metadata.gz: ba0802d6f9adcbf18ec68a28b95629ecfb59a9fa2cb2ea29f3c1c8e922c7e918af509647f95d28e8f23b840c7bda0bb91ff2451df02e9794eb9236b24ce574d6
7
- data.tar.gz: e65b951533259dacf018849c1a0e0c2cf46f23205a1d11fdd9a8ab469aaa7d6d624fc6d075950b616cad916867a3a417e4844a9e3923fcc9480c1d27f227627e
6
+ metadata.gz: ee4c27009a1cfca8a3519c7c0a07fd7d0cd8561e596144112531c0662d442354f0c2a3993edd797046b617d4f503ffb6f55e9020380d23e751df326f49c1eb03
7
+ data.tar.gz: cf65cf0d2676de6a95efdc9cdc9b32029b8183a0ce6dd1e3d872999f86944745d700e9c5e168cf9556a2ee46727a5059cef8ec02e31081154f1f0c2a1ded728c
@@ -47,7 +47,7 @@ class StoreTasks < Volt::Task
47
47
  next nil
48
48
  end.fail do |err|
49
49
  # An error object, convert to hash
50
- Promise.new.reject(err.to_h)
50
+ Promise.new.reject(err.try(:to_h) || err.to_s)
51
51
  end
52
52
 
53
53
  Thread.current['in_channel'] = nil
@@ -17,14 +17,23 @@ module Volt
17
17
  method_name = method_name.to_s
18
18
  # c for call
19
19
 
20
+ args = escape(args)
21
+
22
+ QueryIdentifier.new(['c', @from, method_name, *args])
23
+ end
24
+
25
+ def escape(args)
20
26
  args.map do |arg|
21
27
  if arg.is_a?(Array)
22
28
  # Escape the array
23
29
  arg.unshift('a')
30
+ elsif arg.is_a?(Regexp)
31
+ # Track regexp
32
+ ['r', arg.to_s]
33
+ else
34
+ arg
24
35
  end
25
36
  end
26
-
27
- QueryIdentifier.new(['c', @from, method_name, *args])
28
37
  end
29
38
 
30
39
  def ==(val)
@@ -54,7 +63,7 @@ module Volt
54
63
  end
55
64
 
56
65
  def __op(*args)
57
- QueryOp.new(['c', self, *args])
66
+ QueryOp.new(['c', self, *escape(args)])
58
67
  end
59
68
 
60
69
  def coerce(other)
@@ -157,8 +157,10 @@ module Volt
157
157
  if @grouped_controller && @current_controller_handler
158
158
  # We remove the controller after all of the current rendering is done.
159
159
  Timers.next_tick do
160
- # Remove a reference for the controller in the group.
161
- @grouped_controller.remove(@current_controller_handler.controller.class)
160
+ if @current_controller_handler
161
+ # Remove a reference for the controller in the group.
162
+ @grouped_controller.remove(@current_controller_handler.controller.class)
163
+ end
162
164
  end
163
165
  end
164
166
 
@@ -1,5 +1,5 @@
1
1
  module Volt
2
2
  module Version
3
- STRING = '0.9.7.pre5'
3
+ STRING = '0.9.7.pre6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7.pre5
4
+ version: 0.9.7.pre6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stout