pushpad 0.13.0 → 1.0.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
  SHA256:
3
- metadata.gz: 859e8674ef09ee84c2bb6ab00a837aef0d48b2039774625974aae32f2ca3a2ee
4
- data.tar.gz: 71086f6109284229c8c02d01d48ca0980a4621065d43875a4131bc867b7c002a
3
+ metadata.gz: 48d7160263b210c7897b4171bb69b21916e155e3e3c5c252a23ab99f0d64252d
4
+ data.tar.gz: e06bc7a3e1d946403e45cc4ed57672d1fd97e4076d9d0538bf42ba7b13a5aaf1
5
5
  SHA512:
6
- metadata.gz: 2cd5ae106f55214c5c16a7fc2eae7d33ecb4e6fb0c9b2917d44c643a754b5a6b124630b356969d9a230a25ed89fe0726b900d001452c777dba677f629c52ce6d
7
- data.tar.gz: f06eb68e6b96bbf6b6f59ab687c838fdc72a6a5f9df61a86e48772bd7f74d6990416d69ddbe8ea71855b8a42ba453e363c2fb4a1ae4b97268d437a545b9a0166
6
+ metadata.gz: 33bc016ccd42f4ea8cced6e3b0a98e91c22c196ff1481b504f64ae231ec0ff0d67c4e47bd5fb5fd0ab42c544d3d97e559893ed85d71cce7057e355a5d138863e
7
+ data.tar.gz: 927b49b786b2ed3114d6a1c8b88dddcea72a21c6688a4bc9adc51e6206a5a0d6229134fdaace40c7687e957f0eba3a7045edb1e512ccfac4436568704bcdf803
@@ -12,7 +12,7 @@ jobs:
12
12
  matrix:
13
13
  ruby-version: ['2.7', '3.0', '3.1']
14
14
  steps:
15
- - uses: actions/checkout@v2
15
+ - uses: actions/checkout@v3
16
16
  - name: Set up Ruby
17
17
  uses: ruby/setup-ruby@v1
18
18
  with:
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/pushpad.svg)](https://badge.fury.io/rb/pushpad)
4
4
  ![Build Status](https://github.com/pushpad/pushpad-ruby/workflows/CI/badge.svg)
5
5
 
6
- [Pushpad](https://pushpad.xyz) is a service for sending push notifications from your web app. It supports the **Push API** (Chrome, Firefox, Opera, Edge) and **APNs** (Safari).
6
+ [Pushpad](https://pushpad.xyz) is a service for sending push notifications from your web app. It supports the **Push API** (Chrome, Firefox, Opera, Edge) and **APNs** (Safari desktop). iOS support is coming in 2023.
7
7
 
8
8
  Features:
9
9
 
@@ -59,7 +59,7 @@ notification = Pushpad::Notification.new({
59
59
  title: "Website Name", # optional, defaults to your project name
60
60
  target_url: "https://example.com", # optional, defaults to your project website
61
61
  icon_url: "https://example.com/assets/icon.png", # optional, defaults to the project icon
62
- badge_url: "https://example.com/assets/badge.png" # optional, defaults to the project badge
62
+ badge_url: "https://example.com/assets/badge.png", # optional, defaults to the project badge
63
63
  image_url: "https://example.com/assets/image.png", # optional, an image to display in the notification content
64
64
  ttl: 604800, # optional, drop the notification after this number of seconds if a device is offline
65
65
  require_interaction: true, # optional, prevent Chrome on desktop from automatically closing the notification after a few seconds
@@ -138,22 +138,22 @@ notification = Pushpad::Notification.find(42)
138
138
 
139
139
  # get basic attributes
140
140
  notification.id # => 42
141
- notification.title # => "Foo Bar",
142
- notification.body # => "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
143
- notification.target_url # => "https://example.com",
144
- notification.ttl # => 604800,
145
- notification.require_interaction # => false,
146
- notification.silent # => false,
147
- notification.urgent # => false,
148
- notification.icon_url # => "https://example.com/assets/icon.png",
149
- notification.badge_url # => "https://example.com/assets/badge.png",
141
+ notification.title # => "Foo Bar"
142
+ notification.body # => "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
143
+ notification.target_url # => "https://example.com"
144
+ notification.ttl # => 604800
145
+ notification.require_interaction # => false
146
+ notification.silent # => false
147
+ notification.urgent # => false
148
+ notification.icon_url # => "https://example.com/assets/icon.png"
149
+ notification.badge_url # => "https://example.com/assets/badge.png"
150
150
 
151
151
  # `created_at` is a `Time` instance
152
- notification.created_at.utc.to_s # => "2016-07-06 10:09:14 UTC",
152
+ notification.created_at.utc.to_s # => "2016-07-06 10:09:14 UTC"
153
153
 
154
154
  # get statistics
155
155
  notification.scheduled_count # => 1
156
- notification.successfully_sent_count # => 4,
156
+ notification.successfully_sent_count # => 4
157
157
  notification.opened_count # => 2
158
158
  ```
159
159
 
@@ -164,7 +164,7 @@ notifications = Pushpad::Notification.find_all(project_id: 5)
164
164
 
165
165
  # same attributes as for single notification in example above
166
166
  notifications[0].id # => 42
167
- notifications[0].title # => "Foo Bar",
167
+ notifications[0].title # => "Foo Bar"
168
168
  ```
169
169
 
170
170
  If `Pushpad.project_id` is defined, the `project_id` option can be
data/lib/pushpad.rb CHANGED
@@ -26,7 +26,7 @@ module Pushpad
26
26
 
27
27
  def self.signature_for(data)
28
28
  raise "You must set Pushpad.auth_token" unless Pushpad.auth_token
29
- OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), self.auth_token, data.to_s)
29
+ OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), self.auth_token, data.to_s)
30
30
  end
31
31
 
32
32
  end
data/pushpad.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "pushpad"
3
- spec.version = '0.13.0'
3
+ spec.version = '1.0.0'
4
4
  spec.authors = ["Pushpad"]
5
5
  spec.email = ["support@pushpad.xyz"]
6
6
  spec.summary = "Web push notifications for Chrome, Firefox, Opera, Edge and Safari using Pushpad."
data/spec/pushpad_spec.rb CHANGED
@@ -16,9 +16,9 @@ describe Pushpad do
16
16
  end
17
17
 
18
18
  describe "#signature_for" do
19
- it "produces the hex-encoded HMAC-SHA1 signature for the data passed as argument" do
19
+ it "produces the hex-encoded HMAC-SHA256 signature for the data passed as argument" do
20
20
  signature = Pushpad.signature_for('myuid1')
21
- expect(signature).to eq '27fbe136f5a4aa0b6be74c0e18fa8ce81ad91b60'
21
+ expect(signature).to eq 'd213a2f146dd9aae9cb935b5233d42fecc9414e2b0e98896af7a43e7fce3ef31'
22
22
  end
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushpad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pushpad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-03 00:00:00.000000000 Z
11
+ date: 2022-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  requirements: []
84
- rubygems_version: 3.2.32
84
+ rubygems_version: 3.3.26
85
85
  signing_key:
86
86
  specification_version: 4
87
87
  summary: Web push notifications for Chrome, Firefox, Opera, Edge and Safari using