From 1b9eb0b5c36131d87aa00abe08fc9a7b3555b4ef Mon Sep 17 00:00:00 2001 From: Benjamin Quorning Date: Sat, 9 Mar 2024 01:09:18 +0100 Subject: [PATCH 1/3] CI: Fix sqlite3 incompatiblity sqlite3 v1.7.x requires Ruby 3.x --- gemfiles/5.2.gemfile | 2 +- gemfiles/6.0.gemfile | 2 +- gemfiles/6.1.gemfile | 2 +- gemfiles/7.0.5.gemfile | 2 +- gemfiles/7.0.gemfile | 2 +- gemfiles/7.1.gemfile | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gemfiles/5.2.gemfile b/gemfiles/5.2.gemfile index f60da9d..7ad8ffb 100644 --- a/gemfiles/5.2.gemfile +++ b/gemfiles/5.2.gemfile @@ -5,6 +5,6 @@ gemspec path: ".." gem "activesupport", "~> 5.2.0" gem "activemodel", "~> 5.2.0" gem "activerecord", "~> 5.2.0" -gem "sqlite3", "~> 1.3", ">= 1.3.6" +gem "sqlite3", "~> 1.3", ">= 1.3.6", ("< 1.7" if RUBY_VERSION < "3") gem "mysql2", ">= 0.4.4", "< 0.6.0" gem "pg", ">= 0.18", "< 2.0" diff --git a/gemfiles/6.0.gemfile b/gemfiles/6.0.gemfile index 71261b8..a0670ad 100644 --- a/gemfiles/6.0.gemfile +++ b/gemfiles/6.0.gemfile @@ -5,7 +5,7 @@ gemspec path: ".." gem "activesupport", "~> 6.0.0" gem "activemodel", "~> 6.0.0" gem "activerecord", "~> 6.0.0" -gem "sqlite3", "~> 1.4" +gem "sqlite3", "~> 1.4", ("< 1.7" if RUBY_VERSION < "3") gem "mysql2", ">= 0.4.4" gem "pg", ">= 0.18", "< 2.0" gem "activerecord-trilogy-adapter" diff --git a/gemfiles/6.1.gemfile b/gemfiles/6.1.gemfile index 853e32d..ee28981 100644 --- a/gemfiles/6.1.gemfile +++ b/gemfiles/6.1.gemfile @@ -5,7 +5,7 @@ gemspec path: ".." gem "activesupport", "~> 6.1.0" gem "activemodel", "~> 6.1.0" gem "activerecord", "~> 6.1.0" -gem "sqlite3", "~> 1.4" +gem "sqlite3", "~> 1.4", ("< 1.7" if RUBY_VERSION < "3") gem "mysql2", "~> 0.5" gem "pg", "~> 1.1" gem "activerecord-trilogy-adapter" diff --git a/gemfiles/7.0.5.gemfile b/gemfiles/7.0.5.gemfile index 5823785..a91e115 100644 --- a/gemfiles/7.0.5.gemfile +++ b/gemfiles/7.0.5.gemfile @@ -5,7 +5,7 @@ gemspec path: ".." gem "activesupport", "~> 7.0.5" gem "activemodel", "~> 7.0.5" gem "activerecord", "~> 7.0.5" -gem "sqlite3", "~> 1.4" +gem "sqlite3", "~> 1.4", ("< 1.7" if RUBY_VERSION < "3") gem "mysql2", "~> 0.5" gem "pg", "~> 1.1" gem "activerecord-trilogy-adapter" diff --git a/gemfiles/7.0.gemfile b/gemfiles/7.0.gemfile index 7d25e30..1eef63b 100644 --- a/gemfiles/7.0.gemfile +++ b/gemfiles/7.0.gemfile @@ -5,7 +5,7 @@ gemspec path: ".." gem "activesupport", "~> 7.0.0", "< 7.0.5" gem "activemodel", "~> 7.0.0", "< 7.0.5" gem "activerecord", "~> 7.0.0", "< 7.0.5" -gem "sqlite3", "~> 1.4" +gem "sqlite3", "~> 1.4", ("< 1.7" if RUBY_VERSION < "3") gem "mysql2", "~> 0.5" gem "pg", "~> 1.1" gem "activerecord-trilogy-adapter" diff --git a/gemfiles/7.1.gemfile b/gemfiles/7.1.gemfile index 87c3490..9e326bb 100644 --- a/gemfiles/7.1.gemfile +++ b/gemfiles/7.1.gemfile @@ -5,7 +5,7 @@ gemspec path: ".." gem "activesupport", "~> 7.1.0" gem "activemodel", "~> 7.1.0" gem "activerecord", "~> 7.1.0" -gem "sqlite3", "~> 1.4" +gem "sqlite3", "~> 1.4", ("< 1.7" if RUBY_VERSION < "3") gem "mysql2", "~> 0.5" gem "pg", "~> 1.1" gem "trilogy", "~> 2.4" From cfdbdaca630bc911496dc2ca9ca4c3054defe1c9 Mon Sep 17 00:00:00 2001 From: Benjamin Quorning Date: Sat, 9 Mar 2024 01:10:10 +0100 Subject: [PATCH 2/3] Upgrade Ruby linters, fix new issue --- test/ulid/rails_test.rb | 2 +- ulid-rails.gemspec | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/ulid/rails_test.rb b/test/ulid/rails_test.rb index d12b9bc..a508713 100644 --- a/test/ulid/rails_test.rb +++ b/test/ulid/rails_test.rb @@ -91,7 +91,7 @@ def test_deserializes_the_value_back_to_an_ulid def test_auto_generate_primary_key user = User.create! - assert user.id.is_a? String + assert_kind_of String, user.id assert_equal 26, user.id.length id = user.id diff --git a/ulid-rails.gemspec b/ulid-rails.gemspec index 5dbd539..1590715 100644 --- a/ulid-rails.gemspec +++ b/ulid-rails.gemspec @@ -46,6 +46,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency "pry-byebug" spec.add_development_dependency "rake" spec.add_development_dependency "minitest", "~> 5.0" - spec.add_development_dependency "rubocop-minitest" - spec.add_development_dependency "standard", "~> 1.32.0" + spec.add_development_dependency "rubocop-minitest", "0.34.5" + spec.add_development_dependency "standard", "~> 1.34.0" end From c963e2eb18588201aa8a760378d89922099afce2 Mon Sep 17 00:00:00 2001 From: Benjamin Quorning Date: Sat, 9 Mar 2024 01:19:40 +0100 Subject: [PATCH 3/3] Add CI badges to Readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ca93f89..b560b95 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # ULID::Rails +[![CI tests status](https://github.com/k2nr/ulid-rails/actions/workflows/test.yml/badge.svg?branch%3Amaster)](https://github.com/k2nr/ulid-rails/actions/workflows/test.yml?query=branch%3Amaster) [![CI linting status](https://github.com/k2nr/ulid-rails/actions/workflows/lint.yml/badge.svg?branch%3Amaster)](https://github.com/k2nr/ulid-rails/actions/workflows/lint.yml?query=branch%3Amaster) + This gem makes it possible to use [ULID](https://github.com/ulid/spec) for DB in a Ruby on Rails app. ## Installation