fixtury 1.0.0.beta7 → 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 +4 -4
- data/.github/dependabot.yml +35 -0
- data/.github/workflows/build.yml +23 -0
- data/.ruby-version +1 -1
- data/Gemfile.lock +83 -22
- data/lib/fixtury/minitest_hooks.rb +12 -1
- data/lib/fixtury/reference.rb +1 -1
- data/lib/fixtury/store.rb +1 -1
- data/lib/fixtury/version.rb +1 -1
- data/lib/fixtury.rb +6 -0
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 514698ec587a7323fdc0cb3c81c93dd9666e16c87d7f5f2aa867d1cd6ac95ee3
|
|
4
|
+
data.tar.gz: dd34ff54006e203bef96d6fce2c4c1dd2c97f9143d2d29d5e022c496600e0aff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d1b1f1222fb51994a2ce522fcdec21b8b7bb3198eaecac72d7924d59996e5f0200c00a90dca5dbc75efded7292f26593bff266844bfb41ffd8214d9f25ae469
|
|
7
|
+
data.tar.gz: e3bc71e4a40c3a40f12e23895e55cee83fa34b93d5db13e486c62a2e004671e64f775712dd71ba68ed4441de622ce667d2a43529ea2dacb47dafcfd3b1fb0119
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "github-actions"
|
|
4
|
+
directory: "/"
|
|
5
|
+
open-pull-requests-limit: 20
|
|
6
|
+
schedule:
|
|
7
|
+
interval: "daily"
|
|
8
|
+
time: "09:00"
|
|
9
|
+
timezone: "America/New_York"
|
|
10
|
+
commit-message:
|
|
11
|
+
prefix: "[github-actions] "
|
|
12
|
+
- package-ecosystem: "bundler"
|
|
13
|
+
directory: "/"
|
|
14
|
+
schedule:
|
|
15
|
+
interval: "daily"
|
|
16
|
+
time: "08:30"
|
|
17
|
+
timezone: "America/New_York"
|
|
18
|
+
allow:
|
|
19
|
+
- dependency-type: "all"
|
|
20
|
+
versioning-strategy: increase
|
|
21
|
+
open-pull-requests-limit: 20
|
|
22
|
+
insecure-external-code-execution: deny
|
|
23
|
+
commit-message:
|
|
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"]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: build
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
strategy:
|
|
11
|
+
fail-fast: false
|
|
12
|
+
matrix:
|
|
13
|
+
ruby-version: [3.2.6]
|
|
14
|
+
experimental: [false]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
show-progress: 'false'
|
|
19
|
+
- uses: ruby/setup-ruby@v1
|
|
20
|
+
with:
|
|
21
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
22
|
+
bundler-cache: true # runs `bundle install` and caches installed gems automatically
|
|
23
|
+
- run: bundle exec rake
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.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.
|
|
4
|
+
fixtury (1.0.1)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
activemodel (7.
|
|
10
|
-
activesupport (= 7.
|
|
11
|
-
activerecord (7.
|
|
12
|
-
activemodel (= 7.
|
|
13
|
-
activesupport (= 7.
|
|
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.
|
|
15
|
+
activesupport (7.2.2.1)
|
|
16
16
|
base64
|
|
17
|
+
benchmark (>= 0.3)
|
|
17
18
|
bigdecimal
|
|
18
|
-
concurrent-ruby (~> 1.0, >= 1.
|
|
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
|
-
|
|
24
|
-
tzinfo (~> 2.0)
|
|
25
|
+
securerandom (>= 0.3)
|
|
26
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
25
27
|
base64 (0.2.0)
|
|
26
|
-
|
|
28
|
+
benchmark (0.4.0)
|
|
29
|
+
bigdecimal (3.1.9)
|
|
27
30
|
byebug (11.1.3)
|
|
28
|
-
concurrent-ruby (1.
|
|
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.
|
|
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
|
-
method_source (1.
|
|
39
|
-
mini_portile2 (2.8.
|
|
40
|
-
minitest (5.
|
|
41
|
-
mocha (2.1
|
|
42
|
+
method_source (1.1.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
|
-
|
|
44
|
-
rake (13.1.0)
|
|
47
|
+
rake (13.2.1)
|
|
45
48
|
ruby2_keywords (0.0.5)
|
|
46
|
-
|
|
49
|
+
securerandom (0.4.1)
|
|
50
|
+
sqlite3 (2.5.0)
|
|
47
51
|
mini_portile2 (~> 2.8.0)
|
|
48
|
-
|
|
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.
|
|
129
|
+
2.6.2
|
|
@@ -144,7 +144,8 @@ module Fixtury
|
|
|
144
144
|
def fixtury_database_connections
|
|
145
145
|
return [] unless defined?(ActiveRecord::Base)
|
|
146
146
|
|
|
147
|
-
ActiveRecord::Base.connection_handler.connection_pool_list(:writing)
|
|
147
|
+
pools = ActiveRecord::Base.connection_handler.connection_pool_list(:writing)
|
|
148
|
+
pools.map { |pool| pool.respond_to?(:lease_connection) ? pool.lease_connection : pool.connection }
|
|
148
149
|
end
|
|
149
150
|
|
|
150
151
|
# Load all dependenct fixtures and begin a transaction for each database connection.
|
|
@@ -155,6 +156,11 @@ module Fixtury
|
|
|
155
156
|
|
|
156
157
|
fixtury_database_connections.each do |conn|
|
|
157
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
|
|
158
164
|
end
|
|
159
165
|
end
|
|
160
166
|
|
|
@@ -164,6 +170,11 @@ module Fixtury
|
|
|
164
170
|
|
|
165
171
|
fixtury_database_connections.each do |conn|
|
|
166
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
|
|
167
178
|
end
|
|
168
179
|
end
|
|
169
180
|
|
data/lib/fixtury/reference.rb
CHANGED
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 < (
|
|
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
|
data/lib/fixtury/version.rb
CHANGED
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.
|
|
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:
|
|
11
|
+
date: 2025-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -143,6 +143,8 @@ executables: []
|
|
|
143
143
|
extensions: []
|
|
144
144
|
extra_rdoc_files: []
|
|
145
145
|
files:
|
|
146
|
+
- ".github/dependabot.yml"
|
|
147
|
+
- ".github/workflows/build.yml"
|
|
146
148
|
- ".gitignore"
|
|
147
149
|
- ".ruby-version"
|
|
148
150
|
- ".travis.yml"
|
|
@@ -196,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
196
198
|
- !ruby/object:Gem::Version
|
|
197
199
|
version: '0'
|
|
198
200
|
requirements: []
|
|
199
|
-
rubygems_version: 3.5.
|
|
201
|
+
rubygems_version: 3.5.23
|
|
200
202
|
signing_key:
|
|
201
203
|
specification_version: 4
|
|
202
204
|
summary: Treat fixtures like factories and factories like fixtures
|