amoeba 3.1.0 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/jruby.yml +27 -0
  3. data/.github/workflows/ruby_25.yml +30 -0
  4. data/.github/workflows/ruby_26.yml +30 -0
  5. data/.github/workflows/ruby_27.yml +30 -0
  6. data/.github/workflows/ruby_30.yml +34 -0
  7. data/.github/workflows/ruby_31.yml +34 -0
  8. data/.github/workflows/ruby_32.yml +34 -0
  9. data/.github/workflows/ruby_head.yml +34 -0
  10. data/.gitignore +1 -0
  11. data/.rubocop.yml +11 -7
  12. data/.rubocop_todo.yml +120 -0
  13. data/Appraisals +48 -9
  14. data/CHANGELOG.md +14 -0
  15. data/Gemfile +5 -2
  16. data/LICENSE.md +11 -0
  17. data/README.md +3 -17
  18. data/Rakefile +2 -0
  19. data/amoeba.gemspec +20 -17
  20. data/gemfiles/activerecord_5.2.gemfile +19 -0
  21. data/gemfiles/activerecord_6.0.gemfile +19 -0
  22. data/gemfiles/activerecord_6.1.gemfile +19 -0
  23. data/gemfiles/activerecord_7.0.gemfile +19 -0
  24. data/gemfiles/activerecord_head.gemfile +10 -12
  25. data/gemfiles/jruby_activerecord_7.0.gemfile +20 -0
  26. data/gemfiles/jruby_activerecord_head.gemfile +26 -0
  27. data/lib/amoeba/class_methods.rb +2 -0
  28. data/lib/amoeba/cloner.rb +11 -4
  29. data/lib/amoeba/config.rb +25 -51
  30. data/lib/amoeba/instance_methods.rb +3 -0
  31. data/lib/amoeba/macros/base.rb +4 -1
  32. data/lib/amoeba/macros/has_and_belongs_to_many.rb +2 -0
  33. data/lib/amoeba/macros/has_many.rb +2 -0
  34. data/lib/amoeba/macros/has_one.rb +4 -0
  35. data/lib/amoeba/macros.rb +2 -0
  36. data/lib/amoeba/version.rb +3 -1
  37. data/lib/amoeba.rb +6 -2
  38. data/spec/lib/amoeba_spec.rb +76 -34
  39. data/spec/spec_helper.rb +13 -5
  40. data/spec/support/data.rb +22 -15
  41. data/spec/support/models.rb +39 -38
  42. metadata +66 -30
  43. data/.travis.yml +0 -20
  44. data/gemfiles/activerecord_4.0.gemfile +0 -17
  45. data/gemfiles/activerecord_4.1.gemfile +0 -17
  46. data/gemfiles/activerecord_4.2.gemfile +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1a68fa1a80b0adb7f599e0a32be7bd689fa345e4
4
- data.tar.gz: 3ce6f7bcce38f2c7fb1451c992527e9252acce8c
2
+ SHA256:
3
+ metadata.gz: 29529dad8414b04baff41f8ef9638dc79f118bf259c46ce6769ddb03919d484b
4
+ data.tar.gz: 6b3d0507d6c1a6fe325394ccbd620fab75cd73c570ca16275e90bb11234f5c0f
5
5
  SHA512:
