activerecord-pedantmysql2-adapter 1.2.0 → 1.3.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/workflows/ci.yml +31 -0
- data/activerecord-pedantmysql2-adapter.gemspec +1 -1
- data/gemfiles/{Gemfile.activerecord60 → Gemfile.activerecord-6.0} +0 -0
- data/gemfiles/{Gemfile.activerecord52 → Gemfile.activerecord-6.1} +1 -1
- data/gemfiles/Gemfile.activerecord-edge +1 -1
- data/lib/active_record/connection_adapters/pedant_mysql2_adapter.rb +2 -1
- data/lib/pedant_mysql2/version.rb +1 -1
- data/spec/connection_spec.rb +6 -1
- data/spec/spec_helper.rb +17 -2
- data/spec/support/database.rb +0 -9
- metadata +7 -7
- data/.travis.yml +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5255cb91c19fa45adb1a277a95d8e9113e6f52cd5c76c418bc79025a16724bc2
|
4
|
+
data.tar.gz: 897ba4f42c2e58edff7b6a159d7007c273560a025c813099822c432576ffe473
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a7c36b9b2d2d94b813bd3992878fb97c6ef5052285e0c29f53fcbfe3623047d7c00e0cd5776e013c5b2079a7e114603bc0d8a3dcc0a8ac70a1e0ab11201c754
|
7
|
+
data.tar.gz: 3f25aa8d59e4adc8d5fd6f66905740ce3af5fd55a4373502e7ba5f66a0a39384d4749ebb2e891fd3dffb2913e203c05452ea84e7281a81d1a949bb99da182c04
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
name: Ruby ${{ matrix.ruby }} / Active Record ${{ matrix.activerecord }}
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby: ['2.6', '2.7', '3.0']
|
12
|
+
activerecord: ['6.0', '6.1', 'edge']
|
13
|
+
exclude:
|
14
|
+
- ruby: '2.6'
|
15
|
+
activerecord: 'edge'
|
16
|
+
env:
|
17
|
+
BUNDLE_GEMFILE: gemfiles/Gemfile.activerecord-${{ matrix.activerecord }}
|
18
|
+
steps:
|
19
|
+
- name: Check out code
|
20
|
+
uses: actions/checkout@v2
|
21
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
25
|
+
bundler-cache: true
|
26
|
+
- name: Start MySQL and create DB
|
27
|
+
run: |
|
28
|
+
sudo systemctl start mysql.service
|
29
|
+
mysql -uroot -proot -e 'create database pedant_mysql2_test;'
|
30
|
+
- name: Ruby Tests
|
31
|
+
run: bundle exec rake
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
|
-
spec.add_dependency 'activerecord', '>=
|
25
|
+
spec.add_dependency 'activerecord', '>= 6.0'
|
26
26
|
spec.add_dependency 'mysql2', '>= 0.3.12'
|
27
27
|
spec.add_development_dependency 'bundler'
|
28
28
|
spec.add_development_dependency 'rake'
|
File without changes
|
@@ -58,11 +58,12 @@ class MysqlWarning < StandardError
|
|
58
58
|
end
|
59
59
|
|
60
60
|
class ActiveRecord::ConnectionAdapters::PedantMysql2Adapter < ActiveRecord::ConnectionAdapters::Mysql2Adapter
|
61
|
-
def execute(sql,
|
61
|
+
def execute(sql, *)
|
62
62
|
value = super
|
63
63
|
log_warnings(sql)
|
64
64
|
value
|
65
65
|
end
|
66
|
+
ruby2_keywords :execute if respond_to?(:ruby2_keywords, true)
|
66
67
|
|
67
68
|
def exec_delete(sql, name, binds)
|
68
69
|
@affected_rows_before_logging = nil
|
data/spec/connection_spec.rb
CHANGED
@@ -12,7 +12,12 @@ describe ActiveRecord::ConnectionHandling do
|
|
12
12
|
it 'raises NoDatabaseError correctly' do
|
13
13
|
error_class = defined?(ActiveRecord::NoDatabaseError) ? ActiveRecord::NoDatabaseError : Mysql2::Error
|
14
14
|
expect {
|
15
|
-
Mock.new.pedant_mysql2_connection({
|
15
|
+
Mock.new.pedant_mysql2_connection({
|
16
|
+
host: TestSupport::DB_CONFIG['hostname'],
|
17
|
+
username: TestSupport::DB_CONFIG['username'],
|
18
|
+
password: TestSupport::DB_CONFIG['password'],
|
19
|
+
database: 'nosuchthing',
|
20
|
+
})
|
16
21
|
}.to raise_error(error_class)
|
17
22
|
end
|
18
23
|
|
data/spec/spec_helper.rb
CHANGED
@@ -4,14 +4,29 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'rspec/its'
|
5
5
|
require 'simplecov'
|
6
6
|
require 'coveralls'
|
7
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
7
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
8
8
|
SimpleCov::Formatter::HTMLFormatter,
|
9
9
|
Coveralls::SimpleCov::Formatter
|
10
|
-
]
|
10
|
+
])
|
11
11
|
SimpleCov.start
|
12
12
|
|
13
13
|
require 'activerecord-pedantmysql2-adapter'
|
14
14
|
|
15
|
+
module TestSupport
|
16
|
+
DB_CONFIG = {
|
17
|
+
'adapter' => 'pedant_mysql2',
|
18
|
+
'database' => 'pedant_mysql2_test',
|
19
|
+
'username' => 'root',
|
20
|
+
'password' => ENV['CI'] ? 'root' : nil,
|
21
|
+
'encoding' => 'utf8',
|
22
|
+
'host' => 'localhost',
|
23
|
+
'strict' => false,
|
24
|
+
'pool' => 5,
|
25
|
+
}.freeze
|
26
|
+
end
|
27
|
+
|
28
|
+
ActiveRecord::Base.establish_connection(TestSupport::DB_CONFIG)
|
29
|
+
|
15
30
|
Dir[File.expand_path(File.join(File.dirname(__FILE__), 'support', '**', '*.rb'))].each { |f| require f }
|
16
31
|
|
17
32
|
RSpec.configure do |config|
|
data/spec/support/database.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-pedantmysql2-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Boussier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '6.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mysql2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,17 +116,17 @@ executables: []
|
|
116
116
|
extensions: []
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
|
+
- ".github/workflows/ci.yml"
|
119
120
|
- ".gitignore"
|
120
121
|
- ".rspec"
|
121
|
-
- ".travis.yml"
|
122
122
|
- Gemfile
|
123
123
|
- LICENSE.txt
|
124
124
|
- README.md
|
125
125
|
- Rakefile
|
126
126
|
- activerecord-pedantmysql2-adapter.gemspec
|
127
|
+
- gemfiles/Gemfile.activerecord-6.0
|
128
|
+
- gemfiles/Gemfile.activerecord-6.1
|
127
129
|
- gemfiles/Gemfile.activerecord-edge
|
128
|
-
- gemfiles/Gemfile.activerecord52
|
129
|
-
- gemfiles/Gemfile.activerecord60
|
130
130
|
- lib/active_record/connection_adapters/pedant_mysql2_adapter.rb
|
131
131
|
- lib/activerecord-pedantmysql2-adapter.rb
|
132
132
|
- lib/pedant_mysql2.rb
|
data/.travis.yml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
services:
|
2
|
-
- mysql
|
3
|
-
|
4
|
-
rvm:
|
5
|
-
- '2.5'
|
6
|
-
- '2.6'
|
7
|
-
- '2.7'
|
8
|
-
|
9
|
-
gemfile:
|
10
|
-
- gemfiles/Gemfile.activerecord52
|
11
|
-
- gemfiles/Gemfile.activerecord60
|
12
|
-
- gemfiles/Gemfile.activerecord-edge
|
13
|
-
|
14
|
-
matrix:
|
15
|
-
exclude:
|
16
|
-
- rvm: '2.5'
|
17
|
-
gemfile: gemfiles/Gemfile.activerecord-edge
|
18
|
-
- rvm: '2.6'
|
19
|
-
gemfile: gemfiles/Gemfile.activerecord-edge
|
20
|
-
|
21
|
-
before_script:
|
22
|
-
- mysql -u root -h 127.0.0.1 -e 'create database pedant_mysql2_test;'
|
23
|
-
|
24
|
-
sudo: false
|