fibered_mysql2 0.1.4 → 0.1.5.pre.ga.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: 886e707f8337bfa2ac7949cda23807f33caeee9cb68b409b05695c65cebc73ce
4
- data.tar.gz: 9c4bb45a65868e23427bea1563ce128c9716ab0146244139d035a3d9dd49d547
3
+ metadata.gz: 8ce1936ef559c3317a017cafacb9e1fafec1cf01c5bda075303479f97a0287cd
4
+ data.tar.gz: a475f56c870d6fd8e56f92d07a73ea6a73752d79f280eb796bf951c9990ce9ae
5
5
  SHA512:
6
- metadata.gz: ef965907130eb174255a789abe06284eaf29b4784d5429431680e2e3049802dd70fe326a36f37117c3d21395555cd25f55944e6c77b96bca2acddba466addfd4
7
- data.tar.gz: 19691c1282faaff78212ee6eab9036a9231a137c3f14bd8bfbbcef3fd4625bea7a71edc1add1b3d84ce8d3d22e8a67cbb72c33eb1ef8d7c1003af5e0b1279fc0
6
+ metadata.gz: bdb30f2c76ade268e36e8adbddbee09b01fb2a7ff82611158d04d3c60f8e483f7e61de589f33c362bce0fe9fffcfc34abe0498e0e2dac618d2d830263a193373
7
+ data.tar.gz: 2e4aa4b1ae2b9a809641f2a41e74dab8d780279cc9f3f5cf8352117b03b34273ea005d12258abfcb06540f046844597af682f9d44f4a6ee6f63b4f5db8c2e2cc
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: FiberedMySQL2 Gem Build
3
+ on: [push, pull_request]
4
+ jobs:
5
+ test:
6
+ name: Unit Tests
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby: [2.5, 2.6, 2.7, '3.0', 3.1]
12
+ gemfile:
13
+ - Gemfile
14
+ - gemfiles/rails_5.gemfile
15
+ - gemfiles/rails_6.gemfile
16
+ env:
17
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+ - uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{ matrix.ruby }}
23
+ bundler: 2.2.29
24
+ bundler-cache: true
25
+ - run: bundle exec rspec
@@ -0,0 +1,38 @@
1
+ ---
2
+ on:
3
+ push:
4
+ tags:
5
+ - 'v*'
6
+ - '!v*.pre*'
7
+
8
+ name: Create Release
9
+
10
+ jobs:
11
+ build:
12
+ name: Create Release
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Get version from tag
16
+ id: tag_name
17
+ shell: bash
18
+ run: |
19
+ echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
20
+ - name: Checkout code
21
+ uses: actions/checkout@v2
22
+ - name: Get Changelog Entry
23
+ id: changelog_reader
24
+ uses: mindsers/changelog-reader-action@v1
25
+ with:
26
+ version: ${{ steps.tag_name.outputs.current_version }}
27
+ path: ./CHANGELOG.md
28
+ - name: Create Release
29
+ id: create_release
30
+ uses: actions/create-release@v1
31
+ env:
32
+ GITHUB_TOKEN: ${{ secrets.GEM_RELEASE_GIT_TOKEN }}
33
+ with:
34
+ tag_name: ${{ github.ref }}
35
+ release_name: Release ${{ github.ref }}
36
+ body: ${{ steps.changelog_reader.outputs.log_entry }}
37
+ draft: false
38
+ prerelease: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.5
data/Appraisals CHANGED
@@ -1,9 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise 'rails-4' do
4
- gem 'rails', '~> 4.2'
5
- end
6
-
7
3
  appraise 'rails-5' do
8
4
  gem 'rails', '~> 5.2'
9
5
  end
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
5
  Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.1.5] - Unreleased
8
+ ### Changed
9
+ - Upgraded Bundler to 2.2.29 and Ruby to 2.7.5. Removed support for Rails 4.
10
+ - Modified FiberedMysql2::FiberedConditionVariable class to ensure compatibility with newer Ruby versions.
11
+
7
12
  ## [0.1.4] - 2021-06-25
8
13
  ### Fixed
9
14
  - Disable the ConnectionPool::Reaper in Rails 5 and 6 as it was in 4. This is important since it is
