active_record_mysql_xverify 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +10 -0
- data/.github/workflows/test.yml +6 -1
- data/.rubocop.yml +5 -1
- data/Appraisals +6 -2
- data/Dockerfile +0 -7
- data/README.md +12 -2
- data/docker-compose.yml +6 -2
- data/gemfiles/ar61.gemfile +1 -1
- data/gemfiles/ar70.gemfile +1 -1
- data/gemfiles/ar71.gemfile +7 -0
- data/lib/active_record_mysql_xverify/verifier.rb +4 -4
- data/lib/active_record_mysql_xverify/version.rb +1 -1
- metadata +4 -4
- data/bin/console +0 -15
- data/bin/setup +0 -8
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f7575ed4ef4e91aa458e8f7f9a4fb38319b7fcdc07e89a6fe101c4998dbc1a8b
         | 
| 4 | 
            +
              data.tar.gz: 3b88c54bffb73d7d69ca5df81172b72a3df4f4cd03e568967a1969133e6f17bb
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 956a695d38ac8f6c5d73c2b7e297c6f1a1615f57176b3b33d8c1a9d3dee08e5c1aa5343b35d8d8e3a6f22a3e98b75b5f9699734d6ddcc8a97893a32fcbb3b77c
         | 
| 7 | 
            +
              data.tar.gz: 152451692be0cb60f5307981fb12dc4535de405d914e511692c93f13becd9187ce68cb2d99de26a6da24f7d0ffe6bb2866107345ffbec56e8dd32bcd78b0299c
         | 
    
        data/.github/workflows/test.yml
    CHANGED
    
    | @@ -4,6 +4,10 @@ on: | |
| 4 4 | 
             
              push:
         | 
| 5 5 | 
             
              pull_request:
         | 
| 6 6 |  | 
| 7 | 
            +
            concurrency:
         | 
| 8 | 
            +
              group: ${{ github.workflow }}-${{ github.ref }}
         | 
| 9 | 
            +
              cancel-in-progress: true
         | 
| 10 | 
            +
             | 
| 7 11 | 
             
            jobs:
         | 
| 8 12 | 
             
              build:
         | 
| 9 13 | 
             
                runs-on: ubuntu-latest
         | 
| @@ -27,11 +31,12 @@ jobs: | |
| 27 31 | 
             
                      - gemfiles/ar60.gemfile
         | 
| 28 32 | 
             
                      - gemfiles/ar61.gemfile
         | 
| 29 33 | 
             
                      - gemfiles/ar70.gemfile
         | 
| 34 | 
            +
                      - gemfiles/ar71.gemfile
         | 
| 30 35 | 
             
                env:
         | 
| 31 36 | 
             
                  DATABASE_HOST: 127.0.0.1
         | 
| 32 37 | 
             
                  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
         | 
| 33 38 | 
             
                steps:
         | 
| 34 | 
            -
                  - uses: actions/checkout@ | 
| 39 | 
            +
                  - uses: actions/checkout@v4
         | 
| 35 40 | 
             
                  - uses: ruby/setup-ruby@v1
         | 
| 36 41 | 
             
                    with:
         | 
| 37 42 | 
             
                      ruby-version: ${{ matrix.ruby }}
         | 
    
        data/.rubocop.yml
    CHANGED
    
    | @@ -7,7 +7,7 @@ AllCops: | |
| 7 7 | 
             
              NewCops: enable
         | 
| 8 8 | 
             
            Metrics/BlockLength:
         | 
| 9 9 | 
             
              Enabled: false
         | 
| 10 | 
            -
             | 
| 10 | 
            +
            Layout/LineLength:
         | 
| 11 11 | 
             
              Enabled: false
         | 
| 12 12 | 
             
            Metrics/MethodLength:
         | 
| 13 13 | 
             
              Enabled: false
         | 
| @@ -19,3 +19,7 @@ Style/TrailingCommaInHashLiteral: | |
| 19 19 | 
             
              EnforcedStyleForMultiline: consistent_comma
         | 
| 20 20 | 
             
            Gemspec/DevelopmentDependencies:
         | 
| 21 21 | 
             
              Enabled: false
         | 
| 22 | 
            +
            Metrics/CyclomaticComplexity:
         | 
| 23 | 
            +
              Enabled: false
         | 
| 24 | 
            +
            Metrics/PerceivedComplexity:
         | 
| 25 | 
            +
              Enabled: false
         | 
    
        data/Appraisals
    CHANGED
    
    | @@ -5,9 +5,13 @@ appraise 'ar60' do | |
| 5 5 | 
             
            end
         | 
| 6 6 |  | 
| 7 7 | 
             
            appraise 'ar61' do
         | 
