Skip to content

Commit

Permalink
update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tycooon committed Sep 5, 2024
1 parent f6045fa commit c27dd7f
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ inherit_gem:

AllCops:
DisplayCopNames: true
TargetRubyVersion: 2.7
TargetRubyVersion: 3.0

Naming/FileName:
Exclude:
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ gem "rspec"
gem "rubocop-config-umbrellio"
gem "simplecov"
gem "simplecov-lcov"
gem "symbiont-ruby"
135 changes: 80 additions & 55 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,102 +3,126 @@ PATH
specs:
umbrellio-sequel-plugins (0.15.0)
sequel
symbiont-ruby

GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
activesupport (7.2.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
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.27.0)
fiber-annotation
fiber-local
diff-lcs (1.5.0)
docile (1.4.0)
fiber-local (~> 1.1)
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)
fiber-local (1.1.0)
fiber-storage
fiber-storage (1.0.0)
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)
logger (1.6.1)
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)
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)
securerandom (0.3.1)
sequel (5.84.0)
bigdecimal
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
Expand All @@ -110,10 +134,10 @@ 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

DEPENDENCIES
async (= 1.31.0)
Expand All @@ -125,6 +149,7 @@ DEPENDENCIES
rubocop-config-umbrellio
simplecov
simplecov-lcov
symbiont-ruby
umbrellio-sequel-plugins!

BUNDLED WITH
Expand Down
14 changes: 7 additions & 7 deletions lib/sequel/plugins/attr_encrypted.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ 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

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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/sequel/plugins/money_accessors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/sequel/plugins/store_accessors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions umbrellio-sequel-plugins.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ["[email protected]"]
Expand All @@ -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

0 comments on commit c27dd7f

Please sign in to comment.