fixtury 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2dad3194d36ce43bfc6331ae5f8ed37abbf7509496f8b6d6344313f9512f22f8
4
- data.tar.gz: d0c0324b038362cda1f2f12ad100fef087edb931c2aeb417d6ea04e0292aa4fa
3
+ metadata.gz: 514698ec587a7323fdc0cb3c81c93dd9666e16c87d7f5f2aa867d1cd6ac95ee3
4
+ data.tar.gz: dd34ff54006e203bef96d6fce2c4c1dd2c97f9143d2d29d5e022c496600e0aff
5
5
  SHA512:
6
- metadata.gz: c7a86120bf86a3cddc62c1d36294683fe2cd280d7aa8fa2e05af1d4b81f5c9fe99e7f5086b5028173c3d580c15b50665591f8377d153a098030ca317bfab839c
7
- data.tar.gz: d8a18793cee0e6f4172e3d64826fd218c028e0b3ad1a9c33496877e5c5841cefd4741adf55bdf7ea119074822e0ea0f7c87134f565147ab71ffd82b09f2cf667
6
+ metadata.gz: 0d1b1f1222fb51994a2ce522fcdec21b8b7bb3198eaecac72d7924d59996e5f0200c00a90dca5dbc75efded7292f26593bff266844bfb41ffd8214d9f25ae469
7
+ data.tar.gz: e3bc71e4a40c3a40f12e23895e55cee83fa34b93d5db13e486c62a2e004671e64f775712dd71ba68ed4441de622ce667d2a43529ea2dacb47dafcfd3b1fb0119
@@ -21,4 +21,15 @@ updates:
21
21
  open-pull-requests-limit: 20
22
22
  insecure-external-code-execution: deny
23
23
  commit-message:
24
- prefix: "[bundler] "
24
+ prefix: "[bundler] "
25
+ groups:
26
+ monthly:
27
+ patterns:
28
+ - "*"
29
+ ignore:
30
+ - dependency-name: "activesupport"
31
+ update-types: ["version-update:semver-major"]
32
+ - dependency-name: "activemodel"
33
+ update-types: ["version-update:semver-major"]
34
+ - dependency-name: "activerecord"
35
+ update-types: ["version-update:semver-major"]
@@ -10,7 +10,7 @@ jobs:
10
10
  strategy:
11
11
  fail-fast: false
12
12
  matrix:
13
- ruby-version: [3.2.2]
13
+ ruby-version: [3.2.6]
14
14
  experimental: [false]
15
15
  steps:
