diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec44ad0..5fe5d43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["2.7", "3.0", "3.1", "3.2"] + ruby: ["3.0", "3.1", "3.2", "3.3"] name: ${{ matrix.ruby }} diff --git a/.rubocop.yml b/.rubocop.yml index 3318fa5..346355a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,8 +3,11 @@ inherit_gem: AllCops: DisplayCopNames: true - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 Naming/FileName: Exclude: - lib/umbrellio-sequel-plugins.rb + +RSpec/SpecFilePathFormat: + Enabled: false diff --git a/Gemfile b/Gemfile index afc5d33..f539766 100644 --- a/Gemfile +++ b/Gemfile @@ -13,3 +13,4 @@ gem "rspec" gem "rubocop-config-umbrellio" gem "simplecov" gem "simplecov-lcov" +gem "symbiont-ruby" diff --git a/Gemfile.lock b/Gemfile.lock index 356ecf4..d665996 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,104 +1,124 @@ PATH remote: . specs: - umbrellio-sequel-plugins (0.15.0) + umbrellio-sequel-plugins (0.16.0) sequel - symbiont-ruby GEM remote: https://rubygems.org/ specs: - activesupport (7.0.6) + activesupport (7.1.4) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) ast (2.4.2) async (1.31.0) console (~> 1.10) nio4r (~> 2.3) timers (~> 4.1) + base64 (0.2.0) + bigdecimal (3.1.8) coderay (1.1.3) - concurrent-ruby (1.2.2) - console (1.17.2) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) + console (1.24.0) fiber-annotation fiber-local - diff-lcs (1.5.0) - docile (1.4.0) + json + diff-lcs (1.5.1) + docile (1.4.1) + drb (2.2.1) fiber-annotation (0.2.0) fiber-local (1.0.0) - i18n (1.14.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) - json (2.6.3) - method_source (1.0.0) - minitest (5.18.1) - money (6.16.0) + json (2.7.2) + language_server-protocol (3.17.0.3) + method_source (1.1.0) + minitest (5.25.1) + money (6.19.0) i18n (>= 0.6.4, <= 2) - nio4r (2.5.9) - parallel (1.23.0) - parser (3.2.2.3) + mutex_m (0.2.0) + nio4r (2.7.3) + parallel (1.26.3) + parser (3.3.5.0) ast (~> 2.4.1) racc - pg (1.5.3) + pg (1.5.7) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - racc (1.7.1) - rack (3.0.8) + racc (1.8.1) + rack (3.1.7) rainbow (3.1.1) - rake (13.0.6) - regexp_parser (2.8.1) - rexml (3.2.5) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rake (13.2.1) + regexp_parser (2.9.2) + rexml (3.3.7) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.1) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) - rubocop (1.50.2) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) + rubocop (1.63.5) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.18.0) + rubocop-ast (1.32.3) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-config-umbrellio (1.50.0.85) - rubocop (~> 1.50.0) - rubocop-performance (~> 1.17.0) - rubocop-rails (~> 2.19.0) + rubocop-config-umbrellio (1.63.0.93) + rubocop (~> 1.63.0) + rubocop-performance (~> 1.21.0) + rubocop-rails (~> 2.24.0) rubocop-rake (~> 0.6.0) - rubocop-rspec (~> 2.20.0) + rubocop-rspec (~> 2.29.0) rubocop-sequel (~> 0.3.3) - rubocop-performance (1.17.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.19.1) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.24.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.20.0) - rubocop (~> 1.33) + rubocop-rspec (2.29.2) + rubocop (~> 1.40) rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) rubocop-sequel (0.3.4) rubocop (~> 1.0) ruby-progressbar (1.13.0) - sequel (5.70.0) + sequel (5.84.0) + bigdecimal simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -110,10 +130,11 @@ GEM timers (4.3.5) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) PLATFORMS - ruby + arm64-darwin-23 + x86_64-linux DEPENDENCIES async (= 1.31.0) @@ -125,7 +146,8 @@ DEPENDENCIES rubocop-config-umbrellio simplecov simplecov-lcov + symbiont-ruby umbrellio-sequel-plugins! BUNDLED WITH - 2.4.15 + 2.5.18 diff --git a/README.md b/README.md index abae203..8b029c7 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ DB.synchronize_with([:ruby, :forever]) { p "Hey, I'm in transaction!"; sleep 5 } ## Methods in Migrations -Enable: `Sequel.extension(:methods_in_migrations)` +Enable: `Sequel.extension(:methods_in_migrations)`. Also, you will need to add and require `symbiont-ruby` gem. Support for method definitions and invocations inside `Sequel.migration`. diff --git a/lib/sequel/plugins/attr_encrypted.rb b/lib/sequel/plugins/attr_encrypted.rb index 78f707b..177f586 100644 --- a/lib/sequel/plugins/attr_encrypted.rb +++ b/lib/sequel/plugins/attr_encrypted.rb @@ -48,10 +48,10 @@ def attr_encrypted(*attrs, key:) def define_encrypted_setter(attr, key) @_attr_encrypted_module.module_eval do - define_method("#{attr}=") do |value| - instance_variable_set("@#{attr}", value) + define_method(:"#{attr}=") do |value| + instance_variable_set(:"@#{attr}", value) - send("encrypted_#{attr}=", SimpleCrypt.encrypt(value.to_json, key)) + send(:"encrypted_#{attr}=", SimpleCrypt.encrypt(value.to_json, key)) end end end @@ -59,11 +59,11 @@ def define_encrypted_setter(attr, key) def define_encrypted_getter(attr, key) @_attr_encrypted_module.module_eval do define_method(attr.to_s) do - instance_variable_get("@#{attr}") || begin - decrypted = SimpleCrypt.decrypt(send("encrypted_#{attr}"), key) + instance_variable_get(:"@#{attr}") || begin + decrypted = SimpleCrypt.decrypt(send(:"encrypted_#{attr}"), key) result = decrypted.nil? ? decrypted : JSON.parse(decrypted) - instance_variable_set("@#{attr}", result) + instance_variable_set(:"@#{attr}", result) end end end @@ -91,7 +91,7 @@ def refresh(*) def _reset_encrypted_attrs_ivars self.class.instance_variable_get(:@_encrypted_attributes)&.each do |attr| - instance_variable_set("@#{attr}", nil) + instance_variable_set(:"@#{attr}", nil) end end end diff --git a/lib/sequel/plugins/money_accessors.rb b/lib/sequel/plugins/money_accessors.rb index 24d4756..9ce0316 100644 --- a/lib/sequel/plugins/money_accessors.rb +++ b/lib/sequel/plugins/money_accessors.rb @@ -40,7 +40,7 @@ def money_getter(amount_column, currency_column) def money_setter(amount_column, currency_column) include_accessors_module! @_money_accessors_module.module_eval do - define_method("#{amount_column}=") do |value| + define_method(:"#{amount_column}=") do |value| case value when Money amount = value.to_d @@ -52,7 +52,7 @@ def money_setter(amount_column, currency_column) end super(amount) - send("#{currency_column}=", currency) + send(:"#{currency_column}=", currency) end end end diff --git a/lib/sequel/plugins/store_accessors.rb b/lib/sequel/plugins/store_accessors.rb index 379fdb7..549e153 100644 --- a/lib/sequel/plugins/store_accessors.rb +++ b/lib/sequel/plugins/store_accessors.rb @@ -52,8 +52,8 @@ def define_store_getter(column, field) def define_store_setter(column, field) @_store_accessors_module.module_eval do - define_method("#{field}=") do |value| - send("#{column}=", send(column).to_h.merge(field.to_s => value)) + define_method(:"#{field}=") do |value| + send(:"#{column}=", send(column).to_h.merge(field.to_s => value)) end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8f24fc9..03c8d5c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -24,7 +24,7 @@ require_relative "../utils/database" -Dir["#{__dir__}/../lib/sequel/**/*.rb"].sort.each { |f| require f } +Dir["#{__dir__}/../lib/sequel/**/*.rb"].each { |f| require f } RSpec.configure do |config| config.example_status_persistence_file_path = ".rspec_status" diff --git a/umbrellio-sequel-plugins.gemspec b/umbrellio-sequel-plugins.gemspec index 95a7f6f..97946e9 100644 --- a/umbrellio-sequel-plugins.gemspec +++ b/umbrellio-sequel-plugins.gemspec @@ -4,7 +4,7 @@ lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |spec| - gem_version = "0.15.0" + gem_version = "0.16.0" if ENV.fetch("PUBLISH_JOB", nil) release_version = "#{gem_version}.#{ENV.fetch("GITHUB_RUN_NUMBER")}" @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.name = "umbrellio-sequel-plugins" spec.version = release_version || gem_version - spec.required_ruby_version = ">= 2.7" + spec.required_ruby_version = ">= 3.0" spec.authors = ["Team Umbrellio"] spec.email = ["oss@umbrellio.biz"] @@ -25,5 +25,4 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_runtime_dependency "sequel" - spec.add_runtime_dependency "symbiont-ruby" end