6
- metadata.gz: 8e72bac7e454ab09712e28b2ee0651b25fb25cac04eba7ea276d43aa71bf6d427fa904a1525534fdc9b28dd48968d7f5fd1b2a983518e17840efe36cf61892ee
7
- data.tar.gz: 4da78e7256ad15fe02bd2e3cf0249a114556f3e80cc63991167bd20d3011a7ce3aea3be03b1915a716a149c18ddb80c705e8391054dffa130595cabf8b9fdd69
6
+ metadata.gz: 27bcd19c86d54a1cf5af027aa29ed1e81b79bf21d54459b438789be81999a915950e26311011b38d9b79c0106b8537cf01287f3f89a1974f4b10dfcd56429f7b
7
+ data.tar.gz: 86586b2a76dec19a36d3bae63a16cda9301c9659cabb50b0d7b66afe946effd35f7ebe38748ac0f9c398a835f1429d29a5661c94e52187f59db89b1278502cbc
@@ -0,0 +1,27 @@
1
+ name: JRuby
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ env:
13
+ BUNDLE_GEMFILE: gemfiles/jruby_activerecord_7.0.gemfile
14
+ JRUBY_OPTS: --debug
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: jruby
21
+ bundler-cache: true
22
+ - name: Run tests
23
+ run: bundle exec rspec
24
+ - name: Coveralls
25
+ uses: coverallsapp/github-action@master
26
+ with:
27
+ github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,30 @@
1
+ name: Ruby 2.5
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ gemfile: [ activerecord_5.2, activerecord_6.0, activerecord_6.1 ]
16
+ env:
17
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: 2.5
24
+ bundler-cache: true
25
+ - name: Run tests
26
+ run: bundle exec rspec
27
+ - name: Coveralls
28
+ uses: coverallsapp/github-action@master
29
+ with:
30
+ github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,30 @@
1
+ name: Ruby 2.6
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ gemfile: [ activerecord_5.2, activerecord_6.0, activerecord_6.1 ]
16
+ env:
17
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: 2.6
24
+ bundler-cache: true
25
+ - name: Run tests
26
+ run: bundle exec rspec
27
+ - name: Coveralls
28
+ uses: coverallsapp/github-action@master
29
+ with:
30
+ github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,30 @@
1
+ name: Ruby 2.7
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ gemfile: [ activerecord_5.2, activerecord_6.0, activerecord_6.1, activerecord_7.0, activerecord_head ]
16
+ env:
17
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: 2.7
24
+ bundler-cache: true
25
+ - name: Run tests
26
+ run: bundle exec rspec
27
+ - name: Coveralls
28
+ uses: coverallsapp/github-action@master
29
+ with:
30
+ github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,34 @@
1
+ name: Ruby 3.0
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ gemfile: [ activerecord_6.0, activerecord_6.1, activerecord_7.0, activerecord_head ]
16
+ # sqlite 1.3 is not compatible with Ruby 3.0+. If this changes or
17
+ # sqlite is no longer a dependency then the Active Record 5.2 tests
18
+ # can be added:
19
+ # gemfile: [ activerecord_5.2, activerecord_6.0, activerecord_6.1, activerecord_head ]
20
+ env:
21
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: 3.0
28
+ bundler-cache: true
29
+ - name: Run tests
30
+ run: bundle exec rspec
31
+ - name: Coveralls
32
+ uses: coverallsapp/github-action@master
33
+ with:
34
+ github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,34 @@
1
+ name: Ruby 3.1
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ gemfile: [ activerecord_6.0, activerecord_6.1, activerecord_7.0, activerecord_head ]
16
+ # sqlite 1.3 is not compatible with Ruby 3.0+. If this changes or
17
+ # sqlite is no longer a dependency then the Active Record 5.2 tests
18
+ # can be added:
19
+ # gemfile: [ activerecord_5.2, activerecord_6.0, activerecord_6.1, activerecord_head ]
20
+ env:
21
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: 3.1
28
+ bundler-cache: true
29
+ - name: Run tests
30
+ run: bundle exec rspec
31
+ - name: Coveralls
32
+ uses: coverallsapp/github-action@master
33
+ with:
34
+ github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,34 @@
1
+ name: Ruby 3.2
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ gemfile: [ activerecord_6.0, activerecord_6.1, activerecord_7.0, activerecord_head ]
16
+ # sqlite 1.3 is not compatible with Ruby 3.0+. If this changes or
17
+ # sqlite is no longer a dependency then the Active Record 5.2 tests
18
+ # can be added:
19
+ # gemfile: [ activerecord_5.2, activerecord_6.0, activerecord_6.1, activerecord_head ]
20
+ env:
21
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: 3.2
28
+ bundler-cache: true
29
+ - name: Run tests
30
+ run: bundle exec rspec
31
+ - name: Coveralls
32
+ uses: coverallsapp/github-action@master
33
+ with:
34
+ github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,34 @@
1
+ name: Ruby head
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ gemfile: [ activerecord_6.0, activerecord_6.1, activerecord_7.0, activerecord_head ]
16
+ # sqlite 1.3 is not compatible with Ruby 3.0+. If this changes or
17
+ # sqlite is no longer a dependency then the Active Record 5.2 tests
18
+ # can be added:
19
+ # gemfile: [ activerecord_5.2, activerecord_6.0, activerecord_6.1, activerecord_head ]
20
+ env:
21
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: head
28
+ bundler-cache: true
29
+ - name: Run tests
30
+ run: bundle exec rspec
31
+ - name: Coveralls
32
+ uses: coverallsapp/github-action@master
33
+ with:
34
+ github-token: ${{ secrets.GITHUB_TOKEN }}
data/.gitignore CHANGED
@@ -6,3 +6,4 @@ spec/test.sqlite3
6
6
  coverage
