viaduct-webpush 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/viaduct/web_push/channel.rb +1 -29
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 68a2a41d5df78be44fa3670824cb3d7b03261b03
|
|
4
|
+
data.tar.gz: 8ae99d9af3dd5d8acef7fb1ef98033a315a3a634
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c7d07579a2aed3b305beeda7b485245863c5cd9aa6cdd7cb93d2dd658ff5bc2996be1e1dbadaf59835acc83d2c2e1a3f5b2622585e2fba13e3ffb363bfa7157c
|
|
7
|
+
data.tar.gz: 221fcd9d30f4d7a17a6255bb0206d1935223c0705471a911c8aad75282d58d369fa4e94fde30482a8f43508b7e3cd4ebf29dbfe92da95d68f88788b8549674ec
|
|
@@ -6,11 +6,8 @@ module Viaduct
|
|
|
6
6
|
|
|
7
7
|
attr_accessor :subscribed, :name, :bindings
|
|
8
8
|
|
|
9
|
-
def initialize(name
|
|
9
|
+
def initialize(name)
|
|
10
10
|
@name = name
|
|
11
|
-
@connection = connection
|
|
12
|
-
@bindings = Hash.new([])
|
|
13
|
-
@subscribed = false
|
|
14
11
|
end
|
|
15
12
|
|
|
16
13
|
#
|
|
@@ -36,31 +33,6 @@ module Viaduct
|
|
|
36
33
|
end
|
|
37
34
|
end
|
|
38
35
|
|
|
39
|
-
#
|
|
40
|
-
# Bind some code to an incoming message on this channel
|
|
41
|
-
#
|
|
42
|
-
def bind(event, &block)
|
|
43
|
-
@bindings[event] += [block]
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
#
|
|
47
|
-
# Run the bindings for an event
|
|
48
|
-
#
|
|
49
|
-
def dispatch(event, data)
|
|
50
|
-
@bindings[event].each do |binding|
|
|
51
|
-
binding.call(data)
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
#
|
|
56
|
-
# Send request subscription for this channel from VWP
|
|
57
|
-
#
|
|
58
|
-
def register
|
|
59
|
-
return if @subscibed || global?
|
|
60
|
-
signature = self.class.generate_signature(@connection.session_id, @name)
|
|
61
|
-
@connection.register_subscription(@name, signature)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
36
|
#
|
|
65
37
|
# Trigger a single even on a given channel
|
|
66
38
|
#
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: viaduct-webpush
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Cooke
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -115,3 +115,4 @@ signing_key:
|
|
|
115
115
|
specification_version: 4
|
|
116
116
|
summary: A client library for the Viaduct WebPush API.
|
|
117
117
|
test_files: []
|
|
118
|
+
has_rdoc:
|