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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8916472485098dffa64b7ee6eac7e6dba77ef47c11a5a6b40962cbc1a58e9876
4
- data.tar.gz: 521ce8d4c2e7cc89a9224efd0a2429c2f4eaf82b7a0f717313497ff71144886f
3
+ metadata.gz: f7575ed4ef4e91aa458e8f7f9a4fb38319b7fcdc07e89a6fe101c4998dbc1a8b
4
+ data.tar.gz: 3b88c54bffb73d7d69ca5df81172b72a3df4f4cd03e568967a1969133e6f17bb
5
5
  SHA512:
6
- metadata.gz: 0a6e9a7be89d458a1eb9a95da5e2bbc5786a8ab05443273a191308840b0550303c6370fb6c29fc1af30cbd36ba14a0cc074b2188d32c97db4482f6dabb2b20d2
7
- data.tar.gz: bcd6ae93459bf26aa3b54c0139a4980461c46910764ef72c83d1d68cf00b1408519a61e16ebb75a22160ba3184a8e78553c367ff39cc2a3c064c2d12fb7fec26
6
+ metadata.gz: 956a695d38ac8f6c5d73c2b7e297c6f1a1615f57176b3b33d8c1a9d3dee08e5c1aa5343b35d8d8e3a6f22a3e98b75b5f9699734d6ddcc8a97893a32fcbb3b77c
7
+ data.tar.gz: 152451692be0cb60f5307981fb12dc4535de405d914e511692c93f13becd9187ce68cb2d99de26a6da24f7d0ffe6bb2866107345ffbec56e8dd32bcd78b0299c
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "weekly"
@@ -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@v3
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
- Metrics/LineLength:
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 appraisal ar60 rake
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
- depends_on:
7
- - mysql
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:
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "activerecord", "~> 6.1"
5
+ gem "activerecord", "~> 6.1.0"
6
6
 
7
7
  gemspec path: "../"
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "activerecord", "~> 7.0"
5
+ gem "activerecord", "~> 7.0.0"
6
6
 
7
7
  gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 7.1.0"
6
+
7
+ gemspec path: "../"
@@ -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?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordMysqlXverify
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
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.3.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-02-25 00:00:00.000000000 Z
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__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here