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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df97928711e3d9c9c817e3c3328bd7b39bce1e8c
4
- data.tar.gz: ac164272086c645527940ef88ca24f1a7a1f7832
3
+ metadata.gz: 70671fc0a57eb7f4a4d77f893ef847969753d786
4
+ data.tar.gz: 06617f88065702104e279a66ce790c891d20f271
5
5
  SHA512:
6
- metadata.gz: 9a53599aa9d2bfb0685f1395ec7d783628a8dad649b010b8dbe1982c83bfa827a6108d3f28235db309c214b20ce9fbec87a40834ee235a8e265b1be273cf3c7f
7
- data.tar.gz: f3aa9b477e01b203d5fd30a220ff4fde304ef0c5d32f9b8c1ddde819868c25a0574885bb4e0e545c6e1023cdb0a540f4f6273b4f78d22f7dd5c44bc2405b5d6b
6
+ metadata.gz: 2a78ea3e4e3d11e1c7324d5b03572b3995f9754ef88f520c055e28ace1ca6fa9043a3a2b809ed82b6bf632a8494ba2367e31fd55ce70e386281e001caf264f59
7
+ data.tar.gz: 9bd472ea5eb682fc19de97b642b6a43fe05c33ab7ec9fba165df406449d50f77e1ac5e8e79135ff1f12cdfa77ee69e49cdb9b5e73fb2b17fcd9fdb7d2cf2285e
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Azure
2
2
  module Push
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
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.3
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: 2015-01-22 00:00:00.000000000 Z
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