data/Gemfile CHANGED
@@ -6,12 +6,11 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
6
6
  gemspec
7
7
 
8
8
  gem 'appraisal'
9
- gem 'bundler', '~> 1.8'
10
9
  gem 'coveralls', require: false
11
- gem 'mimemagic', '~> 0.3', git: 'git@github.com:Invoca/mimemagic', ref: 'b084ce8d50c080f5a312156498be21a541fe72a2'
12
- gem 'mysql2', '0.4.5'
10
+ gem 'mysql2', '~> 0.4.5'
11
+ gem 'nokogiri', '< 1.13'
13
12
  gem 'pry', '~> 0.13'
14
13
  gem 'pry-byebug', '~> 3.9'
15
14
  gem 'rails', '< 6.1'
16
- gem 'rake', '~> 10.0'
15
+ gem 'rake', '~> 13.0'
17
16
  gem 'rspec', '~> 3.0'
data/Gemfile.lock CHANGED
@@ -1,16 +1,9 @@
1
- GIT
2
- remote: git@github.com:Invoca/mimemagic
3
- revision: b084ce8d50c080f5a312156498be21a541fe72a2
4
- ref: b084ce8d50c080f5a312156498be21a541fe72a2
5
- specs:
6
- mimemagic (0.3.5)
7
-
8
1
  PATH
9
2
  remote: .
10
3
  specs:
11
- fibered_mysql2 (0.1.4)
4
+ fibered_mysql2 (0.1.5.pre.ga.0)
12
5
  em-synchrony (~> 1.0)
13
- rails (>= 4.2, < 7)
6
+ rails (>= 5.2, < 7)
14
7
 
15
8
  GEM
16
9
  remote: https://rubygems.org/
@@ -104,19 +97,24 @@ GEM
104
97
  marcel (0.3.3)
105
98
  mimemagic (~> 0.3.2)
106
99
  method_source (1.0.0)
100
+ mimemagic (0.3.10)
101
+ nokogiri (~> 1)
102
+ rake
107
103
  mini_mime (1.0.2)
108
- mini_portile2 (2.4.0)
104
+ mini_portile2 (2.6.1)
109
105
  minitest (5.14.3)
110
- mysql2 (0.4.5)
106
+ mysql2 (0.4.10)
111
107
  nio4r (2.5.4)
112
- nokogiri (1.10.10)
113
- mini_portile2 (~> 2.4.0)
108
+ nokogiri (1.12.5)
109
+ mini_portile2 (~> 2.6.1)
110
+ racc (~> 1.4)
114
111
  pry (0.13.1)
115
112
  coderay (~> 1.1)
116
113
  method_source (~> 1.0)
117
114
  pry-byebug (3.9.0)
118
115
  byebug (~> 11.0)
119
116
  pry (~> 0.13.0)
117
+ racc (1.6.0)
120
118
  rack (2.2.3)
121
119
  rack-test (1.1.0)
122
120
  rack (>= 1.0, < 3)
@@ -146,7 +144,7 @@ GEM
146
144
  method_source
147
145
  rake (>= 0.8.7)
148
146
  thor (>= 0.20.3, < 2.0)
149
- rake (10.5.0)
147
+ rake (13.0.6)
150
148
  rspec (3.9.0)
151
149
  rspec-core (~> 3.9.0)
152
150
  rspec-expectations (~> 3.9.0)
@@ -191,16 +189,15 @@ PLATFORMS
191
189
 
192
190
  DEPENDENCIES
193
191
  appraisal
194
- bundler (~> 1.8)
195
192
  coveralls
196
193
  fibered_mysql2!
197
- mimemagic (~> 0.3)!
198
- mysql2 (= 0.4.5)
194
+ mysql2 (~> 0.4.5)
195
+ nokogiri (< 1.13)
199
196
  pry (~> 0.13)
200
197
  pry-byebug (~> 3.9)
201
198
  rails (< 6.1)
202
- rake (~> 10.0)
199
+ rake (~> 13.0)
203
200
  rspec (~> 3.0)
204
201
 
205
202
  BUNDLED WITH
