Skip to content

Commit

Permalink
add Ruby 3.3 support (#99)
Browse files Browse the repository at this point in the history
* feat: 🎸 update ruby minor version

* feat: 🎸 add ruby3.3

* feat: 🎸 add circle ci build for 3.3

* feat: 🎸 fix for rubocop error

* style: 💄 apply rubocop fix

* docs: ✏️ add changelog
  • Loading branch information
kibitan authored Mar 14, 2024
1 parent a2d5259 commit c808e5f
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 21 deletions.
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ test_attributes: &test_attributes
command: docker run --entrypoint sh -e CI -e CODECOV_TOKEN masking-$RUBY_VERSION-$CIRCLE_SHA1 -c "bundle exec rake"

jobs:
test-ruby33:
<<: *test_attributes
environment:
RUBY_VERSION: '3.3'
test-ruby32:
<<: *test_attributes
environment:
Expand All @@ -42,6 +46,7 @@ jobs:
workflows:
'CircleCI: build':
jobs:
- test-ruby33
- test-ruby32
- test-ruby31
- test-ruby30
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.1
3.3.0
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- add Ruby 3.3 support [#99](https://github.com/kibitan/masking/pull/99)

## [v1.1.2] - 2023-09-24

### Added
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUBY_VERSION=3.2
ARG RUBY_VERSION=3.3

FROM ruby:${RUBY_VERSION}-alpine AS builder
RUN apk add --no-cache build-base git
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ghcr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# `docker run ghcr.io/kibitan/masking`
ARG RUBY_VERSION=3.2
ARG RUBY_VERSION=3.3

FROM ruby:$RUBY_VERSION-alpine
RUN addgroup -S app && adduser -S -G app app
Expand Down
28 changes: 16 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ GEM
concurrent-ruby (1.2.2)
diff-lcs (1.5.0)
docile (1.4.0)
json (2.6.3)
json (2.7.1)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
language_server-protocol (3.17.0.3)
mdl (0.12.0)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.1)
Expand All @@ -34,22 +35,24 @@ GEM
tomlrb
mixlib-shellout (3.2.7)
chef-utils
parallel (1.22.1)
parser (3.2.1.0)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
racc (1.7.3)
rainbow (3.1.1)
rake (13.0.6)
rake-notes (0.2.2)
colored
rake
regexp_parser (2.7.0)
rexml (3.2.5)
regexp_parser (2.9.0)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
Expand All @@ -63,25 +66,26 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubocop (1.46.0)
rubocop (1.62.1)
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.26.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.26.0)
parser (>= 3.2.1.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-capybara (2.17.1)
rubocop (~> 1.41)
rubocop-rspec (2.18.1)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
ruby-prof (1.6.1)
ruby-progressbar (1.11.0)
ruby-progressbar (1.13.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
Expand All @@ -92,7 +96,7 @@ GEM
thor
thor (1.2.1)
tomlrb (2.0.3)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ gem install masking

## Requirement

* Ruby 2.6/2.7/3.0/3.1/3.2
* Ruby 2.6/2.7/3.0/3.1/3.2/3.3

## Supporting RDBMS

Expand Down
2 changes: 1 addition & 1 deletion lib/masking/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def define_config_option(parser)
def define_version_option(parser)
parser.on('-v', '--version', 'version') do
puts Masking::VERSION
exit(true)
exit
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/masking/insert_statement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def values_regexp
# e.g. INSERT ... VALUES (123,'string ),( abc'),(456,'ab');
# refs: implementation of parsing CSV on ruby standard library FasterCSV (ja): https://www.clear-code.com/blog/2018/12/25.html
def recursive_pattern_value_concat!(value_rows, index)
return if value_rows[index].gsub(/\\\\/, '').gsub(/\\'/, '').count(?').even?
return if value_rows[index].gsub('\\\\', '').gsub("\\'", '').count(?').even?

# make destructive change for values_rows
value_rows[index] += VALUE_ROW_SPLITTER + value_rows.delete_at(index + 1)
Expand Down
4 changes: 2 additions & 2 deletions spec/masking/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

shared_examples 'print Version and exit' do
it do
expect { subject }.to raise_error(SystemExit) & \
expect { subject }.to raise_error(SystemExit) &
output("#{Masking::VERSION}\n").to_stdout
end

Expand Down Expand Up @@ -75,7 +75,7 @@

shared_examples 'with errormessage and exitstatus is 1' do |error_text|
it do
expect { subject }.to raise_error(SystemExit) & \
expect { subject }.to raise_error(SystemExit) &
output(error_text).to_stderr
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 @@ -5,7 +5,7 @@
require 'tapp'
require 'simplecov'

if ENV['CI'] == 'true' && \
if ENV['CI'] == 'true' &&
# compare only for major/minor version of Ruby in order to enable report for Coverall
Gem::Version.new(RUBY_VERSION).segments[0..1] == \
Gem::Version.new(File.read(File.join(File.dirname(__FILE__), '../.ruby-version'))).segments[0..1]
Expand Down

0 comments on commit c808e5f

Please sign in to comment.