opal-phoenix 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/opal-phoenix.gemspec +1 -1
- data/opal/phoenix/channel.rb +9 -3
- data/opal/phoenix/push.rb +7 -1
- data/opal/phoenix/socket.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14182af3573c1c320f20812eeb4218b3992dce76
|
4
|
+
data.tar.gz: 0392ca37fb6c10f395207260aa4cd8298147b5c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 059793cded3808cdccfc672ef41ee1fc7e1a2fedb40722e381a73e9b3bcfd8cf18cc6fe8be0f4e687821a79ac2c245d13edf247fbf7aeb6c92662b915187d16c
|
7
|
+
data.tar.gz: f7a28a3cb85d4d25cc98a107bf1c414bdc6cdce08106990a6f00d525157eee1e8654aa2174108da6ec511d98f24518e8db05743c8364edb09997b0928d660fe1
|
data/opal-phoenix.gemspec
CHANGED
data/opal/phoenix/channel.rb
CHANGED
@@ -7,7 +7,7 @@ module Phoenix
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def on(msg, &block)
|
10
|
-
`#{@native}.on(#{msg}, #{block})`
|
10
|
+
`#{@native}.on(#{msg}, #{callback(block)})`
|
11
11
|
end
|
12
12
|
|
13
13
|
def push(msg, payload)
|
@@ -27,11 +27,17 @@ module Phoenix
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def on_error(&block)
|
30
|
-
`#{@native}.onError(#{block})`
|
30
|
+
`#{@native}.onError(#{callback(block)})`
|
31
31
|
end
|
32
32
|
|
33
33
|
def on_close(&block)
|
34
|
-
`#{@native}.onClose(#{block})`
|
34
|
+
`#{@native}.onClose(#{callback(block)})`
|
35
|
+
end
|
36
|
+
|
37
|
+
def callback(block)
|
38
|
+
proc do |e|
|
39
|
+
block.call(Native(e))
|
40
|
+
end
|
35
41
|
end
|
36
42
|
end
|
37
43
|
end
|
data/opal/phoenix/push.rb
CHANGED
@@ -7,7 +7,13 @@ module Phoenix
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def receive(msg, &block)
|
10
|
-
Push.new `#{@native}.receive(#{msg}, #{block})`
|
10
|
+
Push.new `#{@native}.receive(#{msg}, #{callback(block)})`
|
11
|
+
end
|
12
|
+
|
13
|
+
def callback(block)
|
14
|
+
proc do |e|
|
15
|
+
block.call(Native(e))
|
16
|
+
end
|
11
17
|
end
|
12
18
|
end
|
13
19
|
end
|
data/opal/phoenix/socket.rb
CHANGED
@@ -15,11 +15,17 @@ module Phoenix
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def on_error(&block)
|
18
|
-
`#{@native}.onError(#{block})`
|
18
|
+
`#{@native}.onError(#{callback(block)})`
|
19
19
|
end
|
20
20
|
|
21
21
|
def on_close(&block)
|
22
|
-
`#{@native}.onClose(#{block})`
|
22
|
+
`#{@native}.onClose(#{callback(block)})`
|
23
|
+
end
|
24
|
+
|
25
|
+
def callback(block)
|
26
|
+
proc do |e|
|
27
|
+
block.call(Native(e))
|
28
|
+
end
|
23
29
|
end
|
24
30
|
end
|
25
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-phoenix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michał Kalbarczyk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|