Skip to content

Commit

Permalink
Drop support for Ruby 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hasghari committed Apr 29, 2024
1 parent 84011b1 commit d03a096
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 32 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
strategy:
matrix:
ruby:
- '3.0.5'
- '3.1.4'
- '3.2.2'
- '3.3.0'
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require: rubocop-rspec

AllCops:
NewCops: enable
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1
Exclude:
- gemfiles/*

Expand Down
1 change: 0 additions & 1 deletion Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ end
appraise 'activerecord-7.1.0' do
gem 'activerecord', '~> 7.1', '< 7.2'
end

8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: .
specs:
table_saw (3.1.0)
activerecord (>= 6.0)
activerecord (>= 6.1)
pg
thor

Expand Down Expand Up @@ -86,7 +86,7 @@ GEM
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.0.5)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
pg (1.5.6)
Expand Down Expand Up @@ -124,7 +124,7 @@ GEM
rdoc (6.6.3.1)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.5.2)
reline (0.5.3)
io-console (~> 0.5)
rexml (3.2.6)
rspec (3.13.0)
Expand All @@ -140,7 +140,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.63.2)
rubocop (1.63.4)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down
6 changes: 3 additions & 3 deletions gemfiles/activerecord_6.1.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
table_saw (3.1.0)
activerecord (>= 6.0)
activerecord (>= 6.1)
pg
thor

Expand Down Expand Up @@ -69,7 +69,7 @@ GEM
nokogiri (1.16.4-x86_64-linux)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.0.5)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
pg (1.5.6)
Expand Down Expand Up @@ -110,7 +110,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.63.2)
rubocop (1.63.4)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down
6 changes: 3 additions & 3 deletions gemfiles/activerecord_7.0.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
table_saw (3.1.0)
activerecord (>= 6.0)
activerecord (>= 6.1)
pg
thor

Expand Down Expand Up @@ -68,7 +68,7 @@ GEM
nokogiri (1.16.4-x86_64-linux)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.0.5)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
pg (1.5.6)
Expand Down Expand Up @@ -110,7 +110,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.63.2)
rubocop (1.63.4)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down
8 changes: 4 additions & 4 deletions gemfiles/activerecord_7.1.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PATH
remote: ..
specs:
table_saw (3.1.0)
activerecord (>= 6.0)
activerecord (>= 6.1)
pg
thor

Expand Down Expand Up @@ -86,7 +86,7 @@ GEM
nokogiri (1.16.4-x86_64-linux)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.0.5)
parser (3.3.1.0)
ast (~> 2.4.1)
racc
pg (1.5.6)
Expand Down Expand Up @@ -124,7 +124,7 @@ GEM
rdoc (6.6.3.1)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.5.2)
reline (0.5.3)
io-console (~> 0.5)
rexml (3.2.6)
rspec (3.13.0)
Expand All @@ -140,7 +140,7 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.63.2)
rubocop (1.63.4)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down
2 changes: 1 addition & 1 deletion lib/table_saw/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Configuration
attr_accessor :dbname, :host, :port, :user, :password, :manifest, :output, :format

def connection
{ dbname: dbname, host: host, port: port, user: user, password: password }
{ dbname:, host:, port:, user:, password: }
end

def url=(value)
Expand Down
2 changes: 1 addition & 1 deletion lib/table_saw/dependency_graph/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def directives(dir)
if record
dir.partial? ? record.fetch_associations(dir) : []
else
TableSaw::DependencyGraph::DumpTable.new(manifest: manifest, name: dir.table_name, partial: dir.partial?)
TableSaw::DependencyGraph::DumpTable.new(manifest:, name: dir.table_name, partial: dir.partial?)
.tap { |table| records[dir.table_name] = table }.fetch_associations(dir)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/table_saw/dependency_graph/dump_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(manifest:, name:, partial: true)
def copy_statement
if partial
format 'select * from %{name} where %{clause}',
name: name, clause: TableSaw::Queries::SerializeSqlInClause.new(name, primary_key, ids.to_a).call
name:, clause: TableSaw::Queries::SerializeSqlInClause.new(name, primary_key, ids.to_a).call

else
"select * from #{name}"
Expand Down
2 changes: 1 addition & 1 deletion lib/table_saw/formats/insert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def coder
private

def prepared_statement
@prepared_statement ||= TableSaw::Queries::PreparedInsertStatement.new(table_name, options: options).call
@prepared_statement ||= TableSaw::Queries::PreparedInsertStatement.new(table_name, options:).call
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/table_saw/manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def has_many
def self.instance
raise ArgumentError, 'Could not find manifest file' unless File.exist?(TableSaw.configuration.manifest)

new(YAML.safe_load(File.read(TableSaw.configuration.manifest)))
new(YAML.safe_load_file(TableSaw.configuration.manifest))
end

attr_reader :config
Expand Down
8 changes: 4 additions & 4 deletions spec/table_saw/associations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
end

def foreign_key(from_table, from_column, to_table, to_column)
TableSaw::ForeignKey.new from_table: from_table,
from_column: from_column,
to_table: to_table,
to_column: to_column
TableSaw::ForeignKey.new from_table:,
from_column:,
to_table:,
to_column:
end

describe '#belongs_to' do
Expand Down
6 changes: 3 additions & 3 deletions spec/table_saw/create_dump_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
require 'table_saw/create_dump_file'

RSpec.describe TableSaw::CreateDumpFile do
subject(:creator) { described_class.new(records, output: file, format: format) }
subject(:creator) { described_class.new(records, output: file, format:) }

let(:records) do
{
'authors' => TableSaw::DependencyGraph::DumpTable.new(manifest: manifest, name: 'authors', partial: false),
'books' => TableSaw::DependencyGraph::DumpTable.new(manifest: manifest, name: 'books', partial: false)
'authors' => TableSaw::DependencyGraph::DumpTable.new(manifest:, name: 'authors', partial: false),
'books' => TableSaw::DependencyGraph::DumpTable.new(manifest:, name: 'books', partial: false)
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/table_saw/queries/prepared_insert_statement_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

RSpec.describe TableSaw::Queries::PreparedInsertStatement do
subject(:query) { described_class.new(table_name, options: options) }
subject(:query) { described_class.new(table_name, options:) }

let(:options) { {} }

Expand Down
4 changes: 2 additions & 2 deletions table_saw.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Gem::Specification.new do |spec|
spec.executables = ['table-saw']
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 3.0'
spec.required_ruby_version = '>= 3.1'
spec.metadata['rubygems_mfa_required'] = 'true'

spec.add_dependency 'activerecord', '>= 6.0'
spec.add_dependency 'activerecord', '>= 6.1'
spec.add_dependency 'pg'
spec.add_dependency 'thor'
end

0 comments on commit d03a096

Please sign in to comment.