pushpad 0.8.0 → 0.9.0

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: 523d9efb23303960dd6479a1488ddbf0c6a4acfa
4
- data.tar.gz: 1170dd487dcaee2ebe4cc45177e32ff75174241d
3
+ metadata.gz: a0a0fada3d2c4b39e8704a08bc8693efcd60df36
4
+ data.tar.gz: 92d9ae23fd595a61755e2947081ead05b4c32b57
5
5
  SHA512:
6
- metadata.gz: 93f7b3c1c25d3a37d4dcf277055329f1e4e8874817a8f8291b1d4a9d8033dcb547b93c7093de3048b3e8fbe727b24ca9c0bd4a196c716726046b65ff849eb766
7
- data.tar.gz: 5ce9742333e169945e3084b8b377e48fe8a186af589f26841b7f4f9844f5e984b1fe30363d0ee39c85d1aaec038a41809b0af3204558229159660eaaad024e2e
6
+ metadata.gz: 466fa2216e0af552bf83d07ac7fecbf63f4c3c6febfa0360fcd53800e3088eb6c2dd953b5b49f6908109c890b4160631f907894edd40c3c76bf3513c98b9a123
7
+ data.tar.gz: 3522bce15f94f5371aef15296eddac68ad824fb1d8245cd26c344724f274792012d2b516e06426c21c50aeb49ee9f462b4fee6cffed2bca413c535eb71cbf7b0
data/README.md CHANGED
@@ -100,7 +100,10 @@ notification = Pushpad::Notification.new({
100
100
  starred: true, # optional, bookmark the notification in the Pushpad dashboard (e.g. to highlight manual notifications)
101
101
  # optional, use this option only if you need to create scheduled notifications (max 5 days)
102
102
  # see https://pushpad.xyz/docs/schedule_notifications
103
- send_at: Time.utc(2016, 7, 25, 10, 9)
103
+ send_at: Time.utc(2016, 7, 25, 10, 9),
104
+ # optional, add the notification to custom categories for stats aggregation
105
+ # see https://pushpad.xyz/docs/monitoring
106
+ custom_metrics: ['examples', 'another_metric'] # up to 3 metrics per notification
104
107
  })
105
108
 
106
109
  # deliver to a user
@@ -12,7 +12,7 @@ module Pushpad
12
12
  class ReadonlyError < RuntimeError
13
13
  end
14
14
 
15
- attr_accessor :body, :title, :target_url, :icon_url, :image_url, :ttl, :require_interaction, :custom_data, :actions, :starred, :send_at
15
+ attr_accessor :body, :title, :target_url, :icon_url, :image_url, :ttl, :require_interaction, :custom_data, :custom_metrics, :actions, :starred, :send_at
16
16
  attr_reader :id, :created_at, :scheduled_count, :successfully_sent_count, :opened_count
17
17
 
18
18
  def initialize(options)
@@ -30,6 +30,7 @@ module Pushpad
30
30
  @ttl = options[:ttl]
31
31
  @require_interaction = options[:require_interaction]
32
32
  @custom_data = options[:custom_data]
33
+ @custom_metrics = options[:custom_metrics]
33
34
  @actions = options[:actions]
34
35
  @starred = options[:starred]
35
36
  @send_at = options[:send_at]
@@ -117,6 +118,7 @@ module Pushpad
117
118
  notification_params["ttl"] = self.ttl if self.ttl
118
119
  notification_params["require_interaction"] = self.require_interaction unless self.require_interaction.nil?
119
120
  notification_params["custom_data"] = self.custom_data if self.custom_data
121
+ notification_params["custom_metrics"] = self.custom_metrics if self.custom_metrics
120
122
  notification_params["actions"] = self.actions if self.actions
121
123
  notification_params["starred"] = self.starred unless self.starred.nil?
122
124
  notification_params["send_at"] = self.send_at.utc.strftime("%Y-%m-%dT%R") if self.send_at
data/pushpad.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "pushpad"
3
- spec.version = '0.8.0'
3
+ spec.version = '0.9.0'
4
4
  spec.authors = ["Pushpad"]
5
5
  spec.email = ["support@pushpad.xyz"]
6
6
  spec.summary = "Web push notifications for Chrome, Firefox and Safari using Pushpad."
@@ -278,6 +278,7 @@ module Pushpad
278
278
  ttl: 604800,
279
279
  require_interaction: true,
280
280
  custom_data: "123",
281
+ custom_metrics: ["examples", "another_metric"],
281
282
  actions: [
282
283
  {
283
284
  title: "My Button 1",
@@ -358,6 +359,7 @@ module Pushpad
358
359
  ttl: 604800,
359
360
  require_interaction: true,
360
361
  custom_data: "123",
362
+ custom_metrics: ["examples", "another_metric"],
361
363
  actions: [
362
364
  {
363
365
  title: "My Button 1",
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushpad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pushpad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-26 00:00:00.000000000 Z
11
+ date: 2017-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: webmock
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description:
@@ -45,9 +45,9 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
49
- - .rspec
50
- - .travis.yml
48
+ - ".gitignore"
49
+ - ".rspec"
50
+ - ".travis.yml"
51
51
  - Gemfile
52
52
  - LICENSE.txt
53
53
  - README.md
@@ -72,17 +72,17 @@ require_paths:
72
72
  - lib
73
73
  required_ruby_version: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - '>='
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.0.14.1
85
+ rubygems_version: 2.4.5
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Web push notifications for Chrome, Firefox and Safari using Pushpad.