fixturex 0.1.2 → 0.1.4

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: 969e8e5573328295b3bd63b0ec6ec2bef3f3462a613009f44ac5f8dfc9ba5c7d
4
- data.tar.gz: 02c925a94649f82fb08c7d5c1b555b10a95546054db19a864216717239da213d
3
+ metadata.gz: 7ffed47838ffeca2b48f07aedb9b3fde97e511d815cb26c43777d5da4b7a243f
4
+ data.tar.gz: 4b80bdaa446e189d01c18f2b1822c5ce4d0363b009488acd0f2ea41ce27e0baa
5
5
  SHA512:
6
- metadata.gz: 6477664978fff4a5ee9ceee56decf5c96ceadacba17f02c81f15adde91e1678b72b4bf183b64ddfd3333396cf5a3691c1015f0095c9e93f69e9bc29fe051f53f
7
- data.tar.gz: d7f085be682df75a9dd849c7dd1473d97d56bea48090738def17095ec11f409fb23c43e32e33516f6c4158e546130de460ee3b332ebd83ee4db67045d8da9e71
6
+ metadata.gz: 620e13262446d7e3aa345dace7da41bd3ba5f84f9adb1e8449990225a269601744228ff7bc69ece0e0c1102931cd3899e1b27e5b05e6a232a8ba106edee80ee2
7
+ data.tar.gz: b7ceb8bebd224a3e9479ed96d09e17d338d5e015cbf15f253b4731398e147c63d7b802ddf075f1b8e266d5c9bcfe6d017c82446b5f9dcba86ea98a6f9a8bdabd
data/Gemfile.lock CHANGED
@@ -1,190 +1,250 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fixturex (0.1.2)
4
+ fixturex (0.1.3)
5
5
  rails (>= 6.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (6.1.4.1)
11
- actionpack (= 6.1.4.1)
12
- activesupport (= 6.1.4.1)
10
+ actioncable (8.0.2)
11
+ actionpack (= 8.0.2)
12
+ activesupport (= 8.0.2)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
- actionmailbox (6.1.4.1)
16
- actionpack (= 6.1.4.1)
17
- activejob (= 6.1.4.1)
18
- activerecord (= 6.1.4.1)
19
- activestorage (= 6.1.4.1)
20
- activesupport (= 6.1.4.1)
21
- mail (>= 2.7.1)
22
- actionmailer (6.1.4.1)
23
- actionpack (= 6.1.4.1)
24
- actionview (= 6.1.4.1)
25
- activejob (= 6.1.4.1)
26
- activesupport (= 6.1.4.1)
27
- mail (~> 2.5, >= 2.5.4)
28
- rails-dom-testing (~> 2.0)
29
- actionpack (6.1.4.1)
30
- actionview (= 6.1.4.1)
31
- activesupport (= 6.1.4.1)
32
- rack (~> 2.0, >= 2.0.9)
15
+ zeitwerk (~> 2.6)
16
+ actionmailbox (8.0.2)
17
+ actionpack (= 8.0.2)
18
+ activejob (= 8.0.2)
19
+ activerecord (= 8.0.2)
20
+ activestorage (= 8.0.2)
21
+ activesupport (= 8.0.2)
22
+ mail (>= 2.8.0)
23
+ actionmailer (8.0.2)
24
+ actionpack (= 8.0.2)
25
+ actionview (= 8.0.2)
26
+ activejob (= 8.0.2)
27
+ activesupport (= 8.0.2)
28
+ mail (>= 2.8.0)
29
+ rails-dom-testing (~> 2.2)
30
+ actionpack (8.0.2)
31
+ actionview (= 8.0.2)
32
+ activesupport (= 8.0.2)
33
+ nokogiri (>= 1.8.5)
34
+ rack (>= 2.2.4)
35
+ rack-session (>= 1.0.1)
33
36
  rack-test (>= 0.6.3)
34
- rails-dom-testing (~> 2.0)
35
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
- actiontext (6.1.4.1)
37
- actionpack (= 6.1.4.1)
38
- activerecord (= 6.1.4.1)
39
- activestorage (= 6.1.4.1)
40
- activesupport (= 6.1.4.1)
37
+ rails-dom-testing (~> 2.2)
38
+ rails-html-sanitizer (~> 1.6)
39
+ useragent (~> 0.16)
40
+ actiontext (8.0.2)
41
+ actionpack (= 8.0.2)
42
+ activerecord (= 8.0.2)
43
+ activestorage (= 8.0.2)
44
+ activesupport (= 8.0.2)
45
+ globalid (>= 0.6.0)
41
46
  nokogiri (>= 1.8.5)
42
- actionview (6.1.4.1)
43
- activesupport (= 6.1.4.1)
47
+ actionview (8.0.2)
48
+ activesupport (= 8.0.2)
44
49
  builder (~> 3.1)
45
- erubi (~> 1.4)
46
- rails-dom-testing (~> 2.0)
47
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
- activejob (6.1.4.1)
49
- activesupport (= 6.1.4.1)
50
+ erubi (~> 1.11)
51
+ rails-dom-testing (~> 2.2)
52
+ rails-html-sanitizer (~> 1.6)
53
+ activejob (8.0.2)
54
+ activesupport (= 8.0.2)
50
55
  globalid (>= 0.3.6)
51
- activemodel (6.1.4.1)
52
- activesupport (= 6.1.4.1)
53
- activerecord (6.1.4.1)
54
- activemodel (= 6.1.4.1)
55
- activesupport (= 6.1.4.1)
56
- activestorage (6.1.4.1)
57
- actionpack (= 6.1.4.1)
58
- activejob (= 6.1.4.1)
59
- activerecord (= 6.1.4.1)
60
- activesupport (= 6.1.4.1)
61
- marcel (~> 1.0.0)
62
- mini_mime (>= 1.1.0)
63
- activesupport (6.1.4.1)
64
- concurrent-ruby (~> 1.0, >= 1.0.2)
56
+ activemodel (8.0.2)
57
+ activesupport (= 8.0.2)
58
+ activerecord (8.0.2)
59
+ activemodel (= 8.0.2)
60
+ activesupport (= 8.0.2)
61
+ timeout (>= 0.4.0)
62
+ activestorage (8.0.2)
63
+ actionpack (= 8.0.2)
64
+ activejob (= 8.0.2)
65
+ activerecord (= 8.0.2)
66
+ activesupport (= 8.0.2)
67
+ marcel (~> 1.0)
68
+ activesupport (8.0.2)
69
+ base64
70
+ benchmark (>= 0.3)
71
+ bigdecimal
72
+ concurrent-ruby (~> 1.0, >= 1.3.1)
73
+ connection_pool (>= 2.2.5)
74
+ drb
65
75
  i18n (>= 1.6, < 2)
76
+ logger (>= 1.4.2)
66
77
  minitest (>= 5.1)
67
- tzinfo (~> 2.0)
68
- zeitwerk (~> 2.3)
69
- ast (2.4.2)
78
+ securerandom (>= 0.3)
79
+ tzinfo (~> 2.0, >= 2.0.5)
80
+ uri (>= 0.13.1)
81
+ ast (2.4.3)
70
82
  awesome_print (1.9.2)
71
- builder (3.2.4)
83
+ base64 (0.2.0)
84
+ benchmark (0.4.0)
85
+ bigdecimal (3.1.9)
86
+ builder (3.3.0)
72
87
  byebug (11.1.3)
73
- concurrent-ruby (1.1.9)
88
+ concurrent-ruby (1.3.5)
89
+ connection_pool (2.5.0)
74
90
  crass (1.0.6)
75
- diff-lcs (1.4.4)
76
- docile (1.4.0)
77
- erubi (1.10.0)
78
- globalid (1.0.0)
79
- activesupport (>= 5.0)
80
- i18n (1.8.10)
91
+ date (3.4.1)
92
+ diff-lcs (1.6.0)
93
+ docile (1.4.1)
94
+ drb (2.2.1)
95
+ erubi (1.13.1)
96
+ globalid (1.2.1)
97
+ activesupport (>= 6.1)
98
+ i18n (1.14.7)
81
99
  concurrent-ruby (~> 1.0)
82
- loofah (2.12.0)
100
+ io-console (0.8.0)
101
+ irb (1.15.1)
102
+ pp (>= 0.6.0)
103
+ rdoc (>= 4.0.0)
104
+ reline (>= 0.4.2)
105
+ json (2.10.2)
106
+ language_server-protocol (3.17.0.4)
107
+ lint_roller (1.1.0)
108
+ logger (1.6.6)
109
+ loofah (2.24.0)
83
110
  crass (~> 1.0.2)
84
- nokogiri (>= 1.5.9)
85
- mail (2.7.1)
111
+ nokogiri (>= 1.12.0)
112
+ mail (2.8.1)
86
113
  mini_mime (>= 0.1.1)
87
- marcel (1.0.2)
88
- method_source (1.0.0)
89
- mini_mime (1.1.2)
90
- mini_portile2 (2.6.1)
91
- minitest (5.14.4)
92
- nio4r (2.5.8)
93
- nokogiri (1.12.4)
94
- mini_portile2 (~> 2.6.1)
114
+ net-imap
115
+ net-pop
116
+ net-smtp
117
+ marcel (1.0.4)
118
+ mini_mime (1.1.5)
119
+ mini_portile2 (2.8.8)
120
+ minitest (5.25.5)
121
+ net-imap (0.5.6)
122
+ date
123
+ net-protocol
124
+ net-pop (0.1.2)
125
+ net-protocol
126
+ net-protocol (0.2.2)
127
+ timeout
128
+ net-smtp (0.5.1)
129
+ net-protocol
130
+ nio4r (2.7.4)
131
+ nokogiri (1.18.5)
132
+ mini_portile2 (~> 2.8.2)
95
133
  racc (~> 1.4)
96
- parallel (1.20.1)
97
- parser (3.0.2.0)
134
+ parallel (1.26.3)
135
+ parser (3.3.7.2)
98
136
  ast (~> 2.4.1)
99
- racc (1.5.2)
100
- rack (2.2.3)
101
- rack-test (1.1.0)
102
- rack (>= 1.0, < 3)
103
- rails (6.1.4.1)
104
- actioncable (= 6.1.4.1)
105
- actionmailbox (= 6.1.4.1)
106
- actionmailer (= 6.1.4.1)
107
- actionpack (= 6.1.4.1)
108
- actiontext (= 6.1.4.1)
109
- actionview (= 6.1.4.1)
110
- activejob (= 6.1.4.1)
111
- activemodel (= 6.1.4.1)
112
- activerecord (= 6.1.4.1)
113
- activestorage (= 6.1.4.1)
114
- activesupport (= 6.1.4.1)
137
+ racc
138
+ pp (0.6.2)
139
+ prettyprint
140
+ prettyprint (0.2.0)
141
+ psych (5.2.3)
142
+ date
143
+ stringio
144
+ racc (1.8.1)
145
+ rack (3.1.12)
146
+ rack-session (2.1.0)
147
+ base64 (>= 0.1.0)
148
+ rack (>= 3.0.0)
149
+ rack-test (2.2.0)
150
+ rack (>= 1.3)
151
+ rackup (2.2.1)
152
+ rack (>= 3)
153
+ rails (8.0.2)
154
+ actioncable (= 8.0.2)
155
+ actionmailbox (= 8.0.2)
156
+ actionmailer (= 8.0.2)
157
+ actionpack (= 8.0.2)
158
+ actiontext (= 8.0.2)
159
+ actionview (= 8.0.2)
160
+ activejob (= 8.0.2)
161
+ activemodel (= 8.0.2)
162
+ activerecord (= 8.0.2)
163
+ activestorage (= 8.0.2)
164
+ activesupport (= 8.0.2)
115
165
  bundler (>= 1.15.0)
116
- railties (= 6.1.4.1)
117
- sprockets-rails (>= 2.0.0)
118
- rails-dom-testing (2.0.3)
119
- activesupport (>= 4.2.0)
166
+ railties (= 8.0.2)
167
+ rails-dom-testing (2.2.0)
168
+ activesupport (>= 5.0.0)
169
+ minitest
120
170
  nokogiri (>= 1.6)
121
- rails-html-sanitizer (1.4.2)
122
- loofah (~> 2.3)
123
- railties (6.1.4.1)
124
- actionpack (= 6.1.4.1)
125
- activesupport (= 6.1.4.1)
126
- method_source
127
- rake (>= 0.13)
128
- thor (~> 1.0)
129
- rainbow (3.0.0)
130
- rake (13.0.6)
131
- regexp_parser (2.1.1)
132
- rexml (3.2.5)
133
- rspec (3.10.0)
134
- rspec-core (~> 3.10.0)
135
- rspec-expectations (~> 3.10.0)
136
- rspec-mocks (~> 3.10.0)
137
- rspec-core (3.10.1)
138
- rspec-support (~> 3.10.0)
139
- rspec-expectations (3.10.1)
171
+ rails-html-sanitizer (1.6.2)
172
+ loofah (~> 2.21)
173
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
174
+ railties (8.0.2)
175
+ actionpack (= 8.0.2)
176
+ activesupport (= 8.0.2)
177
+ irb (~> 1.13)
178
+ rackup (>= 1.0.0)
179
+ rake (>= 12.2)
180
+ thor (~> 1.0, >= 1.2.2)
181
+ zeitwerk (~> 2.6)
182
+ rainbow (3.1.1)
183
+ rake (13.2.1)
184
+ rdoc (6.12.0)
185
+ psych (>= 4.0.0)
186
+ regexp_parser (2.10.0)
187
+ reline (0.6.0)
188
+ io-console (~> 0.5)
189
+ rspec (3.13.0)
190
+ rspec-core (~> 3.13.0)
191
+ rspec-expectations (~> 3.13.0)
192
+ rspec-mocks (~> 3.13.0)
193
+ rspec-core (3.13.3)
194
+ rspec-support (~> 3.13.0)
195
+ rspec-expectations (3.13.3)
140
196
  diff-lcs (>= 1.2.0, < 2.0)
141
- rspec-support (~> 3.10.0)
142
- rspec-mocks (3.10.2)
197
+ rspec-support (~> 3.13.0)
198
+ rspec-mocks (3.13.2)
143
199
  diff-lcs (>= 1.2.0, < 2.0)
144
- rspec-support (~> 3.10.0)
145
- rspec-rails (5.0.2)
146
- actionpack (>= 5.2)
147
- activesupport (>= 5.2)
148
- railties (>= 5.2)
149
- rspec-core (~> 3.10)
150
- rspec-expectations (~> 3.10)
151
- rspec-mocks (~> 3.10)
152
- rspec-support (~> 3.10)
153
- rspec-support (3.10.2)
154
- rubocop (1.20.0)
200
+ rspec-support (~> 3.13.0)
201
+ rspec-rails (7.1.1)
202
+ actionpack (>= 7.0)
203
+ activesupport (>= 7.0)
204
+ railties (>= 7.0)
205
+ rspec-core (~> 3.13)
206
+ rspec-expectations (~> 3.13)
207
+ rspec-mocks (~> 3.13)
208
+ rspec-support (~> 3.13)
209
+ rspec-support (3.13.2)
210
+ rubocop (1.74.0)
211
+ json (~> 2.3)
212
+ language_server-protocol (~> 3.17.0.2)
213
+ lint_roller (~> 1.1.0)
155
214
  parallel (~> 1.10)
156
- parser (>= 3.0.0.0)
215
+ parser (>= 3.3.0.2)
157
216
  rainbow (>= 2.2.2, < 4.0)
158
- regexp_parser (>= 1.8, < 3.0)
159
- rexml
160
- rubocop-ast (>= 1.9.1, < 2.0)
217
+ regexp_parser (>= 2.9.3, < 3.0)
218
+ rubocop-ast (>= 1.38.0, < 2.0)
161
219
  ruby-progressbar (~> 1.7)
162
- unicode-display_width (>= 1.4.0, < 3.0)
163
- rubocop-ast (1.11.0)
164
- parser (>= 3.0.1.1)
165
- ruby-progressbar (1.11.0)
166
- simplecov (0.21.2)
220
+ unicode-display_width (>= 2.4.0, < 4.0)
221
+ rubocop-ast (1.40.0)
222
+ parser (>= 3.3.1.0)
223
+ ruby-progressbar (1.13.0)
224
+ securerandom (0.4.1)
225
+ simplecov (0.22.0)
167
226
  docile (~> 1.1)
168
227
  simplecov-html (~> 0.11)
169
228
  simplecov_json_formatter (~> 0.1)
170
- simplecov-html (0.12.3)
171
- simplecov_json_formatter (0.1.3)
172
- sprockets (4.1.1)
173
- concurrent-ruby (~> 1.0)
174
- rack (> 1, < 3)
175
- sprockets-rails (3.4.2)
176
- actionpack (>= 5.2)
177
- activesupport (>= 5.2)
178
- sprockets (>= 3.0.0)
179
- sqlite3 (1.4.2)
180
- thor (1.1.0)
181
- tzinfo (2.0.4)
229
+ simplecov-html (0.13.1)
230
+ simplecov_json_formatter (0.1.4)
231
+ sqlite3 (2.6.0)
232
+ mini_portile2 (~> 2.8.0)
233
+ stringio (3.1.5)
234
+ thor (1.3.2)
235
+ timeout (0.4.3)
236
+ tzinfo (2.0.6)
182
237
  concurrent-ruby (~> 1.0)
183
- unicode-display_width (2.0.0)
184
- websocket-driver (0.7.5)
238
+ unicode-display_width (3.1.4)
239
+ unicode-emoji (~> 4.0, >= 4.0.4)
240
+ unicode-emoji (4.0.4)
241
+ uri (1.0.3)
242
+ useragent (0.16.11)
243
+ websocket-driver (0.7.7)
244
+ base64
185
245
  websocket-extensions (>= 0.1.0)
186
246
  websocket-extensions (0.1.5)
187
- zeitwerk (2.4.2)
247
+ zeitwerk (2.7.2)
188
248
 
189
249
  PLATFORMS
190
250
  ruby
@@ -54,8 +54,9 @@ module Fixturex
54
54
  end
55
55
 
56
56
  class TreeBuilder
57
- def self.cache
58
- @cache ||= {}
57
+ def initialize
58
+ @circut_breaker = Set.new
59
+ @cache = {}
59
60
  end
60
61
 
61
62
  def build_dependency_tree(fixture_path, fixture_name)
@@ -67,23 +68,27 @@ module Fixturex
67
68
 
68
69
  private
69
70
 
70
- # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
71
+ # rubocop:disable Metrics/AbcSize
71
72
  def nested_fixtures_locations(parent_fixture_model_class, parent_fixture_name)
72
73
  associations_for_nested_models(parent_fixture_model_class).each_with_object([]) do |association, acc|
73
- belongs_to_attribute = belongs_to_attribute_for_association(association)
74
+ next unless (belongs_to_attribute = belongs_to_attribute_for_association(association))
75
+
74
76
  child_model_class = association_model_class(association)
75
- model_fixtures = self.class.cache[association.class_name] ||= ModelFixtures.load(child_model_class)
77
+ model_fixtures = @cache[association.class_name] ||= ModelFixtures.load(child_model_class)
76
78
 
77
79
  model_fixtures.each do |fixture|
78
80
  next if fixture.attributes.fetch(belongs_to_attribute, '').to_s.sub(/ .*/, '') != parent_fixture_name
79
81
 
80
82
  next if fixture_already_collected(acc, fixture)
81
83
 
84
+ next if @circut_breaker.include?([fixture.path, fixture.name])
85
+
86
+ @circut_breaker.add([fixture.path, fixture.name])
82
87
  acc << build_dependency_tree(fixture.path, fixture.name)
83
88
  end
84
89
  end
85
90
  end
86
- # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
91
+ # rubocop:enable Metrics/AbcSize
87
92
 
88
93
  def association_model_class(association)
89
94
  class_name = association.class_name
@@ -103,8 +108,12 @@ module Fixturex
103
108
  end
104
109
 
105
110
  def associations_for_nested_models(model_class)
106
- model_class.reflect_on_all_associations(:has_many) +
111
+ (
112
+ model_class.reflect_on_all_associations(:has_many) +
107
113
  model_class.reflect_on_all_associations(:has_one)
114
+ ).reject do |association|
115
+ association.is_a?(ActiveRecord::Reflection::ThroughReflection)
116
+ end
108
117
  end
109
118
 
110
119
  def belongs_to_attribute_for_association(association)
@@ -114,7 +123,7 @@ module Fixturex
114
123
  child_model_class = association_model_class(association)
115
124
  child_model_class.reflect_on_all_associations(:belongs_to).find do |belongs_to_association|
116
125
  belongs_to_association.class_name == association.active_record.name
117
- end.name.to_s
126
+ end&.name&.to_s
118
127
  end
119
128
  end
120
129
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fixturex
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixturex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - artemave
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-03 00:00:00.000000000 Z
11
+ date: 2025-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -56,7 +56,7 @@ homepage: https://github.com/featurist/fixturex
56
56
  licenses:
57
57
  - MIT
58
58
  metadata: {}
59
- post_install_message:
59
+ post_install_message:
60
60
  rdoc_options: []
61
61
  require_paths:
62
62
  - lib
@@ -71,8 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  - !ruby/object:Gem::Version
72
72
  version: '0'
73
73
  requirements: []
74
- rubygems_version: 3.1.6
75
- signing_key:
74
+ rubygems_version: 3.5.22
75
+ signing_key:
76
76
  specification_version: 4
77
77
  summary: Rails fixtures explorer
78
78
  test_files: []