activerecord-bogacs 0.6.0 → 0.7.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: a11630875cf14ee4c1ea37721a04a1966eeb488874d23c833075e42c2e435852
4
- data.tar.gz: 77016cc2628013c4a1791403fcbf65ad488f8db4f6a091a9659e1e0b523c7e38
3
+ metadata.gz: 5010de8016e3c5896dc032a0fa6afc6ab5cbb1808f60e7c6f42b22b280910aeb
4
+ data.tar.gz: 3290de6d8265973c7efa237e18de7f96253580363b743785b069f34c5c92504a
5
5
  SHA512:
6
- metadata.gz: 89a482ca85813ef8b769355a0a42ffe0317024022c0da7ad337084029ad455976865199806b6f79fbd0b79c1288ec7f6a1654ec9aea66ec07b544b28329f5dcc
7
- data.tar.gz: 624c0fe63b5ff31ef51abeb2dd537fe3ef2bddad81f03cd94df38fb7aafea3b93635a844554bb7597ec08fc551215c016e1c1ebcb3817230220455919db1ade3
6
+ metadata.gz: 559b6831696d5e7ca408c735bc1f61bcb5c3fcfad19b0806aff943a47c623ac322462e79c3cefc1aca745df5cdda19986651c405e2024eebb8fa3c4cf02d7296
7
+ data.tar.gz: 588ccb8e705390652de5162a26cee060ce8fe51887693069602a55cfecfb19175b23268a821a7c956d7494d6be542f486c6bda89a4814932e8ee4249965a97de
@@ -0,0 +1,82 @@
1
+ name: Test
2
+
3
+ on: [push, pull_request]
4
+
5
+ env:
6
+ JAVA_OPTS: '-XX:+TieredCompilation -XX:TieredStopAtLevel=1'
7
+
8
+ jobs:
9
+
10
+ rake-test:
11
+ runs-on: ubuntu-latest
12
+ services:
13
+ mysql:
14
+ image: mysql:5.7
15
+ env:
16
+ MYSQL_ALLOW_EMPTY_PASSWORD: yes
17
+ MYSQL_ROOT_PASSWORD: root
18
+ MYSQL_DATABASE: ar_bogacs
19
+ ports:
20
+ - 3306:3306
21
+ options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
22
+
23
+ env:
24
+ AR_ADAPTER: mysql2
25
+ AR_USERNAME: root
26
+ AR_PASSWORD: root
27
+ AR_HOST: 127.0.0.1
28
+ AR_VERSION: "~> 4.2"
29
+ HIKARI_VERSION: 2.3.12
30
+
31
+ strategy:
32
+ matrix:
33
+ java-version: [ 11 ]
34
+ ruby-version: [ jruby-9.3.6.0 ]
35
+ include:
36
+ - java-version: 11
37
+ ruby-version: jruby-9.2.20.1
38
+ - java-version: 11
39
+ ruby-version: jruby-9.2.10.0
40
+ - java-version: 17
41
+ ruby-version: jruby-9.2.20.1
42
+ - java-version: 8
43
+ ruby-version: jruby-9.2.9.0
44
+ - java-version: 8
45
+ ruby-version: jruby-9.1.17.0
46
+ env:
47
+ AR_VERSION: "~> 4.1.14"
48
+
49
+ fail-fast: false
50
+
51
+ steps:
52
+ - name: check mysql from host
53
+ run: |
54
+ sudo apt install -y mysql-client
55
+ mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "SHOW DATABASES"
56
+
57
+ - name: checkout
58
+ uses: actions/checkout@v2
59
+
60
+ - name: set up java ${{ matrix.java-version }}
61
+ uses: actions/setup-java@v1.4.3
62
+ with:
63
+ java-version: ${{ matrix.java-version }}
64
+
65
+ - name: set up ${{ matrix.ruby-version }}
66
+ uses: ruby/setup-ruby@v1
67
+ with:
68
+ ruby-version: ${{ matrix.ruby-version }}
69
+
70
+ - name: install bundler
71
+ run: jruby -S gem install bundler -v "~>2.2.28"
72
+
73
+ - name: bundle install
74
+ run: jruby -S bundle install
75
+
76
+ - name: download jars
77
+ run: jruby -rbundler/setup -S rake tomcat:jndi:download tomcat:jdbc:download tomcat:dbcp:download hikari:download
78
+ shell: bash
79
+
80
+ - name: rake test
81
+ run: jruby -rbundler/setup -S rake test
82
+ shell: bash
data/Gemfile CHANGED
@@ -16,14 +16,6 @@ else
16
16
  gem 'activerecord', :require => nil
17
17
  end
18
18
 
19
- if RUBY_VERSION.index('1.8') == 0
20
- gem 'i18n', '< 0.7.0' # Gem::InstallError: i18n requires Ruby version >= 1.9.3
21
- gem 'atomic', '1.1.16' # concurrent-ruby gem only for Ruby version >= 1.9.3
22
- gem 'thread_safe', '~> 0.3'
23
- else
24
- gem 'concurrent-ruby', '~> 1.0.0', :require => nil
25
- end
26
-
27
19
  platform :jruby do
28
20
  if version = ENV['AR_JDBC_VERSION']
29
21
  if version.index('/') && ::File.exist?(version)
@@ -40,16 +32,11 @@ platform :jruby do
40
32
  end
41
33
  end
42
34
 