| 8 | 
            -
              gem 'activerecord', '~> 6.1'
         | 
| 8 | 
            +
              gem 'activerecord', '~> 6.1.0'
         | 
| 9 9 | 
             
            end
         | 
| 10 10 |  | 
| 11 11 | 
             
            appraise 'ar70' do
         | 
| 12 | 
            -
              gem 'activerecord', '~> 7.0'
         | 
| 12 | 
            +
              gem 'activerecord', '~> 7.0.0'
         | 
| 13 | 
            +
            end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            appraise 'ar71' do
         | 
| 16 | 
            +
              gem 'activerecord', '~> 7.1.0'
         | 
| 13 17 | 
             
            end
         | 
    
        data/Dockerfile
    CHANGED
    
    | @@ -7,10 +7,3 @@ RUN apt-get update && \ | |
| 7 7 | 
             
              rubygems
         | 
| 8 8 |  | 
| 9 9 | 
             
            WORKDIR /mnt
         | 
| 10 | 
            -
            COPY Gemfile* ./
         | 
| 11 | 
            -
            COPY lib/active_record_mysql_xverify/version.rb ./lib/active_record_mysql_xverify/
         | 
| 12 | 
            -
            COPY Appraisals ./
         | 
| 13 | 
            -
            COPY activerecord_mysql_xverify.gemspec ./
         | 
| 14 | 
            -
            RUN gem update bundler -f && \
         | 
| 15 | 
            -
              bundle install && \
         | 
| 16 | 
            -
              bundle exec appraisal install
         | 
    
        data/README.md
    CHANGED
    
    | @@ -134,10 +134,20 @@ Completed 302 Found in 150ms (ActiveRecord: 145.2ms) | |
| 134 134 |  | 
| 135 135 | 
             
            ## Test
         | 
| 136 136 |  | 
| 137 | 
            +
            ### Preparation
         | 
| 138 | 
            +
             | 
| 137 139 | 
             
            ```sh
         | 
| 138 | 
            -
            docker compose up -d
         | 
| 139 140 | 
             
            docker compose build client
         | 
| 140 | 
            -
            docker compose run --rm client  | 
| 141 | 
            +
            docker compose run --rm client gem update bundler
         | 
| 142 | 
            +
            docker compose run --rm client bundle install
         | 
| 143 | 
            +
            docker compose run --rm client appraisal install
         | 
| 144 | 
            +
            ```
         | 
| 145 | 
            +
             | 
| 146 | 
            +
            ### Run tests
         | 
| 147 | 
            +
             | 
| 148 | 
            +
            ```sh
         | 
| 149 | 
            +
            docker compose up -d
         | 
| 150 | 
            +
            docker compose run client appraisal ar60 rake
         | 
| 141 151 | 
             
            ```
         | 
| 142 152 |  | 
| 143 153 | 
             
            ## Related links
         | 
    
        data/docker-compose.yml
    CHANGED
    
    | @@ -3,11 +3,15 @@ services: | |
| 3 3 | 
             
                build: .
         | 
| 4 4 | 
             
                volumes:
         | 
| 5 5 | 
             
                  - ./:/mnt
         | 
| 6 | 
            -
             | 
| 7 | 
            -
                  -  | 
| 6 | 
            +
                  - gems_bin:/usr/local/bin
         | 
| 7 | 
            +
                  - gems:/usr/local/lib/ruby/gems/2.7.0
         | 
| 8 8 | 
             
                profiles:
         | 
| 9 9 | 
             
                  - extra
         | 
| 10 10 | 
             
              mysql:
         | 
| 11 | 
            +
                platform: linux/amd64
         | 
| 11 12 | 
             
                image: mysql:5.7
         | 
| 12 13 | 
             
                environment:
         | 
| 13 14 | 
             
                  MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
         | 
| 15 | 
            +
            volumes:
         | 
| 16 | 
            +
              gems_bin:
         | 
| 17 | 
            +
              gems:
         | 
    
        data/gemfiles/ar61.gemfile
    CHANGED
    
    
    
        data/gemfiles/ar70.gemfile
    CHANGED
    
    
| @@ -3,10 +3,10 @@ | |
| 3 3 | 
             
            module ActiveRecordMysqlXverify
         | 
| 4 4 | 
             
              module Verifier
         | 
| 5 5 | 
             
                def active?
         | 
| 6 | 
            -
                  if _extend_verify?
         | 
| 6 | 
            +
                  if (@raw_connection || @connection) && _extend_verify?
         | 
| 7 7 | 
             
                    is_active = begin
         | 
| 8 8 | 
             
                      verifier = ActiveRecordMysqlXverify.verify
         | 