206
- 1.17.3
203
+ 2.2.29
data/README.md CHANGED
@@ -21,7 +21,7 @@ Or install it yourself as:
21
21
  $ gem install fibered_mysql2
22
22
 
23
23
  ## Support
24
- Tested with Rails versions 4.2, 5.2, and 6.0.
24
+ Tested with Rails versions 5.2 and 6.0.
25
25
 
26
26
  ## Usage
27
27
 
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.require_paths = ["lib"]
31
31
 
32
32
  spec.add_dependency 'em-synchrony', '~> 1.0'
33
- spec.add_dependency 'rails', '>= 4.2', '< 7'
33
+ spec.add_dependency 'rails', '>= 5.2', '< 7'
34
34
  end
@@ -3,13 +3,13 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
- gem "bundler", "~> 1.8"
6
+ gem "bundler", "~> 2.2"
7
7
  gem "coveralls", require: false
8
- gem "mysql2", "0.4.5"
8
+ gem "mysql2", "~> 0.4.5"
9
9
  gem "pry", "~> 0.13"
10
10
  gem "pry-byebug", "~> 3.9"
11
+ gem "rails", "~> 5.2"
11
12
  gem "rake", "~> 10.0"
12
13
  gem "rspec", "~> 3.0"
13
- gem "rails", "~> 5.2"
14
14
 
15
15
  gemspec path: "../"
@@ -3,13 +3,13 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal"
6
- gem "bundler", "~> 1.8"
6
+ gem "bundler", "~> 2.2"
7
7
  gem "coveralls", require: false
8
- gem "mysql2", "0.4.5"
8
+ gem "mysql2", "~> 0.4.5"
9
9
  gem "pry", "~> 0.13"
10
10
  gem "pry-byebug", "~> 3.9"
11
+ gem "rails", "~> 6.0.0"
11
12
  gem "rake", "~> 10.0"
12
13
  gem "rspec", "~> 3.0"
13
- gem "rails", "~> 6.0.0"
14
14
 
15
15
  gemspec path: "../"
@@ -12,7 +12,73 @@ require 'fibered_mysql2/fibered_mutex_with_waiter_priority'
12
12
  EventMachine::Synchrony::Thread::Mutex.prepend(FiberedMysql2::FiberedMutexWithWaiterPriority)
13
13
 
14
14
  module FiberedMysql2
15
- class FiberedConditionVariable < MonitorMixin::ConditionVariable
15
+ class FiberedConditionVariable
16
+ EXCEPTION_NEVER = {Exception => :never}.freeze
17
+ EXCEPTION_IMMEDIATE = {Exception => :immediate}.freeze
18
+
19
+ #
20
+ # FIXME: This isn't documented in Nutshell.
21
+ #
22
+ # Since MonitorMixin.new_cond returns a ConditionVariable, and the example
23
+ # above calls while_wait and signal, this class should be documented.
24
+ #
25
+ class Timeout < Exception; end
26
+
27
+ #
28
+ # Releases the lock held in the associated monitor and waits; reacquires the lock on wakeup.
29
+ #
30
+ # If +timeout+ is given, this method returns after +timeout+ seconds passed,
31
+ # even if no other thread doesn't signal.
32
+ #
33
+ def wait(timeout = nil)
34
+ Thread.handle_interrupt(EXCEPTION_NEVER) do
35
+ @monitor.__send__(:mon_check_owner)
36
+ count = @monitor.__send__(:mon_exit_for_cond)
37
+ begin
38
+ Thread.handle_interrupt(EXCEPTION_IMMEDIATE) do
39
+ @cond.wait(@monitor.instance_variable_get(:@mon_mutex), timeout)
40
+ end
41
+ return true
42
+ ensure
43
+ @monitor.__send__(:mon_enter_for_cond, count)
44
+ end
45
+ end
46
+ end
47
+
48
+ #
49
+ # Calls wait repeatedly while the given block yields a truthy value.
50
+ #
51
+ def wait_while
52
+ while yield
53
+ wait
54
+ end
55
+ end
56
+
57
+ #
58
+ # Calls wait repeatedly until the given block yields a truthy value.
59
+ #
60
+ def wait_until
61
+ until yield
62
+ wait
63
+ end
64
+ end
65
+
66
+ #
67
+ # Wakes up the first thread in line waiting for this lock.
68
+ #
69
+ def signal
70
+ @monitor.__send__(:mon_check_owner)
71
+ @cond.signal
72
+ end
73
+
74
+ #
75
+ # Wakes up all threads waiting for this lock.
76
+ #
77
+ def broadcast
78
+ @monitor.__send__(:mon_check_owner)
79
+ @cond.broadcast
80
+ end
81
+
16
82
  def initialize(monitor)
