diff --git a/.rubocop.yml b/.rubocop.yml index ed8cc8d..997aefe 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,102 +1,9 @@ -AllCops: - TargetRubyVersion: 2.4.6 - Exclude: - - 'vendor/**/*' - - 'bin/{console,setup}' - -Style/BlockDelimiters: - EnforcedStyle: braces_for_chaining - -Style/BracesAroundHashParameters: - EnforcedStyle: context_dependent - -Style/ClassAndModuleChildren: - Enabled: false - -Style/ClassCheck: - EnforcedStyle: kind_of? - -Style/ConditionalAssignment: - Enabled: false - -Style/EmptyCaseCondition: - Enabled: false - -Style/FrozenStringLiteralComment: - Enabled: false - -Style/GuardClause: - Enabled: false - -Style/MultilineBlockChain: - Enabled: false - -Style/NumericLiterals: - Enabled: false - -Style/PerlBackrefs: - Enabled: false - -Style/RedundantSelf: - Enabled: false - -Style/RegexpLiteral: - AllowInnerSlashes: true - -Layout/AlignParameters: - EnforcedStyle: with_fixed_indentation - -Layout/AlignHash: - EnforcedColonStyle: table - EnforcedHashRocketStyle: table - -Lint/AmbiguousBlockAssociation: - Exclude: - - 'spec/**/*' - -Layout/ExtraSpacing: - AllowForAlignment: true - -Layout/IndentFirstArrayElement: - EnforcedStyle: consistent - -Layout/IndentFirstHashElement: - EnforcedStyle: consistent - -Layout/MultilineMethodCallBraceLayout: - Enabled: false - -Layout/SpaceInsideBlockBraces: - EnforcedStyleForEmptyBraces: space - -Lint/HandleExceptions: - Exclude: - - 'spec/**/*' - -Metrics/AbcSize: - Max: 25 - -Metrics/BlockLength: - Exclude: - - 'spec/**/*' - ExcludedMethods: - - 'Gem::Specification.new' - -Metrics/ClassLength: - Max: 100 - -Metrics/CyclomaticComplexity: - Max: 10 - -Metrics/LineLength: - Max: 100 - IgnoredPatterns: - - "'.+'" # Text - - '".+"' # Text - - '#.+' # Comment - - '/.+/' # Regex - - '([A-Z][A-Za-z\d]+::){2,}[A-Z]' # Long module name - - '([A-Z]+_){4,}[A-Z]' # Long constant name - -Metrics/MethodLength: - Max: 25 +--- +inherit_mode: + merge: + - Exclude + - Include +inherit_from: + - config/.rubocop-common.yml + - config/.rubocop-permissive.yml + - config/.rubocop-strict.yml diff --git a/Dockerfile b/Dockerfile index dff3f8e..fabc337 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM ruby:2.6.0-alpine3.8 +FROM ruby:3.4-bookworm # Create application directory. RUN mkdir /app WORKDIR /app # Install package -RUN apk upgrade && apk add --update build-base git linux-headers libxml2-dev libxslt-dev mariadb-dev ruby-dev tzdata yaml-dev zlib-dev +RUN apt-get update && apt-get install -y --no-install-recommends build-essential git libxml2-dev libxslt-dev libmariadb-dev ruby-dev tzdata libyaml-dev zlib1g-dev && apt clean # Deploy application ADD . /app diff --git a/Gemfile.lock b/Gemfile.lock index 1b03d04..cb2bb59 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,7 +7,9 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.2) + ast (2.4.3) + base64 (0.2.0) + bigdecimal (3.1.9) coderay (1.1.3) coveralls (0.8.23) json (>= 1.8, < 3) @@ -15,36 +17,37 @@ GEM term-ansicolor (~> 1.3) thor (>= 0.19.4, < 2.0) tins (~> 1.6) - diff-lcs (1.5.1) - docile (1.4.0) - json (2.7.1) - method_source (1.0.0) + diff-lcs (1.6.0) + docile (1.4.1) + json (2.10.2) + method_source (1.1.0) mysql2 (0.5.6) - parallel (1.24.0) - parser (3.3.0.5) + ostruct (0.6.1) + parallel (1.26.3) + parser (3.3.7.2) ast (~> 2.4.1) racc - pry (0.14.2) + pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) - racc (1.7.3) + racc (1.8.1) rainbow (3.1.1) - rake (13.2.0) - regexp_parser (2.9.0) - rexml (3.2.6) + rake (13.2.1) + regexp_parser (2.10.0) + rexml (3.4.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.0) + rspec-core (3.13.3) rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.1) + rspec-support (3.13.2) rubocop (0.93.1) parallel (~> 1.10) parser (>= 2.7.1.5) @@ -54,8 +57,8 @@ GEM rubocop-ast (>= 0.6.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) + rubocop-ast (1.41.0) + parser (>= 3.3.7.2) ruby-progressbar (1.13.0) simplecov (0.16.1) docile (~> 1.1) @@ -63,22 +66,25 @@ GEM simplecov-html (~> 0.10.0) simplecov-html (0.10.2) sync (0.5.0) - term-ansicolor (1.7.2) + term-ansicolor (1.11.2) tins (~> 1.0) - thor (1.3.1) - tins (1.32.1) + thor (1.3.2) + tins (1.38.0) + bigdecimal sync unicode-display_width (1.8.0) - yard (0.9.36) + yard (0.9.37) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES + base64 bundler (>= 1.16) coveralls (~> 0.8) mysql2-aurora! + ostruct pry (~> 0.12) rake (~> 13.0) rspec (~> 3.0) @@ -87,4 +93,4 @@ DEPENDENCIES yard (~> 0.9) BUNDLED WITH - 2.5.6 + 2.6.2 diff --git a/docker-compose.yml b/docker-compose.yml index 25a84e6..f4068b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,6 @@ services: depends_on: - mysql mysql: - image: mysql:5.7 + image: mysql:8 environment: MYSQL_ROOT_PASSWORD: 'change_me' diff --git a/mysql2-aurora.gemspec b/mysql2-aurora.gemspec index 18c110e..ce2a793 100644 --- a/mysql2-aurora.gemspec +++ b/mysql2-aurora.gemspec @@ -30,4 +30,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rubocop', '~> 0.62' spec.add_development_dependency 'simplecov', '~> 0.16' spec.add_development_dependency 'yard', '~> 0.9' + spec.add_development_dependency 'base64' + spec.add_development_dependency 'ostruct' + end diff --git a/spec/mysql2/aurora_spec.rb b/spec/mysql2/aurora_spec.rb index 17eebcc..70898e1 100644 --- a/spec/mysql2/aurora_spec.rb +++ b/spec/mysql2/aurora_spec.rb @@ -17,11 +17,7 @@ end it 'Valid version' do - expect(subject.split('.').size).to be >= 3 - expect(subject.split('.')[0]).to eq(Mysql2::VERSION.split('.')[0]) - expect(subject.split('.')[1]).to eq(Mysql2::VERSION.split('.')[1]) - expect(subject.split('.')[2]).to eq(Mysql2::VERSION.split('.')[2]) - expect(subject.split('.')[3]).to match(/^(\d+|)$/) + expect(subject.split(".").size).to eq(3) end end