Skip to content

Commit

Permalink
Merge pull request rpush#586 from andreaslillebo/ruby-3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aried3r authored Feb 15, 2021
2 parents ba151ec + d843926 commit 1bde7b8
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 19 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ rvm:
- 2.5
- 2.6
- 2.7
- 3.0

# Build only commits on master for the "Build pushed branches" feature. This
# prevents building twice on PRs originating from our repo ("Build pushed pull
Expand All @@ -27,6 +28,7 @@ gemfile:
- gemfiles/rails_5.1.gemfile
- gemfiles/rails_5.2.gemfile
- gemfiles/rails_6.0.gemfile
- gemfiles/rails_6.1.gemfile

services:
- postgresql
Expand All @@ -47,10 +49,20 @@ env:
matrix:
fast_finish: true
exclude:
- gemfile: gemfiles/rails_5.0.gemfile
rvm: 3.0
- gemfile: gemfiles/rails_5.1.gemfile
rvm: 3.0
- gemfile: gemfiles/rails_5.2.gemfile
rvm: 3.0
- gemfile: gemfiles/rails_6.0.gemfile
rvm: 2.3
- gemfile: gemfiles/rails_6.0.gemfile
rvm: 2.4
- gemfile: gemfiles/rails_6.1.gemfile
rvm: 2.3
- gemfile: gemfiles/rails_6.1.gemfile
rvm: 2.4

jobs:
include:
Expand Down
8 changes: 8 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@ appraise "rails-6.0" do
gem 'rails', '~> 6.0.0'
end
end

appraise "rails-6.1" do
gem 'activesupport', '~> 6.1.0'

group :development do
gem 'rails', '~> 6.1.0'
end
end
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ GEM
codeclimate-test-reporter (1.0.7)
simplecov
concurrent-ruby (1.1.7)
connection_pool (2.2.2)
connection_pool (2.2.3)
crass (1.0.6)
database_cleaner (1.7.0)
diff-lcs (1.3)
Expand Down Expand Up @@ -75,7 +75,7 @@ GEM
msgpack (1.3.1)
multi_json (1.15.0)
mysql2 (0.5.2)
net-http-persistent (4.0.0)
net-http-persistent (4.0.1)
connection_pool (~> 2.2)
net-http2 (0.18.3)
http-2 (~> 0.10.1)
Expand Down Expand Up @@ -171,4 +171,4 @@ DEPENDENCIES
timecop

BUNDLED WITH
2.1.4
2.2.3
11 changes: 11 additions & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activesupport", "~> 6.1.0"

group :development do
gem "rails", "~> 6.1.0"
end

gemspec path: "../"
8 changes: 4 additions & 4 deletions lib/generators/templates/add_gcm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def self.up

change_column :rapns_notifications, :type, :string, null: false
change_column :rapns_apps, :type, :string, null: false
change_column :rapns_notifications, :device_token, :string, { null: true, limit: 64 }
change_column :rapns_notifications, :expiry, :integer, { null: true, default: 1.day.to_i }
change_column :rapns_notifications, :device_token, :string, null: true, limit: 64
change_column :rapns_notifications, :expiry, :integer, null: true, default: 1.day.to_i
change_column :rapns_apps, :environment, :string, null: true
change_column :rapns_apps, :certificate, :text, null: true, default: nil

Expand Down Expand Up @@ -73,8 +73,8 @@ def self.down
remove_column :rapns_notifications, :type
remove_column :rapns_apps, :type

change_column :rapns_notifications, :device_token, :string, { null: false, limit: 64 }
change_column :rapns_notifications, :expiry, :integer, { null: false, default: 1.day.to_i }
change_column :rapns_notifications, :device_token, :string, null: false, limit: 64
change_column :rapns_notifications, :expiry, :integer, null: false, default: 1.day.to_i
change_column :rapns_apps, :environment, :string, null: false
change_column :rapns_apps, :certificate, :text, null: false

Expand Down
8 changes: 4 additions & 4 deletions lib/generators/templates/add_rpush.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ def self.up

change_column :rapns_notifications, :type, :string, null: false
change_column :rapns_apps, :type, :string, null: false
change_column :rapns_notifications, :device_token, :string, { null: true, limit: 64 }
change_column :rapns_notifications, :expiry, :integer, { null: true, default: 1.day.to_i }
change_column :rapns_notifications, :device_token, :string, null: true, limit: 64
change_column :rapns_notifications, :expiry, :integer, null: true, default: 1.day.to_i
change_column :rapns_apps, :environment, :string, null: true
change_column :rapns_apps, :certificate, :text, null: true, default: nil

Expand Down Expand Up @@ -218,8 +218,8 @@ def self.down
remove_column :rapns_notifications, :type
remove_column :rapns_apps, :type

change_column :rapns_notifications, :device_token, :string, { null: false, limit: 64 }
change_column :rapns_notifications, :expiry, :integer, { null: false, default: 1.day.to_i }
change_column :rapns_notifications, :device_token, :string, null: false, limit: 64
change_column :rapns_notifications, :expiry, :integer, null: false, default: 1.day.to_i
change_column :rapns_apps, :environment, :string, null: false
change_column :rapns_apps, :certificate, :text, null: false

Expand Down
4 changes: 2 additions & 2 deletions lib/generators/templates/rpush_3_3_1_updates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def self.up
end

def self.down
change_column :rpush_notifications, :device_token, :string, { null: true, limit: 64 }
change_column :rpush_feedback, :device_token, :string, { null: true, limit: 64 }
change_column :rpush_notifications, :device_token, :string, null: true, limit: 64
change_column :rpush_feedback, :device_token, :string, null: true, limit: 64
end
end
8 changes: 5 additions & 3 deletions spec/unit/daemon/pushy/delivery_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@
it_behaves_like 'process notification'
end

shared_examples 'retry delivery' do |response_code:|
let(:response_code) { response_code }
shared_examples 'retry delivery' do |options|
let(:response_code) { options[:response_code] }

shared_examples 'logs' do |log_options|
let(:deliver_after) { log_options[:deliver_after] }

shared_examples 'logs' do |deliver_after:|
let(:expected_log_message) do
"Pushy responded with a #{response_code} error. Notification #{notification.id} " \
"will be retried after #{deliver_after} (retry 1)."
Expand Down
8 changes: 5 additions & 3 deletions spec/unit/daemon/webpush/delivery_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@
it_behaves_like 'process notification'
end

shared_examples 'retry delivery' do |response_code:|
let(:response_code) { response_code }
shared_examples 'retry delivery' do |options|
let(:response_code) { options[:response_code] }

shared_examples 'logs' do |log_options|
let(:deliver_after) { log_options[:deliver_after] }

shared_examples 'logs' do |deliver_after:|
let(:expected_log_message) do
"[MyApp] Webpush endpoint responded with a #{response_code} error. Notification #{notification.id} will be retried after #{deliver_after} (retry 1)."
end
Expand Down

0 comments on commit 1bde7b8

Please sign in to comment.