7
7
  .idea
8
8
  gemfiles/*.lock
9
+ .ruby-version
data/.rubocop.yml CHANGED
@@ -1,17 +1,21 @@
1
+ require:
2
+ - rubocop-rspec
3
+ - rubocop-rake
4
+
5
+ inherit_from: .rubocop_todo.yml
6
+
1
7
  AllCops:
2
- Include:
3
- - '**/Rakefile'
4
- Exclude:
5
- - 'spec/**/*'
6
- Metrics/LineLength:
8
+ TargetRubyVersion: 2.5
9
+ NewCops: enable
10
+ Layout/LineLength:
7
11
  Max: 99
8
- Style/FileName:
12
+ Naming/FileName:
9
13
  Enabled: false
10
14
  Style/ModuleFunction:
11
15
  Enabled: false
12
16
  Style/Encoding:
13
17
  Enabled: false
14
- Documentation:
18
+ Style/Documentation:
15
19
  Enabled: false
16
20
  Metrics/MethodLength:
17
21
  Max: 15
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,120 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-07-10 17:38:28 UTC using RuboCop version 1.16.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 10
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
12
+ # URISchemes: http, https
13
+ Layout/LineLength:
14
+ Max: 110
15
+
16
+ # Offense count: 1
17
+ Lint/MissingSuper:
18
+ Exclude:
19
+ - 'lib/amoeba/macros/base.rb'
20
+
21
+ # Offense count: 17
22
+ Lint/UselessAssignment:
23
+ Exclude:
24
+ - 'spec/support/data.rb'
25
+
26
+ # Offense count: 8
27
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
28
+ # IgnoredMethods: refine
29
+ Metrics/BlockLength:
30
+ Max: 339
31
+
32
+ # Offense count: 2
33
+ # Configuration parameters: CountComments, CountAsOne.
34
+ Metrics/ClassLength:
35
+ Max: 141
36
+
37
+ # Offense count: 3
38
+ # Configuration parameters: ForbiddenDelimiters.
39
+ # ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$))
40
+ Naming/HeredocDelimiterNaming:
41
+ Exclude:
42
+ - 'lib/amoeba/config.rb'
43
+
44
+ # Offense count: 2
45
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
46
+ # SupportedStyles: snake_case, normalcase, non_integer
47
+ # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
48
+ Naming/VariableNumber:
49
+ Exclude:
50
+ - 'spec/support/data.rb'
51
+
52
+ # Offense count: 1
53
+ RSpec/BeforeAfterAll:
54
+ Exclude:
55
+ - 'spec/spec_helper.rb'
56
+ - 'spec/rails_helper.rb'
57
+ - 'spec/support/**/*.rb'
58
+ - 'spec/lib/amoeba_spec.rb'
59
+
60
+ # Offense count: 12
61
+ # Configuration parameters: Prefixes.
62
+ # Prefixes: when, with, without
63
+ RSpec/ContextWording:
64
+ Exclude:
65
+ - 'spec/lib/amoeba_spec.rb'
66
+
67
+ # Offense count: 1
68
+ # Configuration parameters: IgnoredMetadata.
69
+ RSpec/DescribeClass:
70
+ Exclude:
71
+ - 'spec/lib/amoeba_spec.rb'
72
+
73
+ # Offense count: 3
74
+ # Configuration parameters: CountAsOne.
75
+ RSpec/ExampleLength:
76
+ Max: 134
77
+
78
+ # Offense count: 1
79
+ # Configuration parameters: .
80
+ # SupportedStyles: have_received, receive
81
+ RSpec/MessageSpies:
82
+ EnforcedStyle: receive
83
+
84
+ # Offense count: 7
85
+ RSpec/MultipleExpectations:
86
+ Max: 55
87
+
88
+ # Offense count: 18
89
+ # Configuration parameters: IgnoreSharedExamples.
90
+ RSpec/NamedSubject:
91
+ Exclude:
92
+ - 'spec/lib/amoeba_spec.rb'
93
+
94
+ # Offense count: 1
95
+ # Cop supports --auto-correct.
96
+ # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
97
+ # SupportedStyles: inflected, explicit
98
+ RSpec/PredicateMatcher:
99
+ Exclude:
100
+ - 'spec/lib/amoeba_spec.rb'
101
+
102
+ # Offense count: 5
103
+ # Cop supports --auto-correct.
104
+ # Configuration parameters: EnforcedStyle.
105
+ # SupportedStyles: always, always_true, never
106
+ Style/FrozenStringLiteralComment:
107
+ Exclude:
108
+ - 'spec/lib/amoeba_spec.rb'
109
+ - 'spec/spec_helper.rb'
110
+ - 'spec/support/data.rb'
111
+ - 'spec/support/models.rb'
112
+ - 'spec/support/schema.rb'
113
+
114
+ # Offense count: 5
115
+ # Cop supports --auto-correct.
116
+ Style/StringConcatenation:
117
+ Exclude:
118
+ - 'spec/lib/amoeba_spec.rb'
119
+ - 'spec/spec_helper.rb'
120
+ - 'spec/support/models.rb'
data/Appraisals CHANGED
@@ -1,20 +1,59 @@
1
- appraise 'activerecord-4.0' do
2
- gem 'activerecord', '~> 4.0.0'
1
+ # frozen_string_literal: true
2
+
3
+ appraise 'activerecord-5.2' do
4
+ gem 'activerecord', '~> 5.2.0'
5
+ group :development, :test do
6
+ gem 'sqlite3', '~> 1.3.0'
7
+ end
8
+ end
9
+
10
+ appraise 'activerecord-6.0' do
11
+ gem 'activerecord', '~> 6.0.0'
12
+ group :development, :test do
13
+ gem 'sqlite3', '~> 1.6.0'
14
+ end
3
15
  end
