trilogy 2.11.0 → 2.11.1

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trilogy/version.rb +1 -1
  3. data/lib/trilogy.rb +19 -14
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0625a7ff415d68c8f5e421188e66fe7c41ebadd2afc39a7d6b89c6318ea9ef9d
4
- data.tar.gz: c6b10922d195af6ec3b5140963749b59d4ef4a967728aeeb826377bc66992bc0
3
+ metadata.gz: 5072d4f5e6bf162eb99d8a465ffb746f0d4cc9673c18ae5bf8bf3972ea9bf061
4
+ data.tar.gz: 44b42a75a259456bad0f5ef3120f355ef2685cfb18d4440ea4656b1f48a55ced
5
5
  SHA512:
6
- metadata.gz: 5da895e095a69094c7f1844d341ea2bf0c4461f7744f892a5a6f3aff1552761ebb8f099a5df151450c6c32e894e88cfebf72052c8190aef749be0d8d56ad0611
7
- data.tar.gz: 60830ae194994fa09a975d3cea8146632300bfef62e98726c7cd6edfdb18a91bd3bce55a9fbf0d5b5d2fa0932d2a264333d87ccb57ae222e59a46bd3c5740fd7
6
+ metadata.gz: 9dc778f0bfeefcbfc5233f61e4d43f549ceb47f95e407bdea29c1aaafe0b19945ad7e2a34d1a28eb73accae4fa447f9eb07a546cde0d1fe1015e9cdc6cf32b17
7
+ data.tar.gz: a03e0efd31525f14669ca4a0fdf5b77117ed7da34d6dacccea748c75468e0ec0f927eca797c966cfd7da5ebdd5a10dc458aed8af965e9e9b0a9a1920c86281a0
@@ -1,3 +1,3 @@
1
1
  class Trilogy
2
- VERSION = "2.11.0"
2
+ VERSION = "2.11.1"
3
3
  end
data/lib/trilogy.rb CHANGED
@@ -16,26 +16,31 @@ class Trilogy
16
16
  end
17
17
  private_constant :IO_TIMEOUT_ERROR
18
18
 
19
- Synchronization = Module.new
20
-
21
- source = public_instance_methods(false).flat_map do |method|
22
- [
23
- "def #{method}(...)",
24
- "raise SynchronizationError unless @mutex.try_lock",
25
- "begin",
26
- "super",
27
- "ensure",
28
- "@mutex.unlock",
19
+ module Synchronization
20
+ def initialize(...)
21
+ @mutex = Mutex.new
22
+ super
23
+ end
24
+
25
+ synchronized_methods = Trilogy.public_instance_methods(false) - %i(closed?)
26
+ source = synchronized_methods.flat_map do |method|
27
+ [
28
+ "def #{method}(...)",
29
+ "raise SynchronizationError unless @mutex.try_lock",
30
+ "begin",
31
+ "super",
32
+ "ensure",
33
+ "@mutex.unlock",
34
+ "end",
29
35
  "end",
30
- "end",
31
- ]
36
+ ]
37
+ end
38
+ class_eval(source.join(";"), __FILE__, __LINE__)
32
39
  end
33
- Synchronization.class_eval(source.join(";"), __FILE__, __LINE__)
34
40
 
35
41
  prepend(Synchronization)
36
42
 
37
43
  def initialize(options = {})
38
- @mutex = Mutex.new
39
44
  options[:port] = options[:port].to_i if options[:port]
40
45
  mysql_encoding = options[:encoding] || "utf8mb4"
41
46
  encoding = Trilogy::Encoding.find(mysql_encoding)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trilogy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.0
4
+ version: 2.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub Engineering
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements: []
88
- rubygems_version: 3.6.9
88
+ rubygems_version: 4.0.3
89
89
  specification_version: 4
90
90
  summary: A friendly MySQL-compatible library for Ruby, binding to libtrilogy
91
91
  test_files: []