From 8941832b3b5c973eccc7d83f8aed27c85275a443 Mon Sep 17 00:00:00 2001 From: Emilio Cristalli Date: Thu, 13 Dec 2018 21:09:14 -0300 Subject: [PATCH 1/5] Add Rails 5.2 to Appraisal --- Appraisals | 2 +- gemfiles/rails5_2.gemfile | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 gemfiles/rails5_2.gemfile diff --git a/Appraisals b/Appraisals index 6220edeb..987feadd 100644 --- a/Appraisals +++ b/Appraisals @@ -1,4 +1,4 @@ -rails_versions = ['~> 4.0.5', '~> 4.1.1', '~> 4.2.0', '~> 5.0.0', '~> 5.1.0'] +rails_versions = ['~> 4.0.5', '~> 4.1.1', '~> 4.2.0', '~> 5.0.0', '~> 5.1.0', '~> 5.2.0'] rails_versions.each do |rails_version| appraise "rails#{rails_version.slice(/\d+\.\d+/).gsub('.', '_')}" do diff --git a/gemfiles/rails5_2.gemfile b/gemfiles/rails5_2.gemfile new file mode 100644 index 00000000..0c9d5697 --- /dev/null +++ b/gemfiles/rails5_2.gemfile @@ -0,0 +1,7 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "~> 5.2.0" + +gemspec :path => "../" From cc3c5bc03d0447faff2bba491df09c519b30d293 Mon Sep 17 00:00:00 2001 From: Emilio Cristalli Date: Thu, 13 Dec 2018 21:14:00 -0300 Subject: [PATCH 2/5] Test with Rails 5.2 in CI --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index b86cd4bf..906a7562 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,12 +18,15 @@ gemfile: - gemfiles/rails4_2.gemfile - gemfiles/rails5_0.gemfile - gemfiles/rails5_1.gemfile + - gemfiles/rails5_2.gemfile matrix: exclude: - rvm: 2.1.10 gemfile: gemfiles/rails5_0.gemfile - rvm: 2.1.10 gemfile: gemfiles/rails5_1.gemfile + - rvm: 2.1.10 + gemfile: gemfiles/rails5_2.gemfile # rails <=4.1 segfaults with ruby 2.4+ - rvm: 2.4.3 gemfile: gemfiles/rails4_0.gemfile From 8a6d3dd8d8a133ec4e05d01f485873b4c6283e3b Mon Sep 17 00:00:00 2001 From: Emilio Cristalli Date: Sun, 9 Dec 2018 00:42:41 -0300 Subject: [PATCH 3/5] Fix Rails secret_token deprecation warning DEPRECATION WARNING: `secrets.secret_token` is deprecated in favor of `secret_key_base` and will be removed in Rails 6.0. (called from at /Users/emiliocristalli/workspace/tmp/exception_notification/test/dummy/config/environment.rb:17) --- test/dummy/config/initializers/secret_token.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/test/dummy/config/initializers/secret_token.rb b/test/dummy/config/initializers/secret_token.rb index ff5c7bfc..1de52661 100644 --- a/test/dummy/config/initializers/secret_token.rb +++ b/test/dummy/config/initializers/secret_token.rb @@ -4,5 +4,4 @@ # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -Dummy::Application.config.secret_token = 'cfdf538142b0b383e722e8e7ea839b8ce6c3dc94a57856b343a2d13be66f5b690a55c991cec6e98ed60ea9b7e58265af23cb40cbadee02f13f1c45c2625f482b' Dummy::Application.config.secret_key_base = 'my new secret' From c3e25ad00602346cc9e74e62988d1ecf1b34e48b Mon Sep 17 00:00:00 2001 From: Emilio Cristalli Date: Sun, 9 Dec 2018 00:52:36 -0300 Subject: [PATCH 4/5] Fix Rails SQLite booleans deprecation warning DEPRECATION WARNING: Leaving `ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer` set to false is deprecated. SQLite databases have used 't' and 'f' to serialize boolean values and must have old data converted to 1 and 0 (its native boolean serialization) before setting this flag to true. Conversion can be accomplished by setting up a rake task which runs ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1) ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0) for all models and all boolean columns, after which the flag must be set to true by adding the following to your application.rb file: Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true --- test/dummy/config/application.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index 989b0789..a766c4db 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -38,5 +38,8 @@ class Application < Rails::Application # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:password, :secret] + + rails_version = Gem::Version.new(Rails.version) + config.active_record.sqlite3.represent_boolean_as_integer = true if rails_version >= Gem::Version.new("5.2.0") end end From c4887e0fe9688fd58ef39eed0413fabd7fe635e4 Mon Sep 17 00:00:00 2001 From: Emilio Cristalli Date: Thu, 13 Dec 2018 23:17:20 -0300 Subject: [PATCH 5/5] Update Appraisal --- exception_notification.gemspec | 2 +- gemfiles/rails4_0.gemfile | 2 +- gemfiles/rails4_1.gemfile | 2 +- gemfiles/rails4_2.gemfile | 2 +- gemfiles/rails5_0.gemfile | 2 +- gemfiles/rails5_1.gemfile | 2 +- gemfiles/rails5_2.gemfile | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/exception_notification.gemspec b/exception_notification.gemspec index 5be11c3f..4b7bc8f3 100644 --- a/exception_notification.gemspec +++ b/exception_notification.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |s| s.add_development_dependency "mocha", ">= 0.13.0" s.add_development_dependency "sqlite3", ">= 1.3.4" s.add_development_dependency "coveralls", "~> 0.8.2" - s.add_development_dependency "appraisal", "~> 2.0.0" + s.add_development_dependency "appraisal", "~> 2.2.0" s.add_development_dependency "hipchat", ">= 1.0.0" s.add_development_dependency "carrier-pigeon", ">= 0.7.0" s.add_development_dependency "slack-notifier", ">= 1.0.0" diff --git a/gemfiles/rails4_0.gemfile b/gemfiles/rails4_0.gemfile index 39a1bd6b..4f47847a 100644 --- a/gemfiles/rails4_0.gemfile +++ b/gemfiles/rails4_0.gemfile @@ -4,4 +4,4 @@ source "https://rubygems.org" gem "rails", "~> 4.0.5" -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/rails4_1.gemfile b/gemfiles/rails4_1.gemfile index 8dfe1fe3..7e4bd92e 100644 --- a/gemfiles/rails4_1.gemfile +++ b/gemfiles/rails4_1.gemfile @@ -4,4 +4,4 @@ source "https://rubygems.org" gem "rails", "~> 4.1.1" -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/rails4_2.gemfile b/gemfiles/rails4_2.gemfile index cd8b45b1..6977eb02 100644 --- a/gemfiles/rails4_2.gemfile +++ b/gemfiles/rails4_2.gemfile @@ -4,4 +4,4 @@ source "https://rubygems.org" gem "rails", "~> 4.2.0" -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/rails5_0.gemfile b/gemfiles/rails5_0.gemfile index 123ad559..10f52e7a 100644 --- a/gemfiles/rails5_0.gemfile +++ b/gemfiles/rails5_0.gemfile @@ -4,4 +4,4 @@ source "https://rubygems.org" gem "rails", "~> 5.0.0" -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/rails5_1.gemfile b/gemfiles/rails5_1.gemfile index 20a05ff9..6100e830 100644 --- a/gemfiles/rails5_1.gemfile +++ b/gemfiles/rails5_1.gemfile @@ -4,4 +4,4 @@ source "https://rubygems.org" gem "rails", "~> 5.1.0" -gemspec :path => "../" +gemspec path: "../" diff --git a/gemfiles/rails5_2.gemfile b/gemfiles/rails5_2.gemfile index 0c9d5697..5a706dcb 100644 --- a/gemfiles/rails5_2.gemfile +++ b/gemfiles/rails5_2.gemfile @@ -4,4 +4,4 @@ source "https://rubygems.org" gem "rails", "~> 5.2.0" -gemspec :path => "../" +gemspec path: "../"