17
83
  @monitor = monitor
18
84
  @cond = EM::Synchrony::Thread::ConditionVariable.new
@@ -90,8 +156,6 @@ module FiberedMysql2
90
156
  FiberedConditionVariable.new(self)
91
157
  end
92
158
 
93
- private
94
-
95
159
  # Initializes the FiberedMonitorMixin after being included in a class
96
160
  def mon_initialize
97
161
  @mon_owner = nil
@@ -103,6 +167,8 @@ module FiberedMysql2
103
167
  @mon_owner == Fiber.current or raise FiberError, "current fiber not owner"
104
168
  end
105
169
 
170
+ private
171
+
106
172
  def mon_enter_for_cond(count)
107
173
  @mon_owner = Fiber.current
108
174
  @mon_count = count
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FiberedMysql2
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5.pre.ga.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fibered_mysql2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5.pre.ga.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca Development
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-25 00:00:00.000000000 Z
11
+ date: 2022-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-synchrony
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4.2'
33
+ version: '5.2'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: '7'
@@ -40,20 +40,22 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '4.2'
43
+ version: '5.2'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '7'
47
- description:
47
+ description:
48
48
  email:
49
49
  - development@invoca.com
50
50
  executables: []
51
51
  extensions: []
52
52
  extra_rdoc_files: []
53
53
  files:
54
+ - ".github/workflows/build.yml"
55
+ - ".github/workflows/release.yml"
54
56
  - ".gitignore"
55
57
  - ".rspec"
56
- - ".travis.yml"
58
+ - ".ruby-version"
57
59
  - Appraisals
58
60
  - CHANGELOG.md
59
61
  - Gemfile
@@ -63,7 +65,6 @@ files:
63
65
  - bin/console
64
66
  - bin/setup
65
67
  - fibered_mysql2.gemspec
66
- - gemfiles/rails_4.gemfile
67
68
  - gemfiles/rails_5.gemfile
68
69
  - gemfiles/rails_6.gemfile
69
70
  - lib/active_record/connection_adapters/fibered_mysql2_adapter.rb
@@ -77,7 +78,7 @@ licenses: []
77
78
  metadata:
78
79
  allowed_push_host: https://rubygems.org
79
80
  homepage_uri: https://github.com/Invoca/fibered_mysql2
80
- post_install_message:
81
+ post_install_message:
81
82
  rdoc_options: []
82
83
  require_paths:
83
84
  - lib
@@ -88,12 +89,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
89
  version: '0'
89
90
  required_rubygems_version: !ruby/object:Gem::Requirement
90
91
  requirements:
91
- - - ">="
92
+ - - ">"
92
93
  - !ruby/object:Gem::Version
93
- version: '0'
94
+ version: 1.3.1
94
95
  requirements: []
95
- rubygems_version: 3.0.1
96
- signing_key:
96
+ rubygems_version: 3.1.6
97
+ signing_key:
97
98
  specification_version: 4
98
99
  summary: An adapter for fibered mysql2
99
100
  test_files: []
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.1
7
- gemfile:
8
- - gemfiles/rails_4.gemfile
9
- - gemfiles/rails_5.gemfile
10
- - gemfiles/rails_6.gemfile
11
- script:
12
- - bundle exec rspec
@@ -1,15 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "bundler", "~> 1.8"
7
- gem "coveralls", require: false
8
- gem "mysql2", "0.4.5"
9
- gem "pry", "~> 0.13"
10
- gem "pry-byebug", "~> 3.9"
11
- gem "rake", "~> 10.0"
12
- gem "rspec", "~> 3.0"
13
- gem "rails", "~> 4.2"
14
-
15
- gemspec path: "../"