4
16
 
5
- appraise 'activerecord-4.1' do
6
- gem 'activerecord', '~> 4.1.0'
17
+ appraise 'activerecord-6.1' do
18
+ gem 'activerecord', '~> 6.1.0'
19
+ group :development, :test do
20
+ gem 'sqlite3', '~> 1.6.0'
21
+ end
7
22
  end
8
23
 
9
- appraise 'activerecord-4.2' do
10
- gem 'activerecord', '~> 4.2.0'
24
+ appraise 'activerecord-7.0' do
25
+ gem 'activerecord', '~> 7.0.0'
26
+ group :development, :test do
27
+ gem 'sqlite3', '~> 1.6.0'
28
+ end
29
+ end
30
+
31
+ appraise 'jruby-activerecord-7.0' do
32
+ gem 'activerecord', '~> 7.0.0'
33
+ group :development, :test do
34
+ gem 'activerecord-jdbc-adapter', '~> 70.1'
35
+ gem 'activerecord-jdbcsqlite3-adapter', '~> 70.1'
36
+ end
11
37
  end
12
38
 
13
39
  appraise 'activerecord-head' do
14
- git 'git://github.com/rails/arel.git' do
15
- gem 'arel'
40
+ git 'https://github.com/rails/rails.git', branch: 'main' do
41
+ gem 'activerecord'
42
+ end
43
+ group :development, :test do
44
+ gem 'sqlite3', '~> 1.6.0'
16
45
  end
