amoeba 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 057039190fd1b4431eb35d8e6f0911bff75185ad
4
+ data.tar.gz: 4fa23a784b6eed67fab53bfacda76e9974a796d4
5
+ SHA512:
6
+ metadata.gz: 77579cc4fa532edeaa0637a10ea5f34b8639bea7c5262a6165efc441a4ea7a5d2d2e8cc5c24fcb4af99e801d93c2e454ec08ebed7db8f1dffc28fb3206c11eb3
7
+ data.tar.gz: ce4a34f97cc598c79ce74add51e1acacd0e8f8eb024ee7fc7c4352c88f1cce9a9f129c893078ba3f0391fbe3503916cedb40202802199286026c975c93cc470b
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  *.gem
2
2
  .bundle
3
- Gemfile.lock
3
+ Gemfile*.lock
4
4
  pkg/*
5
5
  spec/test.sqlite3
6
+ coverage
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
@@ -0,0 +1 @@
1
+ 2.0.0-p451
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 1.9.2
5
+ - 2.0.0
6
+ - ruby-head
7
+ - jruby-19mode # JRuby in 1.9 mode
8
+ - rbx-19mode
9
+ gemfile:
10
+ - gemfiles/Gemfile.rails-3.2.x
11
+ - Gemfile
data/Gemfile CHANGED
@@ -2,3 +2,9 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in power_dup.gemspec
4
4
  gemspec
5
+ gem 'activerecord', '~> 4.1.2'
6
+
7
+ group :development, :test do
8
+ gem 'rake'
9
+ gem 'coveralls', require: false
10
+ end
data/README.md CHANGED
@@ -196,7 +196,7 @@ If you are using a Many-to-Many relationship, you may tell amoeba to actually ma
196
196
 
197
197
  amoeba do
198
198
  enable
199
- clone [:widgets, :tags]
199
+ clone [:widgets, :warnings]
200
200
  end
201
201
  end
202
202
 
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -30,5 +30,5 @@ EOF
30
30
 
31
31
  s.add_development_dependency "sqlite3"
32
32
 
33
- s.add_dependency "activerecord", ">= 3.0"
33
+ s.add_dependency 'activerecord', '>= 3.2.6', '< 5'
34
34
  end
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec :path => '..'
4
+
5
+ gem 'activerecord', '~> 3.2.6'
6
+ gem 'sqlite3'
7
+
8
+ group :development do
9
+ gem 'rake'
10
+ gem 'coveralls', require: false
11
+ end
@@ -0,0 +1,11 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec :path => '..'
4
+
5
+ gem 'activerecord', '~> 4.0.0'
6
+ gem 'sqlite3'
7
+
8
+ group :development do
9
+ gem 'rake'
10
+ gem 'coveralls', require: false
11
+ end
@@ -294,6 +294,10 @@ module Amoeba
294
294
  self.class.amoeba
295
295
  end
296
296
 
297
+ def amoeba_dup_options
298
+ @amoeba_dup_options
299
+ end
300
+
297
301
  def has_parent_amoeba_conf?
298
302
  self.class.superclass.respond_to?(:amoeba)
299
303
  end
@@ -325,6 +329,7 @@ module Amoeba
325
329
 
326
330
  def amoeba_dup(options={})
327
331
  @result = self.dup()
332
+ @amoeba_dup_options = options
328
333
 
329
334
  # Inherit Parent Settings {{{
330
335
  if !amoeba_conf.enabled && parent_amoeba_conf.inherit
@@ -383,7 +388,7 @@ module Amoeba
383
388
  # }}}
384
389
  # Exclusive Style {{{
385
390
  elsif amoeba_conf.excludes.count > 0
386
- reflections.each do |r|
391
+ self.class.reflections.each do |r|
387
392
  if not amoeba_conf.excludes.include?(r[0])
388
393
  amo_process_association(r[0], r[1])
389
394
  end
@@ -391,7 +396,7 @@ module Amoeba
391
396
  # }}}
392
397
  # Indiscriminate Style {{{
393
398
  else
394
- reflections.each do |r|
399
+ self.class.reflections.each do |r|
395
400
  amo_process_association(r[0], r[1])
396
401
  end
397
402
  end
@@ -422,7 +427,7 @@ module Amoeba
422
427
  old_obj = self.send(relation_name)
423
428
 
424
429
  if not old_obj.nil?
425
- copy_of_obj = old_obj.amoeba_dup
430
+ copy_of_obj = old_obj.amoeba_dup(amoeba_dup_options)
426
431
  copy_of_obj[:"#{settings.foreign_key}"] = nil
427
432
 
428
433
  @result.send(:"#{relation_name}=", copy_of_obj)
@@ -454,7 +459,7 @@ module Amoeba
454
459
  return if settings.is_a?(ActiveRecord::Reflection::ThroughReflection)
455
460
 
456
461
  self.send(relation_name).each do |old_obj|
457
- copy_of_obj = old_obj.amoeba_dup
462
+ copy_of_obj = old_obj.amoeba_dup(amoeba_dup_options)
458
463
  copy_of_obj[:"#{settings.foreign_key}"] = nil
459
464
 
460
465
  # associate this new child to the new parent object
@@ -1,3 +1,3 @@
1
1
  module Amoeba
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -1,3 +1,5 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
1
3
  require 'amoeba'
2
4
 
3
5
  ActiveRecord::Base.establish_connection(:adapter => "sqlite3",
metadata CHANGED
@@ -1,36 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amoeba
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
5
- prerelease:
4
+ version: 2.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Vaughn Draughon
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-03 00:00:00.000000000 Z
11
+ date: 2014-09-08 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.0.0
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 1.0.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rspec
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,75 +41,56 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: sqlite3
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: activerecord
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
- version: '3.0'
61
+ version: 3.2.6
62
+ - - <
63
+ - !ruby/object:Gem::Version
64
+ version: '5'
70
65
  type: :runtime
71
66
  prerelease: false
72
67
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
68
  requirements:
75
- - - ! '>='
69
+ - - '>='
76
70
  - !ruby/object:Gem::Version
77
- version: '3.0'
78
- description: ! 'An extension to ActiveRecord to allow the duplication method to also
79
- copy associated children, with recursive support for nested of grandchildren. The
80
- behavior is controllable with a simple DSL both on your rails models and on the
81
- fly, i.e. per instance. Numerous configuration styles and preprocessing directives
82
- are included for power and flexibility. Supports preprocessing of field values to
83
- prepend strings such as "Copy of ", to nullify or process field values with regular
84
- expressions. Supports most association types including has_one :through and has_many
85
- :through.
86
-
87
-
88
- Tags: copy child associations, copy nested children, copy associated child records,
89
- nested copy, copy associations, copy relations, copy relationships, duplicate associations,
90
- duplicate associated records, duplicate child records, duplicate children, copy
91
- all, duplicate all, clone child associations, clone nested children, clone associated
92
- child records, nested clone, clone associations, clone relations, clone relationships,
93
- cloning child associations, cloning nested children, cloning associated child records,
94
- deep_cloning, nested cloning, cloning associations, cloning relations, cloning relationships,
95
- cloning child associations, cloning nested children, cloning associated child records,
96
- nested cloning, cloning associations, cloning relations, cloning relationships,
97
- cloning child associations, cloning nested children, cloning associated child records,
98
- deep_cloning, nested cloning, cloning associations, cloning relations, cloning relationships,
99
- duplicate child associations, duplicate nested children, duplicate associated child
100
- records, nested duplicate, duplicate associations, duplicate relations, duplicate
101
- relationships, duplicate child associations, duplicate nested children, duplicate
102
- associated child records, deep_duplicate, nested duplicate, duplicate associations,
103
- duplicate relations, duplicate relationships, deep_copy, deep_clone, deep_cloning,
104
- deep clone, deep cloning, has_one, has_many, has_and_belongs_to_many
71
+ version: 3.2.6
72
+ - - <
73
+ - !ruby/object:Gem::Version
74
+ version: '5'
75
+ description: |
76
+ 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.
105
77
 
106
- '
78
+ Tags: copy child associations, copy nested children, copy associated child records, nested copy, copy associations, copy relations, copy relationships, duplicate associations, duplicate associated records, duplicate child records, duplicate children, copy all, duplicate all, clone child associations, clone nested children, clone associated child records, nested clone, clone associations, clone relations, clone relationships, cloning child associations, cloning nested children, cloning associated child records, deep_cloning, nested cloning, cloning associations, cloning relations, cloning relationships, cloning child associations, cloning nested children, cloning associated child records, nested cloning, cloning associations, cloning relations, cloning relationships, cloning child associations, cloning nested children, cloning associated child records, deep_cloning, nested cloning, cloning associations, cloning relations, cloning relationships, duplicate child associations, duplicate nested children, duplicate associated child records, nested duplicate, duplicate associations, duplicate relations, duplicate relationships, duplicate child associations, duplicate nested children, duplicate associated child records, deep_duplicate, nested duplicate, duplicate associations, duplicate relations, duplicate relationships, deep_copy, deep_clone, deep_cloning, deep clone, deep cloning, has_one, has_many, has_and_belongs_to_many
107
79
  email: vaughn@rocksolidwebdesign.com
108
80
  executables: []
109
81
  extensions: []
110
82
  extra_rdoc_files: []
111
83
  files:
112
84
  - .gitignore
113
- - .rvmrc
85
+ - .rspec
86
+ - .ruby-version
87
+ - .travis.yml
114
88
  - Gemfile
115
89
  - README.md
116
90
  - Rakefile
117
91
  - amoeba.gemspec
92
+ - gemfiles/Gemfile.activerecord-3.2.x
93
+ - gemfiles/Gemfile.activerecord-4.0.x
118
94
  - lib/amoeba.rb
119
95
  - lib/amoeba/version.rb
120
96
  - spec/lib/amoeba_spec.rb
@@ -125,27 +101,26 @@ files:
125
101
  homepage: http://github.com/rocksolidwebdesign/amoeba
126
102
  licenses:
127
103
  - BSD
104
+ metadata: {}
128
105
  post_install_message:
129
106
  rdoc_options: []
130
107
  require_paths:
131
108
  - lib
132
109
  required_ruby_version: !ruby/object:Gem::Requirement
133
- none: false
134
110
  requirements:
135
- - - ! '>='
111
+ - - '>='
136
112
  - !ruby/object:Gem::Version
137
113
  version: '0'
138
114
  required_rubygems_version: !ruby/object:Gem::Requirement
139
- none: false
140
115
  requirements:
141
- - - ! '>='
116
+ - - '>='
142
117
  - !ruby/object:Gem::Version
143
118
  version: '0'
144
119
  requirements: []
145
120
  rubyforge_project: amoeba
146
- rubygems_version: 1.8.24
121
+ rubygems_version: 2.0.14
147
122
  signing_key:
148
- specification_version: 3
123
+ specification_version: 4
149
124
  summary: Easy copying of rails models and their child associations.
150
125
  test_files:
151
126
  - spec/lib/amoeba_spec.rb
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use --create 1.9.3-p194@amoeba