43
- #gem 'thread_safe', :require => nil # "optional" - we can roll without it
44
-
45
- if defined?(JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
46
- gem 'jruby-openssl', :platform => :jruby
47
- end
48
-
49
35
  group :test do
50
36
  gem 'jdbc-mysql', :require => nil, :platform => :jruby
51
37
  gem 'jdbc-postgres', :require => nil, :platform => :jruby
38
+ gem 'jdbc-sqlite3', :require => nil, :platform => :jruby
52
39
 
53
40
  gem 'mysql2', :require => nil, :platform => :mri
54
41
  gem 'pg', :require => nil, :platform => :mri
55
- end
42
+ end
data/Rakefile CHANGED
@@ -105,9 +105,11 @@ def _download(uri, download_dir, as_file_name)
105
105
  FileUtils.rm_r temp_dir
106
106
  end
107
107
 
108
+ MAVEN_BASE_URL = 'https://repo.maven.apache.org/maven2'
109
+
108
110
  namespace :tomcat do
109
111
 
110
- tomcat_maven_repo = 'http://repo2.maven.org/maven2/org/apache/tomcat'
112
+ tomcat_maven_repo = "#{MAVEN_BASE_URL}/org/apache/tomcat"
111
113
  download_dir = File.expand_path('test/jars', File.dirname(__FILE__))
112
114
  version_default = '7.0.64'
113
115
 
@@ -191,7 +193,7 @@ end
191
193
 
192
194
  namespace :dbcp do # a.k.a DBCP2
193
195
 
194
- commons_repo = 'http://repo2.maven.org/maven2/org/apache/commons'
196
+ commons_repo = "#{MAVEN_BASE_URL}/org/apache/commons"
195
197
  download_dir = File.expand_path('test/jars', File.dirname(__FILE__))
196
198
  version_default = '2.0.1'
197
199
 
@@ -213,7 +215,7 @@ end
213
215
 
214
216
  namespace :c3p0 do
215
217
 
216
- mchange_base_repo = 'http://repo2.maven.org/maven2/com/mchange'
218
+ mchange_base_repo = "#{MAVEN_BASE_URL}/com/mchange"
217
219
  download_dir = File.expand_path('test/jars', File.dirname(__FILE__))
218
220
  c3p0_version = '0.9.5'
219
221
  mchange_commons_version = '0.2.9'
@@ -242,9 +244,9 @@ end
242
244
 
243
245
  namespace :hikari do
244
246
 
245
- hikari_base_repo = 'http://repo2.maven.org/maven2/com/zaxxer'
246
- slf4j_base_repo = 'http://repo2.maven.org/maven2/org/slf4j'
247
- javassist_base_repo = 'http://repo2.maven.org/maven2/org/javassist'
247
+ hikari_base_repo = "#{MAVEN_BASE_URL}/com/zaxxer"
248
+ slf4j_base_repo = "#{MAVEN_BASE_URL}/org/slf4j"
249
+ javassist_base_repo = "#{MAVEN_BASE_URL}/org/javassist"
248
250
  download_dir = File.expand_path('test/jars', File.dirname(__FILE__))
249
251
  hikari_version = '1.4.0'
250
252
  slf4j_version = '1.7.10'
@@ -9,10 +9,9 @@ Gem::Specification.new do |gem|
9
9
  gem.authors = ['Karol Bucek']
10
10
  gem.email = ['self@kares.org']
11
11
  gem.description = %q{Improved ActiveRecord::ConnectionAdapters::ConnectionPool alternatives}
12
- gem.summary = 'Bogacs contains several pool implementations that can be used as a replacement ' <<
13
- "for ActiveRecord's built-in pool, e.g. DefaultPool is an upstream tuned version with an API " <<
14
- 'that is compatible with older AR versions.' <<
15
- "\n\nNOTE: you'll need concurrent-ruby or thread_safe gem."
12
+ gem.summary = 'Bogacs contains several pool implementations that can be used as a replacement ' +
13
+ "for ActiveRecord's built-in pool, e.g. DefaultPool is an upstream tuned version with an API " +
14
+ 'that is compatible with older AR versions.'
16
15
  gem.homepage = "http://github.com/kares/activerecord-bogacs"
17
16
  gem.licenses = ['MIT']
18
17
 
@@ -21,8 +20,9 @@ Gem::Specification.new do |gem|
21
20
  gem.test_files = gem.files.grep(%r{^test/})
22
21
  gem.require_paths = ["lib"]
23
22
 
24
- gem.add_development_dependency 'concurrent-ruby', '>= 0.9' if RUBY_VERSION.index('1.8') != 0
23
+ gem.add_dependency 'activerecord', '< 6' # '>= 4.0' # depends on: concurrent-ruby ~> 1.0, >= 1.0.2
24
+ gem.add_dependency 'concurrent-ruby', '~> 1.0'
25
25
 
26
- gem.add_development_dependency 'rake', '~> 10.3'
26
+ gem.add_development_dependency 'rake'
27
27
  gem.add_development_dependency 'test-unit', '~> 2.5'
28
28
  end
@@ -23,7 +23,7 @@ module ActiveRecord
23
23
  pool = super
24
24
  spec = pool.spec
25
25
  if spec.config[:pool].eql? false
26
- owner_to_pool[owner.name] = ActiveRecord::Bogacs::FalsePool.new(spec)
26
+ owner_to_pool[spec.name] = ActiveRecord::Bogacs::FalsePool.new(spec)
27
27
  else
28
28
  pool
29
29
  end