17
- git 'git://github.com/rails/rails.git' do
46
+ end
47
+
48
+ appraise 'jruby-activerecord-head' do
49
+ git 'https://github.com/rails/rails.git', branch: 'main' do
18
50
  gem 'activerecord'
19
51
  end
52
+ group :development, :test do
53
+ git 'https://github.com/jruby/activerecord-jdbc-adapter' do
54
+ gem 'activerecord-jdbc-adapter'
55
+ gem 'activerecord-jdbcsqlite3-adapter',
56
+ glob: 'activerecord-jdbcsqlite3-adapter/activerecord-jdbcsqlite3-adapter.gemspec'
57
+ end
58
+ end
20
59
  end
data/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ ### 3.3.0
2
+
3
+ * Move test pipelines from Travis to Github Actions.
4
+ * `include_field` and `exclude_field` configuration options have been removed.
5
+ These had been marked as deprecated in version 2 and replaced by
6
+ `include_association` and `exclude_association`.
7
+ * Official support dropped for Rails 5.1 and earlier. Test pipelines now run
8
+ for Rails 5.2 up to 7.0 as well as the current development head.
9
+ * Official support dropped for Ruby 2.4 and earlier. Test pipelines now run for
10
+ Ruby 2.5 up to 3.2 as well as the current development head.
11
+ * Ambiguous 'BSD' license replaced with 'BSD 2-Claus "Simplified" License'.
12
+ * Fix copy-and-paste mistake in documenation. Thanks @budu.
13
+ * Use lazy load hooks to extend ActiveRecord::Base. This is to ensure
14
+ compatibility with Factory Bot Rails 6.4.0. Thanks @tagliala.
data/Gemfile CHANGED
@@ -1,12 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
  gemspec
3
5
 
4
6
  group :development, :test do
5
7
  gem 'rake'
6
- gem 'coveralls', require: false
8
+ gem 'simplecov', '~> 0.21.2'
9
+ gem 'simplecov-lcov', '~> 0.8.0'
7
10
  end
8
11
 
9
12
  group :local_development do
10
- gem 'pry'
11
13
  gem 'appraisal'
14
+ gem 'pry'
12
15
  end
