amoeba 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/jruby.yml +27 -0
- data/.github/workflows/ruby_25.yml +30 -0
- data/.github/workflows/ruby_26.yml +30 -0
- data/.github/workflows/ruby_27.yml +30 -0
- data/.github/workflows/ruby_30.yml +34 -0
- data/.github/workflows/ruby_31.yml +34 -0
- data/.github/workflows/ruby_32.yml +34 -0
- data/.github/workflows/ruby_head.yml +34 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +11 -7
- data/.rubocop_todo.yml +120 -0
- data/Appraisals +21 -38
- data/CHANGELOG.md +14 -0
- data/Gemfile +5 -2
- data/LICENSE.md +11 -0
- data/README.md +2 -16
- data/Rakefile +2 -0
- data/amoeba.gemspec +15 -12
- data/gemfiles/activerecord_5.2.gemfile +9 -8
- data/gemfiles/activerecord_6.0.gemfile +9 -8
- data/gemfiles/activerecord_6.1.gemfile +9 -8
- data/gemfiles/activerecord_7.0.gemfile +19 -0
- data/gemfiles/activerecord_head.gemfile +10 -13
- data/gemfiles/jruby_activerecord_7.0.gemfile +20 -0
- data/gemfiles/jruby_activerecord_head.gemfile +13 -15
- data/lib/amoeba/class_methods.rb +2 -0
- data/lib/amoeba/cloner.rb +11 -4
- data/lib/amoeba/config.rb +23 -51
- data/lib/amoeba/instance_methods.rb +3 -0
- data/lib/amoeba/macros/base.rb +4 -1
- data/lib/amoeba/macros/has_and_belongs_to_many.rb +2 -0
- data/lib/amoeba/macros/has_many.rb +2 -0
- data/lib/amoeba/macros/has_one.rb +4 -0
- data/lib/amoeba/macros.rb +2 -0
- data/lib/amoeba/version.rb +3 -1
- data/lib/amoeba.rb +6 -2
- data/spec/lib/amoeba_spec.rb +45 -31
- data/spec/spec_helper.rb +13 -5
- data/spec/support/data.rb +22 -15
- data/spec/support/models.rb +39 -38
- metadata +60 -29
- data/.travis.yml +0 -110
- data/gemfiles/activerecord_4.2.gemfile +0 -18
- data/gemfiles/activerecord_5.0.gemfile +0 -18
- data/gemfiles/activerecord_5.1.gemfile +0 -18
- data/gemfiles/jruby_activerecord_6.1.gemfile +0 -19
data/spec/lib/amoeba_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'amoeba' do
|
4
4
|
context 'dup' do
|
5
|
-
before
|
5
|
+
before do
|
6
6
|
require ::File.dirname(__FILE__) + '/../support/data.rb'
|
7
7
|
end
|
8
8
|
|
@@ -73,12 +73,17 @@ describe 'amoeba' do
|
|
73
73
|
expect(new_post.supercats.map(&:ramblings)).to include('Copy of zomg')
|
74
74
|
expect(new_post.supercats.map(&:other_ramblings).uniq.length).to eq(1)
|
75
75
|
expect(new_post.supercats.map(&:other_ramblings).uniq).to include('La la la')
|
76
|
-
expect(new_post.contents).to eq("Here's a copy: #{old_post.contents.gsub(/dog/,
|
76
|
+
expect(new_post.contents).to eq("Here's a copy: #{old_post.contents.gsub(/dog/,
|
77
|
+
'cat')} (copied version)")
|
77
78
|
expect(new_post.comments.length).to eq(5)
|
78
|
-
expect(new_post.comments.select
|
79
|
+
expect(new_post.comments.select do |c|
|
80
|
+
c.nerf == 'ratatat' && c.contents.nil?
|
81
|
+
end.length).to eq(1)
|
79
82
|
expect(new_post.comments.select { |c| c.nerf == 'ratatat' }.length).to eq(2)
|
80
83
|
expect(new_post.comments.select { |c| c.nerf == 'bonk' }.length).to eq(1)
|
81
|
-
expect(new_post.comments.select
|
84
|
+
expect(new_post.comments.select do |c|
|
85
|
+
c.nerf == 'bonkers' && c.contents.nil?
|
86
|
+
end.length).to eq(1)
|
82
87
|
|
83
88
|
new_post.widgets.map(&:id).each do |id|
|
84
89
|
expect(old_post.widgets.map(&:id)).not_to include(id)
|
@@ -96,7 +101,9 @@ describe 'amoeba' do
|
|
96
101
|
expect(new_author.errors.messages).to be_empty
|
97
102
|
expect(new_author.posts.first.custom_things.length).to eq(3)
|
98
103
|
expect(new_author.posts.first.custom_things.select { |ct| ct.value == [] }.length).to eq(1)
|
99
|
-
expect(new_author.posts.first.custom_things.select
|
104
|
+
expect(new_author.posts.first.custom_things.select do |ct|
|
105
|
+
ct.value == [1, 2]
|
106
|
+
end.length).to eq(1)
|
100
107
|
expect(new_author.posts.first.custom_things.select { |ct| ct.value == [78] }.length).to eq(1)
|
101
108
|
# }}}
|
102
109
|
# Products {{{
|
@@ -177,87 +184,89 @@ describe 'amoeba' do
|
|
177
184
|
end
|
178
185
|
|
179
186
|
context 'Using a if condition' do
|
187
|
+
subject { post.amoeba_dup.save! }
|
188
|
+
|
180
189
|
before(:all) do
|
181
190
|
require ::File.dirname(__FILE__) + '/../support/data.rb'
|
182
191
|
end
|
192
|
+
|
183
193
|
before { ::Post.fresh_amoeba }
|
184
194
|
|
185
|
-
subject { post.amoeba_dup.save! }
|
186
195
|
let(:post) { Post.first }
|
187
196
|
|
188
197
|
it 'includes an association with truthy condition' do
|
189
198
|
::Post.amoeba do
|
190
199
|
include_association :comments, if: :truthy?
|
191
200
|
end
|
192
|
-
expect { subject }.to change
|
201
|
+
expect { subject }.to change(Comment, :count).by(3)
|
193
202
|
end
|
194
203
|
|
195
204
|
it 'does not include an association with a falsey condition' do
|
196
205
|
::Post.amoeba do
|
197
206
|
include_association :comments, if: :falsey?
|
198
207
|
end
|
199
|
-
expect { subject }.not_to change
|
208
|
+
expect { subject }.not_to change(Comment, :count)
|
200
209
|
end
|
201
210
|
|
202
211
|
it 'excludes an association with a truthy condition' do
|
203
212
|
::Post.amoeba do
|
204
213
|
exclude_association :comments, if: :truthy?
|
205
214
|
end
|
206
|
-
expect { subject }.not_to change
|
215
|
+
expect { subject }.not_to change(Comment, :count)
|
207
216
|
end
|
208
217
|
|
209
218
|
it 'does not exclude an association with a falsey condition' do
|
210
219
|
::Post.amoeba do
|
211
220
|
exclude_association :comments, if: :falsey?
|
212
221
|
end
|
213
|
-
expect { subject }.to change
|
222
|
+
expect { subject }.to change(Comment, :count).by(3)
|
214
223
|
end
|
215
224
|
|
216
225
|
it 'includes associations from a given array with a truthy condition' do
|
217
226
|
::Post.amoeba do
|
218
227
|
include_association [:comments], if: :truthy?
|
219
228
|
end
|
220
|
-
expect { subject }.to change
|
229
|
+
expect { subject }.to change(Comment, :count).by(3)
|
221
230
|
end
|
222
231
|
|
223
232
|
it 'does not include associations from a given array with a falsey condition' do
|
224
233
|
::Post.amoeba do
|
225
234
|
include_association [:comments], if: :falsey?
|
226
235
|
end
|
227
|
-
expect { subject }.not_to change
|
236
|
+
expect { subject }.not_to change(Comment, :count)
|
228
237
|
end
|
229
238
|
|
230
239
|
it 'does exclude associations from a given array with a truthy condition' do
|
231
240
|
::Post.amoeba do
|
232
241
|
exclude_association [:comments], if: :truthy?
|
233
242
|
end
|
234
|
-
expect { subject }.not_to change
|
243
|
+
expect { subject }.not_to change(Comment, :count)
|
235
244
|
end
|
236
245
|
|
237
246
|
it 'does not exclude associations from a given array with a falsey condition' do
|
238
247
|
::Post.amoeba do
|
239
248
|
exclude_association [:comments], if: :falsey?
|
240
249
|
end
|
241
|
-
expect { subject }.to change
|
250
|
+
expect { subject }.to change(Comment, :count).by(3)
|
242
251
|
end
|
243
252
|
end
|
244
253
|
|
245
254
|
context 'override' do
|
246
|
-
before
|
255
|
+
before do
|
247
256
|
::Image.fresh_amoeba
|
248
257
|
::Image.amoeba do
|
249
258
|
override ->(old, new) { new.product_id = 13 if old.filename == 'test.jpg' }
|
250
259
|
end
|
251
260
|
end
|
252
261
|
|
253
|
-
it '
|
262
|
+
it 'overrides fields' do
|
254
263
|
image = ::Image.create(filename: 'test.jpg', product_id: 12)
|
255
264
|
image_dup = image.amoeba_dup
|
256
265
|
expect(image_dup.save).to be_truthy
|
257
266
|
expect(image_dup.product_id).to eq(13)
|
258
267
|
end
|
259
268
|
|
260
|
-
it '
|
269
|
+
it 'does not override fields' do
|
261
270
|
image = ::Image.create(filename: 'test2.jpg', product_id: 12)
|
262
271
|
image_dup = image.amoeba_dup
|
263
272
|
expect(image_dup.save).to be_truthy
|
@@ -266,7 +275,7 @@ describe 'amoeba' do
|
|
266
275
|
end
|
267
276
|
|
268
277
|
context 'nullify' do
|
269
|
-
before
|
278
|
+
before do
|
270
279
|
::Image.fresh_amoeba
|
271
280
|
::Image.amoeba do
|
272
281
|
nullify :product_id
|
@@ -276,14 +285,14 @@ describe 'amoeba' do
|
|
276
285
|
let(:image) { ::Image.create(filename: 'test.jpg', product_id: 12) }
|
277
286
|
let(:image_dup) { image.amoeba_dup }
|
278
287
|
|
279
|
-
it '
|
288
|
+
it 'nullifies fields' do
|
280
289
|
expect(image_dup.save).to be_truthy
|
281
290
|
expect(image_dup.product_id).to be_nil
|
282
291
|
end
|
283
292
|
end
|
284
293
|
|
285
294
|
context 'strict propagate' do
|
286
|
-
it '
|
295
|
+
it 'calls #reset_amoeba' do
|
287
296
|
expect(::SuperBlackBox).to receive(:reset_amoeba).and_call_original
|
288
297
|
box = ::SuperBlackBox.create(title: 'Super Black Box', price: 9.99, length: 1, metal: '1')
|
289
298
|
new_box = box.amoeba_dup
|
@@ -312,13 +321,16 @@ describe 'amoeba' do
|
|
312
321
|
|
313
322
|
context 'preprocessing fields' do
|
314
323
|
subject { super_admin.amoeba_dup }
|
315
|
-
let(:super_admin) { ::SuperAdmin.create!(email: 'user@example.com', active: true, password: 'password') }
|
316
324
|
|
317
|
-
|
325
|
+
let(:super_admin) do
|
326
|
+
::SuperAdmin.create!(email: 'user@example.com', active: true, password: 'password')
|
327
|
+
end
|
328
|
+
|
329
|
+
it 'accepts "set" to set false to attribute' do
|
318
330
|
expect(subject.active).to be false
|
319
331
|
end
|
320
332
|
|
321
|
-
it '
|
333
|
+
it 'skips "prepend" if it equal to false' do
|
322
334
|
expect(subject.password).to eq('password')
|
323
335
|
end
|
324
336
|
end
|
@@ -336,6 +348,8 @@ describe 'amoeba' do
|
|
336
348
|
end
|
337
349
|
|
338
350
|
context 'inheritance extended' do
|
351
|
+
subject { stage.amoeba_dup }
|
352
|
+
|
339
353
|
let(:stage) do
|
340
354
|
stage = CustomStage.new(title: 'My Stage', external_id: 213)
|
341
355
|
stage.listeners.build(name: 'John')
|
@@ -346,19 +360,19 @@ describe 'amoeba' do
|
|
346
360
|
stage
|
347
361
|
end
|
348
362
|
|
349
|
-
subject { stage.amoeba_dup }
|
350
|
-
|
351
363
|
it 'contains parent association and own associations', :aggregate_failures do
|
352
364
|
subject
|
353
|
-
expect { subject.save! }.to change(Listener, :count).by(2)
|
354
|
-
|
355
|
-
|
365
|
+
expect { subject.save! }.to change(Listener, :count).by(2)
|
366
|
+
.and change(Specialist, :count).by(1)
|
367
|
+
.and change(
|
368
|
+
CustomRule, :count
|
369
|
+
).by(1)
|
356
370
|
|
357
371
|
expect(subject.title).to eq 'My Stage'
|
358
372
|
expect(subject.external_id).to be_nil
|
359
|
-
expect(subject.listeners.find_by(name: 'John')).
|
360
|
-
expect(subject.listeners.find_by(name: 'Helen')).
|
361
|
-
expect(subject.specialists.find_by(name: 'Jack')).
|
373
|
+
expect(subject.listeners.find_by(name: 'John')).not_to be_nil
|
374
|
+
expect(subject.listeners.find_by(name: 'Helen')).not_to be_nil
|
375
|
+
expect(subject.specialists.find_by(name: 'Jack')).not_to be_nil
|
362
376
|
expect(subject.custom_rules.first.description).to eq 'Kill all humans'
|
363
377
|
end
|
364
378
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,21 @@
|
|
1
1
|
require 'simplecov'
|
2
|
-
|
3
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
4
|
-
SimpleCov::Formatter::HTMLFormatter,
|
5
|
-
Coveralls::SimpleCov::Formatter
|
6
|
-
])
|
2
|
+
|
7
3
|
SimpleCov.start do
|
8
4
|
add_filter 'spec'
|
9
5
|
minimum_coverage(76)
|
6
|
+
|
7
|
+
if ENV['CI']
|
8
|
+
require 'simplecov-lcov'
|
9
|
+
|
10
|
+
SimpleCov::Formatter::LcovFormatter.config do |c|
|
11
|
+
c.report_with_single_file = true
|
12
|
+
c.single_report_path = 'coverage/lcov.info'
|
13
|
+
end
|
14
|
+
|
15
|
+
formatter SimpleCov::Formatter::LcovFormatter
|
16
|
+
end
|
10
17
|
end
|
18
|
+
|
11
19
|
require 'active_record'
|
12
20
|
require 'amoeba'
|
13
21
|
|
data/spec/support/data.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
u1 = User.create(name: 'Robert Johnson', email: 'bob@crossroads.com')
|
3
2
|
u2 = User.create(name: 'Miles Davis', email: 'miles@kindofblue.com')
|
4
3
|
|
@@ -8,7 +7,8 @@ a2 = Author.create(full_name: 'Arthur Sees Clarck', nickname: 'strangewater')
|
|
8
7
|
t = Topic.create(title: 'Ponies', description: 'Lets talk about my ponies.')
|
9
8
|
|
10
9
|
# First Post {{{
|
11
|
-
p1 = t.posts.create(owner: u1, author: a1, title: 'My little pony',
|
10
|
+
p1 = t.posts.create(owner: u1, author: a1, title: 'My little pony',
|
11
|
+
contents: 'Lorum ipsum dolor rainbow bright. I like dogs, dogs are awesome.')
|
12
12
|
f1 = p1.create_post_config(is_visible: true, is_open: false, password: 'abcdefg123')
|
13
13
|
a1 = p1.create_account(title: 'Foo')
|
14
14
|
h1 = p1.account.create_history(some_stuff: 'Bar')
|
@@ -21,11 +21,15 @@ c2 = p1.comments.create(contents: 'I hate it!', nerf: 'whapaow')
|
|
21
21
|
c3 = p1.comments.create(contents: 'kthxbbq!!11!!!1!eleven!!', nerf: 'bonk')
|
22
22
|
[0, 0, 1, 2, 1, 0].each { |stars| c3.ratings.create(num_stars: stars) }
|
23
23
|
|
24
|
-
%w
|
24
|
+
%w[funny wtf cats].each { |value| p1.tags << Tag.create(value: value) }
|
25
25
|
|
26
|
-
['My Sidebar', 'Photo Gallery', 'Share & Like'].each
|
26
|
+
['My Sidebar', 'Photo Gallery', 'Share & Like'].each do |value|
|
27
|
+
p1.widgets << Widget.create(value: value)
|
28
|
+
end
|
27
29
|
|
28
|
-
['This is important', "You've been warned", "Don't forget"].each
|
30
|
+
['This is important', "You've been warned", "Don't forget"].each do |value|
|
31
|
+
p1.notes << Note.create(value: value)
|
32
|
+
end
|
29
33
|
|
30
34
|
p1.save
|
31
35
|
|
@@ -85,15 +89,18 @@ necklace1.sections << jewelry
|
|
85
89
|
necklace1.sections << accessories
|
86
90
|
necklace1.save
|
87
91
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
employee_address_2 = employee.addresses.create(street: '124 My Street',unit:'103',city:'Follywood',
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
92
|
+
company = Company.create(name: 'ABC Industries')
|
93
|
+
employee = company.employees.create(name: 'Joe', ssn: '1111111111', salary: 10_000.0)
|
94
|
+
employee_address = employee.addresses.create(street: '123 My Street', unit: '103', city: 'Hollywood',
|
95
|
+
state: 'CA', zip: '90210')
|
96
|
+
employee_address_2 = employee.addresses.create(street: '124 My Street', unit: '103', city: 'Follywood',
|
97
|
+
state: 'CA', zip: '90210')
|
98
|
+
employee_photo = employee.photos.create(name: 'Portrait', size: 12_345)
|
99
|
+
customer = company.customers.create(email: 'my@email.address', password: 'password')
|
100
|
+
customer_address = customer.addresses.create(street: '321 My Street', unit: '301', city: 'Bollywood',
|
101
|
+
state: 'IN', zip: '11111')
|
102
|
+
customer_address_2 = customer.addresses.create(street: '321 My Drive', unit: '311', city: 'Mollywood',
|
103
|
+
state: 'IN', zip: '21111')
|
104
|
+
customer_photo = customer.photos.create(name: 'Mug Shot', size: 54_321)
|
98
105
|
|
99
106
|
# }}}
|
data/spec/support/models.rb
CHANGED
@@ -34,41 +34,41 @@ class Post < ActiveRecord::Base
|
|
34
34
|
|
35
35
|
amoeba do
|
36
36
|
enable
|
37
|
-
clone [
|
37
|
+
clone %i[widgets notes]
|
38
38
|
prepend title: 'Copy of '
|
39
39
|
append contents: ' (copied version)'
|
40
40
|
regex contents: { replace: /dog/, with: 'cat' }
|
41
41
|
customize([
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
42
|
+
lambda do |orig_obj, copy_of_obj|
|
43
|
+
orig_obj.comments.each do |oc|
|
44
|
+
next unless oc.nerf == 'ratatat'
|
45
|
+
|
46
|
+
hash = oc.attributes
|
47
|
+
hash[:id] = nil
|
48
|
+
hash[:post_id] = nil
|
49
|
+
hash[:contents] = nil
|
50
|
+
|
51
|
+
cc = Comment.new(hash)
|
52
|
+
|
53
|
+
copy_of_obj.comments << cc
|
54
|
+
end
|
55
|
+
end,
|
56
|
+
lambda do |orig_obj, copy_of_obj|
|
57
|
+
orig_obj.comments.each do |oc|
|
58
|
+
next unless oc.nerf == 'bonk'
|
59
|
+
|
60
|
+
hash = oc.attributes
|
61
|
+
hash[:id] = nil
|
62
|
+
hash[:post_id] = nil
|
63
|
+
hash[:contents] = nil
|
64
|
+
hash[:nerf] = 'bonkers'
|
65
|
+
|
66
|
+
cc = Comment.new(hash)
|
67
|
+
|
68
|
+
copy_of_obj.comments << cc
|
69
|
+
end
|
70
|
+
end
|
71
|
+
])
|
72
72
|
end
|
73
73
|
|
74
74
|
def truthy?
|
@@ -97,11 +97,13 @@ class CustomThing < ActiveRecord::Base
|
|
97
97
|
def self.load(str)
|
98
98
|
return [] unless str.present?
|
99
99
|
return str if str.is_a?(Array)
|
100
|
+
|
100
101
|
str.split(',').map(&:to_i)
|
101
102
|
end
|
102
103
|
|
103
104
|
def self.dump(int_array)
|
104
105
|
return '' unless int_array.present?
|
106
|
+
|
105
107
|
int_array.join(',')
|
106
108
|
end
|
107
109
|
end
|
@@ -261,7 +263,7 @@ class Photo < ActiveRecord::Base
|
|
261
263
|
belongs_to :imageable, polymorphic: true
|
262
264
|
|
263
265
|
amoeba do
|
264
|
-
customize(lambda { |original_photo,new_photo|
|
266
|
+
customize(lambda { |original_photo, new_photo|
|
265
267
|
new_photo.name = original_photo.name.to_s + ' Copy'
|
266
268
|
})
|
267
269
|
end
|
@@ -273,7 +275,7 @@ class Company < ActiveRecord::Base
|
|
273
275
|
|
274
276
|
amoeba do
|
275
277
|
include_associations :employees,
|
276
|
-
|
278
|
+
:customers
|
277
279
|
end
|
278
280
|
end
|
279
281
|
|
@@ -283,9 +285,8 @@ class Employee < ActiveRecord::Base
|
|
283
285
|
belongs_to :company
|
284
286
|
|
285
287
|
amoeba do
|
286
|
-
include_associations [
|
288
|
+
include_associations %i[addresses photos]
|
287
289
|
end
|
288
|
-
|
289
290
|
end
|
290
291
|
|
291
292
|
class Customer < ActiveRecord::Base
|
@@ -313,7 +314,7 @@ class ObjectPrototype < MetalObject
|
|
313
314
|
end
|
314
315
|
|
315
316
|
def become_real
|
316
|
-
|
317
|
+
dup.becomes RealObject
|
317
318
|
end
|
318
319
|
|
319
320
|
def remap_subobjects(relation_name)
|
@@ -332,7 +333,7 @@ class SubobjectPrototype < MetalObject
|
|
332
333
|
end
|
333
334
|
|
334
335
|
def become_subobject
|
335
|
-
|
336
|
+
dup.becomes Subobject
|
336
337
|
end
|
337
338
|
end
|
338
339
|
|
@@ -360,7 +361,7 @@ class Box < ActiveRecord::Base
|
|
360
361
|
end
|
361
362
|
|
362
363
|
class BoxProduct < ActiveRecord::Base
|
363
|
-
belongs_to
|
364
|
+
belongs_to :box, class_name: 'Box'
|
364
365
|
|
365
366
|
amoeba do
|
366
367
|
enable
|
metadata
CHANGED
@@ -1,44 +1,72 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amoeba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vaughn Draughon
|
8
8
|
- Oleksandr Simonov
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-09-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: rspec
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 3.0.0
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 3.0.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: rubocop
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: '1.16'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: '1.16'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rubocop-rake
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0.6'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0.6'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rubocop-rspec
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '2.4'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '2.4'
|
42
70
|
- !ruby/object:Gem::Dependency
|
43
71
|
name: sqlite3
|
44
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,14 +87,14 @@ dependencies:
|
|
59
87
|
requirements:
|
60
88
|
- - ">="
|
61
89
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
90
|
+
version: 5.2.0
|
63
91
|
type: :runtime
|
64
92
|
prerelease: false
|
65
93
|
version_requirements: !ruby/object:Gem::Requirement
|
66
94
|
requirements:
|
67
95
|
- - ">="
|
68
96
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
97
|
+
version: 5.2.0
|
70
98
|
description: |
|
71
99
|
An extension to ActiveRecord to allow the duplication method to also copy associated children, with recursive support for nested of grandchildren. The behavior is controllable with a simple DSL both on your rails models and on the fly, i.e. per instance. Numerous configuration styles and preprocessing directives are included for power and flexibility. Supports preprocessing of field values to prepend strings such as "Copy of ", to nullify or process field values with regular expressions. Supports most association types including has_one :through and has_many :through.
|
72
100
|
|
@@ -77,24 +105,32 @@ extensions: []
|
|
77
105
|
extra_rdoc_files: []
|
78
106
|
files:
|
79
107
|
- ".cane"
|
108
|
+
- ".github/workflows/jruby.yml"
|
109
|
+
- ".github/workflows/ruby_25.yml"
|
110
|
+
- ".github/workflows/ruby_26.yml"
|
111
|
+
- ".github/workflows/ruby_27.yml"
|
112
|
+
- ".github/workflows/ruby_30.yml"
|
113
|
+
- ".github/workflows/ruby_31.yml"
|
114
|
+
- ".github/workflows/ruby_32.yml"
|
115
|
+
- ".github/workflows/ruby_head.yml"
|
80
116
|
- ".gitignore"
|
81
117
|
- ".rspec"
|
82
118
|
- ".rubocop.yml"
|
83
|
-
- ".
|
119
|
+
- ".rubocop_todo.yml"
|
84
120
|
- Appraisals
|
121
|
+
- CHANGELOG.md
|
85
122
|
- Gemfile
|
123
|
+
- LICENSE.md
|
86
124
|
- README.md
|
87
125
|
- Rakefile
|
88
126
|
- amoeba.gemspec
|
89
127
|
- defaults.reek
|
90
|
-
- gemfiles/activerecord_4.2.gemfile
|
91
|
-
- gemfiles/activerecord_5.0.gemfile
|
92
|
-
- gemfiles/activerecord_5.1.gemfile
|
93
128
|
- gemfiles/activerecord_5.2.gemfile
|
94
129
|
- gemfiles/activerecord_6.0.gemfile
|
95
130
|
- gemfiles/activerecord_6.1.gemfile
|
131
|
+
- gemfiles/activerecord_7.0.gemfile
|
96
132
|
- gemfiles/activerecord_head.gemfile
|
97
|
-
- gemfiles/
|
133
|
+
- gemfiles/jruby_activerecord_7.0.gemfile
|
98
134
|
- gemfiles/jruby_activerecord_head.gemfile
|
99
135
|
- lib/amoeba.rb
|
100
136
|
- lib/amoeba/class_methods.rb
|
@@ -114,9 +150,9 @@ files:
|
|
114
150
|
- spec/support/schema.rb
|
115
151
|
homepage: http://github.com/amoeba-rb/amoeba
|
116
152
|
licenses:
|
117
|
-
- BSD
|
153
|
+
- BSD-2-Clause
|
118
154
|
metadata: {}
|
119
|
-
post_install_message:
|
155
|
+
post_install_message:
|
120
156
|
rdoc_options: []
|
121
157
|
require_paths:
|
122
158
|
- lib
|
@@ -124,20 +160,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
160
|
requirements:
|
125
161
|
- - ">="
|
126
162
|
- !ruby/object:Gem::Version
|
127
|
-
version: '
|
163
|
+
version: '2.5'
|
128
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
165
|
requirements:
|
130
166
|
- - ">="
|
131
167
|
- !ruby/object:Gem::Version
|
132
168
|
version: '0'
|
133
169
|
requirements: []
|
134
|
-
rubygems_version: 3.
|
135
|
-
signing_key:
|
170
|
+
rubygems_version: 3.4.10
|
171
|
+
signing_key:
|
136
172
|
specification_version: 4
|
137
173
|
summary: Easy copying of rails models and their child associations.
|
138
|
-
test_files:
|
139
|
-
- spec/lib/amoeba_spec.rb
|
140
|
-
- spec/spec_helper.rb
|
141
|
-
- spec/support/data.rb
|
142
|
-
- spec/support/models.rb
|
143
|
-
- spec/support/schema.rb
|
174
|
+
test_files: []
|