azure-push 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/azure/push/message.rb +7 -5
- data/lib/azure/push/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70671fc0a57eb7f4a4d77f893ef847969753d786
|
4
|
+
data.tar.gz: 06617f88065702104e279a66ce790c891d20f271
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a78ea3e4e3d11e1c7324d5b03572b3995f9754ef88f520c055e28ace1ca6fa9043a3a2b809ed82b6bf632a8494ba2367e31fd55ce70e386281e001caf264f59
|
7
|
+
data.tar.gz: 9bd472ea5eb682fc19de97b642b6a43fe05c33ab7ec9fba165df406449d50f77e1ac5e8e79135ff1f12cdfa77ee69e49cdb9b5e73fb2b17fcd9fdb7d2cf2285e
|
data/lib/azure/push/message.rb
CHANGED
@@ -8,7 +8,7 @@ module Azure
|
|
8
8
|
class Message
|
9
9
|
include Azure::Push::Sas
|
10
10
|
|
11
|
-
def initialize(namespace, hub, access_key,
|
11
|
+
def initialize(namespace, hub, access_key,
|
12
12
|
key_name: 'DefaultFullSharedAccessSignature',
|
13
13
|
sig_lifetime: 10)
|
14
14
|
@access_key = access_key
|
@@ -18,7 +18,7 @@ module Azure
|
|
18
18
|
@sig_lifetime = sig_lifetime
|
19
19
|
end
|
20
20
|
|
21
|
-
def send(payload, tags, format: 'apple', additional_headers: {})
|
21
|
+
def send(payload, tags = nil, format: 'apple', additional_headers: {})
|
22
22
|
raise ArgumentError unless ['apple', 'gcm', 'template', 'windows', 'windowsphone'].include? format
|
23
23
|
raise ArgumentError unless additional_headers.instance_of?(Hash)
|
24
24
|
if tags.instance_of?(Array)
|
@@ -29,9 +29,11 @@ module Azure
|
|
29
29
|
headers = {
|
30
30
|
'Content-Type' => content_type,
|
31
31
|
'Authorization' => Azure::Push::Sas.sas_token(url, @key_name, @access_key, lifetime: @sig_lifetime),
|
32
|
-
'ServiceBusNotification-Format' => format
|
33
|
-
'ServiceBusNotification-Tags' => tags
|
32
|
+
'ServiceBusNotification-Format' => format
|
34
33
|
}.merge(additional_headers)
|
34
|
+
|
35
|
+
headers['ServiceBusNotification-Tags'] = tags if tags
|
36
|
+
|
35
37
|
http = Net::HTTP.new(uri.host,uri.port)
|
36
38
|
http.use_ssl = true
|
37
39
|
req = Net::HTTP::Post.new(uri.path, initheader = headers)
|
@@ -47,4 +49,4 @@ module Azure
|
|
47
49
|
end
|
48
50
|
end
|
49
51
|
end
|
50
|
-
end
|
52
|
+
end
|
data/lib/azure/push/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: azure-push
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Sädtler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
91
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.4.1
|
92
|
+
rubygems_version: 2.4.5.1
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: Gem for interacting with Azure notification hubs without using the azure-sdk
|