data/LICENSE.md ADDED
@@ -0,0 +1,11 @@
1
+ [The 2-Clause BSD License](http://www.opensource.org/licenses/bsd-license.php)
2
+
3
+ Copyright (c) 2012, Vaughn Draughon
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Easy cloning of active_record objects including associations and several operations under associations and attributes.
4
4
 
5
- [![Code Climate](https://codeclimate.com/github/rocksolidwebdesign/amoeba/badges/gpa.svg)](https://codeclimate.com/github/rocksolidwebdesign/amoeba)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/d4809ae57ca999fff022/maintainability)](https://codeclimate.com/github/amoeba-rb/amoeba/maintainability)
6
6
  [![Gem Version](https://badge.fury.io/rb/amoeba.svg)](http://badge.fury.io/rb/amoeba)
7
7
  [![Build Status](https://travis-ci.org/amoeba-rb/amoeba.svg?branch=master)](https://travis-ci.org/amoeba-rb/amoeba)
8
8
 
@@ -16,7 +16,7 @@ This gem is named "Amoeba" because amoebas are (small life forms that are) good
16
16
 
17
17
  An ActiveRecord extension gem to allow the duplication of associated child record objects when duplicating an active record model.
18
18
 
19
- Rails 3.2, 4.x compatible.
19
+ Rails 5.2, 6.0, 6.1 compatible. For Rails 4.2 to 5.1 use version 3.x.
20
20
 
21
21
  ### Features
22
22
 
@@ -1131,7 +1131,7 @@ end
1131
1131
 
1132
1132
  #### append
1133
1133
 
1134
- Append some text to a field. This only works for string fields. Accepts a hash of fields to prepend. The keys are the field names and the values are the prefix strings. An example would be to add " (copied version)" to your description field. Don't forget to add a leading space if you want it. Passing a hash will add each key value pair to the list of append directives. If you wish to empty the list of directives, you may pass the hash inside of an array like this `[{:contents => " (copied version)"}]`.
1134
+ Append some text to a field. This only works for string fields. Accepts a hash of fields to append. The keys are the field names and the values are the prefix strings. An example would be to add " (copied version)" to your description field. Don't forget to add a leading space if you want it. Passing a hash will add each key value pair to the list of append directives. If you wish to empty the list of directives, you may pass the hash inside of an array like this `[{:contents => " (copied version)"}]`.
1135
1135
 
1136
1136
  #### set
1137
1137
 
@@ -1173,17 +1173,3 @@ bundle exec rspec spec
1173
1173
 
1174
1174
  * add ability to cancel further processing from within an override block
1175
1175
  * write some spec for the override method
1176
-
1177
- ## License
1178
-
1179
- [The BSD License](http://www.opensource.org/licenses/bsd-license.php)
1180
-
1181
- Copyright (c) 2012, Vaughn Draughon
1182
- All rights reserved.
1183
-
1184
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1185
-
1186
- - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
1187
- - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
1188
-
1189
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
data/amoeba.gemspec CHANGED
@@ -1,23 +1,24 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $LOAD_PATH.push File.expand_path('../lib', __FILE__)
2
+ # frozen_string_literal: true
3
+
4
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
3
5
  require 'amoeba/version'
4
6
 
5
7
  Gem::Specification.new do |s|
6
8
  s.name = 'amoeba'
7
9
  s.version = Amoeba::VERSION
8
- s.authors = ['Vaughn Draughon']
9
- s.email = 'vaughn@rocksolidwebdesign.com'
10
- s.homepage = 'http://github.com/rocksolidwebdesign/amoeba'
11
- s.license = 'BSD'
12
- s.summary = 'Easy copying of rails models and their child associations. '
13
-
14
- s.description = <<-EOF
15
- 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.
10
+ s.authors = ['Vaughn Draughon', 'Oleksandr Simonov']
11
+ s.email = 'alex@simonov.me'
12
+ s.homepage = 'http://github.com/amoeba-rb/amoeba'
13
+ s.license = 'BSD-2-Clause'
14
+ s.summary = 'Easy copying of rails models and their child associations.'
15
+ s.required_ruby_version = '>= 2.5'
16
16
 
17
- 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
18
- EOF
17
+ s.description = <<~DESCRIPTION
18
+ 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.
19
19
 
20
- s.rubyforge_project = 'amoeba'
20
+ 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
21
+ DESCRIPTION
21
22
 
22
23
  s.files = `git ls-files`.split("\n")
23
24
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -25,15 +26,17 @@ EOF
25
26
  s.require_paths = ['lib']
26
27
 
27
28
  # specify any dependencies here; for example:
28
- s.add_development_dependency 'bundler', '>= 1.6.0'
29
29
  s.add_development_dependency 'rspec', '>= 3.0.0'
30
+ s.add_development_dependency 'rubocop', '~> 1.16'
31
+ s.add_development_dependency 'rubocop-rake', '~> 0.6'
32
+ s.add_development_dependency 'rubocop-rspec', '~> 2.4'
30
33
 
31
34
  if RUBY_PLATFORM == 'java'
32
- s.add_development_dependency 'activerecord-jdbc-adapter', '~> 1.3.2'
33
- s.add_development_dependency 'activerecord-jdbcsqlite3-adapter', '~> 1.3.2'
35
+ s.add_development_dependency 'activerecord-jdbc-adapter', '~> 70.0'
36
+ s.add_development_dependency 'activerecord-jdbcsqlite3-adapter', '~> 70.0'
34
37
  else
35
- s.add_development_dependency 'sqlite3'
38
+ s.add_development_dependency 'sqlite3', '>= 1.3'
36
39
  end
37
40
 
38
- s.add_dependency 'activerecord', '>= 3.2.6'
41
+ s.add_dependency 'activerecord', '>= 5.2.0'
39
42
  end