16
16
  - uses: actions/checkout@v4
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.2.6
data/Gemfile.lock CHANGED
@@ -1,56 +1,80 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fixtury (1.0.0)
4
+ fixtury (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- activemodel (7.1.3.2)
10
- activesupport (= 7.1.3.2)
11
- activerecord (7.1.3.2)
12
- activemodel (= 7.1.3.2)
13
- activesupport (= 7.1.3.2)
9
+ activemodel (7.2.2.1)
10
+ activesupport (= 7.2.2.1)
11
+ activerecord (7.2.2.1)
12
+ activemodel (= 7.2.2.1)
13
+ activesupport (= 7.2.2.1)
14
14
  timeout (>= 0.4.0)
15
- activesupport (7.1.3.2)
15
+ activesupport (7.2.2.1)
16
16
  base64
17
+ benchmark (>= 0.3)
17
18
  bigdecimal
18
- concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ concurrent-ruby (~> 1.0, >= 1.3.1)
19
20
  connection_pool (>= 2.2.5)
20
21
  drb
21
22
  i18n (>= 1.6, < 2)
23
+ logger (>= 1.4.2)
22
24
  minitest (>= 5.1)
23
- mutex_m
24
- tzinfo (~> 2.0)
25
+ securerandom (>= 0.3)
26
+ tzinfo (~> 2.0, >= 2.0.5)
25
27
  base64 (0.2.0)
26
- bigdecimal (3.1.7)
28
+ benchmark (0.4.0)
29
+ bigdecimal (3.1.9)
27
30
  byebug (11.1.3)
28
- concurrent-ruby (1.2.3)
31
+ concurrent-ruby (1.3.4)
29
32
  connection_pool (2.4.1)
30
33
  drb (2.2.1)
31
34
  globalid (1.2.1)
32
35
  activesupport (>= 6.1)
33
- i18n (1.14.4)
36
+ i18n (1.14.6)
34
37
  concurrent-ruby (~> 1.0)
38
+ logger (1.6.4)
35
39
  m (1.6.2)
36
40
  method_source (>= 0.6.7)
37
41
  rake (>= 0.9.2.2)
38
42
  method_source (1.1.0)
39
- mini_portile2 (2.8.6)
40
- minitest (5.22.3)
41
- mocha (2.2.0)
43
+ mini_portile2 (2.8.8)
44
+ minitest (5.25.4)
45
+ mocha (2.7.1)
42
46
  ruby2_keywords (>= 0.0.5)
43
- mutex_m (0.2.0)
44
47
  rake (13.2.1)
45
48
  ruby2_keywords (0.0.5)
46
- sqlite3 (1.7.2)
49
+ securerandom (0.4.1)
50
+ sqlite3 (2.5.0)
47
51
  mini_portile2 (~> 2.8.0)
48
- timeout (0.4.1)
52
+ sqlite3 (2.5.0-aarch64-linux-gnu)
53
+ sqlite3 (2.5.0-aarch64-linux-musl)
54
+ sqlite3 (2.5.0-arm-linux-gnu)
55
+ sqlite3 (2.5.0-arm-linux-musl)
56
+ sqlite3 (2.5.0-arm64-darwin)
57
+ sqlite3 (2.5.0-x86-linux-gnu)
58
+ sqlite3 (2.5.0-x86-linux-musl)
59
+ sqlite3 (2.5.0-x86_64-darwin)
60
+ sqlite3 (2.5.0-x86_64-linux-gnu)
61
+ sqlite3 (2.5.0-x86_64-linux-musl)
62
+ timeout (0.4.3)
49
63
  tzinfo (2.0.6)
50
64
  concurrent-ruby (~> 1.0)
51
65
 
52
66
  PLATFORMS
67
+ aarch64-linux-gnu
68
+ aarch64-linux-musl
69
+ arm-linux-gnu
70
+ arm-linux-musl
71
+ arm64-darwin
53
72
  ruby
73
+ x86-linux-gnu
74
+ x86-linux-musl
75
+ x86_64-darwin
76
+ x86_64-linux-gnu
77
+ x86_64-linux-musl
54
78
 
55
79
  DEPENDENCIES
56
80
  activerecord
@@ -64,5 +88,42 @@ DEPENDENCIES
64
88
  rake
65
89
  sqlite3
66
90
 
91
+ CHECKSUMS
92
+ activemodel (7.2.2.1) sha256=8398861f9ee2c4671a8357ab39e9b38a045fd656f6685a3dd5890c2419dbfdaf
93
+ activerecord (7.2.2.1) sha256=79a31f71c32d5138717c2104e0ff105f5d82922247c85bdca144f2720e67fab9
94
+ activesupport (7.2.2.1) sha256=842bcbf8a92977f80fb4750661a237cf5dd4fdd442066b3c35e88afb488647f5
95
+ base64 (0.2.0) sha256=0f25e9b21a02a0cc0cea8ef92b2041035d39350946e8789c562b2d1a3da01507
96
+ benchmark (0.4.0) sha256=0f12f8c495545e3710c3e4f0480f63f06b4c842cc94cec7f33a956f5180e874a
97
+ bigdecimal (3.1.9) sha256=2ffc742031521ad69c2dfc815a98e426a230a3d22aeac1995826a75dabfad8cc
98
+ byebug (11.1.3) sha256=2485944d2bb21283c593d562f9ae1019bf80002143cc3a255aaffd4e9cf4a35b
99
+ concurrent-ruby (1.3.4) sha256=d4aa926339b0a86b5b5054a0a8c580163e6f5dcbdfd0f4bb916b1a2570731c32
100
+ connection_pool (2.4.1) sha256=0f40cf997091f1f04ff66da67eabd61a9fe0d4928b9a3645228532512fab62f4
101
+ drb (2.2.1) sha256=e9d472bf785f558b96b25358bae115646da0dbfd45107ad858b0bc0d935cb340
102
+ fixtury (1.0.1)
103
+ globalid (1.2.1) sha256=70bf76711871f843dbba72beb8613229a49429d1866828476f9c9d6ccc327ce9
104
+ i18n (1.14.6) sha256=dc229a74f5d181f09942dd60ab5d6e667f7392c4ee826f35096db36d1fe3614c
105
+ logger (1.6.4) sha256=b627b91c922231050932e7bf8ee886fe54790ba2238a468ead52ba21911f2ee7
106
+ m (1.6.2) sha256=2fb85aff050b6b699e6dbca47b45d426e2136ccdfabb64437e9630230d29108e
107
+ method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
108
+ mini_portile2 (2.8.8) sha256=8e47136cdac04ce81750bb6c09733b37895bf06962554e4b4056d78168d70a75
109
+ minitest (5.25.4) sha256=9cf2cae25ac4dfc90c988ebc3b917f53c054978b673273da1bd20bcb0778f947
110
+ mocha (2.7.1) sha256=8f7d538d5d3ebc75fc788b3d92fbab913a93a78462d2a3ce99d1bdde7af7f851
111
+ rake (13.2.1) sha256=46cb38dae65d7d74b6020a4ac9d48afed8eb8149c040eccf0523bec91907059d
112
+ ruby2_keywords (0.0.5) sha256=ffd13740c573b7301cf7a2e61fc857b2a8e3d3aff32545d6f8300d8bae10e3ef
113
+ securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
114
+ sqlite3 (2.5.0) sha256=87fa0036e6369c3f3cfeca749865c2b2b63649d3b17b223d1939a8eed4841a6b
115
+ sqlite3 (2.5.0-aarch64-linux-gnu) sha256=302085c3b932c027bc8de9f45fb5d0a3dc502357908dcc8f9bc8a92e4e9c7ab1
116
+ sqlite3 (2.5.0-aarch64-linux-musl) sha256=f6c8d25a6c7175bed154da82bc4c1ea3ef48580aeca17400b2e730c026821857
117
+ sqlite3 (2.5.0-arm-linux-gnu) sha256=5f22b4c72c38570593f9fe351751cb269568594525e0e3e0776187a3f1a55f32
118
+ sqlite3 (2.5.0-arm-linux-musl) sha256=b8e672106f341e9e4c85cdbc218710521c92082eec0ba61c180fb27a9c7780c6
119
+ sqlite3 (2.5.0-arm64-darwin) sha256=65370ddbc7bd7e65a03c18f8bf0e9be0f4f3cf50f758f8c1d3181aece5515ecf
120
+ sqlite3 (2.5.0-x86-linux-gnu) sha256=90488e9278ff23b9b22387a01354d5350b94d346fa9ab09256f154d0ca90dec6
121
+ sqlite3 (2.5.0-x86-linux-musl) sha256=09dd65d3752fb9d5cd93df841cbc357d2d117118f96f8b4122cd9cb38e020295
122
+ sqlite3 (2.5.0-x86_64-darwin) sha256=e3c6d2fa04db9d0773455cb6c79835f230c363424b69c34dd718e1aff8609d35
123
+ sqlite3 (2.5.0-x86_64-linux-gnu) sha256=c62c8d625da7e2ce93d694f02cd9c9d537638f56b09f2e8f28bea2d030b3923b
124
+ sqlite3 (2.5.0-x86_64-linux-musl) sha256=09fd262943eeb89465f6633e748b702b046de24cdab14b197302d0f4a0e250cb
125
+ timeout (0.4.3) sha256=9509f079b2b55fe4236d79633bd75e34c1c1e7e3fb4b56cb5fda61f80a0fe30e
126
+ tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b
127
+
67
128
  BUNDLED WITH
68
- 2.5.6
129
+ 2.6.2
@@ -156,6 +156,11 @@ module Fixtury
156
156
 
157
157
  fixtury_database_connections.each do |conn|
158
158
  conn.begin_transaction joinable: false
159
+ if conn.pool.respond_to?(:lock_thread=)
160
+ conn.pool.lock_thread = true
161
+ elsif conn.pool.respond_to?(:pin_connection!)
162
+ conn.pool.pin_connection!(true)
163
+ end
159
164
  end
160
165
  end
161
166
 
@@ -165,6 +170,11 @@ module Fixtury
165
170
 
166
171
  fixtury_database_connections.each do |conn|
167
172
  conn.rollback_transaction if conn.open_transactions.positive?
173
+ if conn.pool.respond_to?(:lock_thread=)
174
+ conn.pool.lock_thread = false
175
+ elsif conn.pool.respond_to?(:unpin_connection!)
176
+ conn.pool.unpin_connection!
177
+ end
168
178
  end
169
179
  end
170
180
 
@@ -21,7 +21,7 @@ module Fixtury
21
21
  def initialize(name, locator_key, **metadata)
22
22
  @name = name
23
23
  @locator_key = locator_key
24
- @created_at = Time.now.to_i
24
+ @created_at = Fixtury.now.to_i
25
25
  @metadata = metadata
26
26
  end
27
27
 
data/lib/fixtury/store.rb CHANGED
@@ -236,7 +236,7 @@ module Fixtury
236
236
  # @param ref [Fixtury::Reference] The reference to check.
237
237
  # @return [TrueClass, FalseClass] `true` if the reference is stale, `false` otherwise.
238
238
  def reference_stale?(ref)
239
- return true if ttl && ref.created_at < (Time.now.to_i - ttl)
239
+ return true if ttl && ref.created_at < (Fixtury.now.to_i - ttl)
240
240
 
241
241
  !locator.recognizable_key?(ref.locator_key)
242
242
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Fixtury
4
4
 
5
- VERSION = "1.0.0"
5
+ VERSION = "1.0.1"
6
6
 
7
7
  end
data/lib/fixtury.rb CHANGED
@@ -61,6 +61,12 @@ module Fixtury
61
61
  @hooks ||= ::Fixtury::Hooks.new
62
62
  end
63
63
 
64
+ def self.now
65
+ hooks.call(:time_access) do
66
+ ::Time.now
67
+ end
68
+ end
69
+
64
70
  # The default top level schema. Fixtury::Schema instances can be completely self-contained but most
65
71
  # usage would be through this shared definition.
66
72
  def self.schema
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixtury
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Nelson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-13 00:00:00.000000000 Z
11
+ date: 2025-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  - !ruby/object:Gem::Version
199
199
  version: '0'
200
200
  requirements: []
201
- rubygems_version: 3.5.15
201
+ rubygems_version: 3.5.23
202
202
  signing_key:
203
203
  specification_version: 4
204
204
  summary: Treat fixtures like factories and factories like fixtures