| 9 | 
            -
                      verifier.call(@connection)
         | 
| 9 | 
            +
                      verifier.call(@raw_connection || @connection)
         | 
| 10 10 | 
             
                    rescue StandardError => e
         | 
| 11 11 | 
             
                      ActiveRecordMysqlXverify.logger.warn("Connection verification failed: #{_build_verify_error_message(e)}")
         | 
| 12 12 | 
             
                      false
         | 
| @@ -16,7 +16,7 @@ module ActiveRecordMysqlXverify | |
| 16 16 |  | 
| 17 17 | 
             
                    unless is_active
         | 
| 18 18 | 
             
                      ActiveRecordMysqlXverify.logger.info(
         | 
| 19 | 
            -
                        "Invalid connection: #{ActiveRecordMysqlXverify::Utils.mysql2_connection_info(@connection)}"
         | 
| 19 | 
            +
                        "Invalid connection: #{ActiveRecordMysqlXverify::Utils.mysql2_connection_info(@raw_connection || @connection)}"
         | 
| 20 20 | 
             
                      )
         | 
| 21 21 | 
             
                    end
         | 
| 22 22 |  | 
| @@ -27,7 +27,7 @@ module ActiveRecordMysqlXverify | |
| 27 27 | 
             
                end
         | 
| 28 28 |  | 
| 29 29 | 
             
                def _build_verify_error_message(e)
         | 
| 30 | 
            -
                  "cause: #{e.message} [#{e.class}, " + ActiveRecordMysqlXverify::Utils.mysql2_connection_info(@connection)
         | 
| 30 | 
            +
                  "cause: #{e.message} [#{e.class}, " + ActiveRecordMysqlXverify::Utils.mysql2_connection_info(@raw_connection || @connection)
         | 
| 31 31 | 
             
                end
         | 
| 32 32 |  | 
| 33 33 | 
             
                def _extend_verify?
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: active_record_mysql_xverify
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.4.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - winebarrel
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2023- | 
| 11 | 
            +
            date: 2023-10-09 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activerecord
         | 
| @@ -144,6 +144,7 @@ executables: [] | |
| 144 144 | 
             
            extensions: []
         | 
| 145 145 | 
             
            extra_rdoc_files: []
         | 
| 146 146 | 
             
            files:
         | 
| 147 | 
            +
            - ".github/dependabot.yml"
         | 
| 147 148 | 
             
            - ".github/workflows/test.yml"
         | 
| 148 149 | 
             
            - ".gitignore"
         | 
| 149 150 | 
             
            - ".rspec"
         | 
| @@ -155,13 +156,12 @@ files: | |
| 155 156 | 
             
            - README.md
         | 
| 156 157 | 
             
            - Rakefile
         | 
| 157 158 | 
             
            - activerecord_mysql_xverify.gemspec
         | 
| 158 | 
            -
            - bin/console
         | 
| 159 | 
            -
            - bin/setup
         | 
| 160 159 | 
             
            - docker-compose.yml
         | 
| 161 160 | 
             
            - gemfiles/.bundle/config
         | 
| 162 161 | 
             
            - gemfiles/ar60.gemfile
         | 
| 163 162 | 
             
            - gemfiles/ar61.gemfile
         | 
| 164 163 | 
             
            - gemfiles/ar70.gemfile
         | 
| 164 | 
            +
            - gemfiles/ar71.gemfile
         | 
| 165 165 | 
             
            - lib/active_record_mysql_xverify.rb
         | 
| 166 166 | 
             
            - lib/active_record_mysql_xverify/config.rb
         | 
| 167 167 | 
             
            - lib/active_record_mysql_xverify/constants.rb
         | 
    
        data/bin/console
    DELETED
    
    | @@ -1,15 +0,0 @@ | |
| 1 | 
            -
            #!/usr/bin/env ruby
         | 
| 2 | 
            -
            # frozen_string_literal: true
         | 
| 3 | 
            -
             | 
| 4 | 
            -
            require 'bundler/setup'
         | 
| 5 | 
            -
            require 'active_record_mysql_xverify'
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            # You can add fixtures and/or initialization code here to make experimenting
         | 
| 8 | 
            -
            # with your gem easier. You can also use a different console, if you like.
         | 
| 9 | 
            -
             | 
| 10 | 
            -
            # (If you use this, don't forget to add pry to your Gemfile!)
         | 
| 11 | 
            -
            # require "pry"
         | 
| 12 | 
            -
            # Pry.start
         | 
| 13 | 
            -
             | 
| 14 | 
            -
            require 'irb'
         | 
| 15 | 
            -
            IRB.start(__FILE__)
         |