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.
- checksums.yaml +4 -4
- data/lib/trilogy/version.rb +1 -1
- data/lib/trilogy.rb +19 -14
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5072d4f5e6bf162eb99d8a465ffb746f0d4cc9673c18ae5bf8bf3972ea9bf061
|
|
4
|
+
data.tar.gz: 44b42a75a259456bad0f5ef3120f355ef2685cfb18d4440ea4656b1f48a55ced
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9dc778f0bfeefcbfc5233f61e4d43f549ceb47f95e407bdea29c1aaafe0b19945ad7e2a34d1a28eb73accae4fa447f9eb07a546cde0d1fe1015e9cdc6cf32b17
|
|
7
|
+
data.tar.gz: a03e0efd31525f14669ca4a0fdf5b77117ed7da34d6dacccea748c75468e0ec0f927eca797c966cfd7da5ebdd5a10dc458aed8af965e9e9b0a9a1920c86281a0
|
data/lib/trilogy/version.rb
CHANGED
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
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
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.
|
|
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:
|
|
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: []
|