amoeba 3.3.0 → 3.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29529dad8414b04baff41f8ef9638dc79f118bf259c46ce6769ddb03919d484b
4
- data.tar.gz: 6b3d0507d6c1a6fe325394ccbd620fab75cd73c570ca16275e90bb11234f5c0f
3
+ metadata.gz: b56863bc615e6ae47326269f3bcc16a1803db51af1f94790a064bbc89ccf4aeb
4
+ data.tar.gz: 225866bf1cb1001a4902bbc538bf7d7263edc3fde2317be06ab232d45da5d065
5
5
  SHA512:
6
- metadata.gz: 27bcd19c86d54a1cf5af027aa29ed1e81b79bf21d54459b438789be81999a915950e26311011b38d9b79c0106b8537cf01287f3f89a1974f4b10dfcd56429f7b
7
- data.tar.gz: 86586b2a76dec19a36d3bae63a16cda9301c9659cabb50b0d7b66afe946effd35f7ebe38748ac0f9c398a835f1429d29a5661c94e52187f59db89b1278502cbc
6
+ metadata.gz: b41fb1914a1e2adfcffc2df6ce19d0dba862f593a2d84424e7eeb9c59e5523c06b6e8e6c356f9704b8181759335d55507c363cfdf29dda50b89b114731a89707
7
+ data.tar.gz: 6c8b4671c3f24d856ef2fc762272fd52eea67c31ca9f9ca7d7b15371db41c6aeba661818c0546ed6c59b0dd828ecbd4aab10771630ec9a5be8ececae4c4a75b6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,64 @@
1
+ ### 3.4.1
2
+
3
+ * Update minimum supported Ruby version to 3.2
4
+ * Update minimum supported Rails version to 7.1
5
+ * Tidy up Gemspec file. Various files, such as test files, are no longer bundled with the gem. The gem file is now 21K (unpacked to 128K) compared with 34K (unpacked to 292K) previously. [https://github.com/amoeba-rb/amoeba/pull/136]
6
+ * Fix `regex` raising `NoMethodError` when the field is nil.[https://github.com/amoeba-rb/amoeba/pull/138] Thanks @suryakant-source
7
+
8
+ ### 3.4.0
9
+
10
+ * Update test matrix for current version for Ruby and Rails. Drop support for Rails versions 5.2 and 6.0, and Ruby 2.5, 2.6 and 2.7. [https://github.com/amoeba-rb/amoeba/pull/120 and https://github.com/amoeba-rb/amoeba/pull/124]
11
+ * Notes on contributing. Github Actions for automate tests. [https://github.com/amoeba-rb/amoeba/pull/124]
12
+ * Fix tests for Active Record after 7.1. [https://github.com/amoeba-rb/amoeba/pull/127]
13
+ * Refactor tests. [https://github.com/amoeba-rb/amoeba/pull/130]
14
+ * Allow `nullify` to accept an `:if` condition. `Config#null_fields` is now a Hash of field names to options rather than an Array of field names, for consistency with `includes` and `excludes`; code reading it directly should use `null_fields.keys`. [https://github.com/amoeba-rb/amoeba/pull/134] Thanks @bvicenzo.
15
+
16
+ #### Breaking change
17
+
18
+ Internally the configuration of `null_fields` is now stored as a `Hash` instead of an `Array`. This could cause failures if you access the `config` directly. For example;
19
+
20
+ ```ruby
21
+ # test.rb
22
+ require_relative 'config/environment'
23
+
24
+ class Post < ActiveRecord::Base
25
+ amoeba do
26
+ enable
27
+ nullify :topic_id
28
+ nullify :likes
29
+ end
30
+ end
31
+
32
+ config = Post.amoeba
33
+
34
+ pp config.null_fields
35
+ pp config.null_fields.first
36
+ pp config.null_fields.map(&:to_s)
37
+ pp config.null_fields << :extra
38
+ ```
39
+
40
+ With previous versions of `amoeba` the output of this will be;
41
+
42
+ ```
43
+ [:topic_id, :likes]
44
+ :topic_id
45
+ ["topic_id", "likes"]
46
+ [:topic_id, :likes, :extra]
47
+ ```
48
+
49
+ With the new version of `amoeba` some of these command execute successfully with changed output and the final line fails with an exception;
50
+
51
+ ```
52
+ {topic_id: {}, likes: {}}
53
+ [:topic_id, {}]
54
+ ["[:topic_id, {}]", "[:likes, {}]"]
55
+ test.rb:18:in '<main>': undefined method '<<' for an instance of Hash (NoMethodError)
56
+
57
+ pp config.null_fields << :extra
58
+ ^^
59
+ Did you mean? <
60
+ ```
61
+
1
62
  ### 3.3.0
2
63
 
3
64
  * Move test pipelines from Travis to Github Actions.
data/README.md CHANGED
@@ -6,6 +6,10 @@ Easy cloning of active_record objects including associations and several operati
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
 
9
+ ## Interested in contributing?
10
+
11
+ See [here.](docs/contributing.md)
12
+
9
13
  ## What?
10
14
 
11
15
  The goal was to be able to easily and quickly reproduce ActiveRecord objects including their children, for example copying a blog post maintaining its associated tags or categories.
@@ -336,6 +340,25 @@ This example will copy all of a post's comments. It will also nullify the publis
336
340
 
337
341
  Unlike inclusive and exclusive styles, specifying null fields will not automatically enable amoeba to copy all child records. As with any active record object, the default field value will be used instead of `nil` if a default value exists on the migration.
338
342
 
343
+ A field may also be nullified only under a given condition, by passing the name of a method on the source record to the `:if` option, just like the [conditions](#conditions) available for `include_association` and `exclude_association`:
344
+
345
+ ```ruby
346
+ class Post < ActiveRecord::Base
347
+ belongs_to :topic
348
+
349
+ amoeba do
350
+ nullify :date_published
351
+ nullify :topic_id, if: :popular?
352
+ end
353
+
354
+ def popular?
355
+ likes > 15
356
+ end
357
+ end
358
+ ```
359
+
360
+ Here `date_published` is always nullified, while `topic_id` is only nullified when `popular?` returns a truthy value on the post being copied. The `:if` option accepts a method name only.
361
+
339
362
  #### Set
340
363
 
341
364
  If you wish to just set a field to an arbitrary value on all duplicated objects you may use the `set` directive. For example, if you wanted to copy an object that has some kind of approval process associated with it, you likely may wish to set the new object's state to be open or "in progress" again.
@@ -984,7 +1007,7 @@ After cloning we will get instance of `Child` instead of `ChildPrototype`
984
1007
 
985
1008
  ## Remapping associations
986
1009
 
987
- If you will need to do complex cloning with remapping associations name you can user `remapper`:
1010
+ If you will need to do complex cloning with remapping associations name you can use `remapper`:
988
1011
 
989
1012
  ```ruby
990
1013
  class ObjectPrototype < ActiveRecord::Base
@@ -1125,6 +1148,8 @@ end
1125
1148
 
1126
1149
  Adds a field to the list of non-association based fields which should be set to nil during copy. All fields in this list will be set to `nil` - note that any nullified field will be given its default value if a default value exists on this model's migration. This method may be called multiple times, once per desired field, or you may pass an array of field names. Passing a single symbol will add to the list of null fields. Passing an array will empty the list and replace it with the array you pass.
1127
1150
 
1151
+ Accepts an `:if` option, taking the name of a method that is called on the record being copied. The field is only nullified when that method returns a truthy value, e.g. `nullify :topic_id, if: :popular?`. When an array of field names is given, the condition applies to every field in the array. Declaring the same field again without `:if` clears a condition previously set on it.
1152
+
1128
1153
  #### prepend
1129
1154
 
1130
1155
  Prefix a field with some text. 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 scenario would be to add a string such as "Copy of " to your title field. Don't forget to include extra space to the right if you want it. Passing a hash will add each key value pair to the list of prepend directives. If you wish to empty the list of directives, you may pass the hash inside of an array like this `[{:title => "Copy of "}]`.
@@ -0,0 +1,19 @@
1
+ # Contributing to Amoeba
2
+
3
+ Contributations to this project are welcome. The current needs are;
4
+
5
+ * More structured documentation
6
+ * [Refactoring tests](test_refactor.md)
7
+ * Identifying and prioritising features that could be implemented from the long list of issues
8
+ * Reviewing of pull requests
9
+
10
+ ## Some notes regarding pull requests
11
+
12
+ When making code changes please include unit tests for any new code and ensure that all tests pass for supported versions of Ruby and Active Record. These tests are run automatically.
13
+
14
+ Note that the tests are also run automatically for the current development branches of Ruby and Active Record. It is not necessary for all tests to pass in these cases and they are set up to always report as a success to avoid causing the whole pipeline to appear as failed[^1]. However;
15
+
16
+ * Please try at least for new tests in the PR to pass unless there is an identifiable issue in the development version of either Ruby or Active Record.
17
+ * For any new failures you see please consider raising an issue to have it fixed.
18
+
19
+ [^1]: See [this issue](https://github.com/actions/runner/issues/2347) and [this discussion](https://github.com/orgs/community/discussions/15452) for a long-running discussion on the missing "allow failure" feature in Github Actions.
@@ -0,0 +1,20 @@
1
+ # Test refactor
2
+
3
+ ## Motivation
4
+
5
+ This gem has been unmaintained for some time but is still used. This could
6
+ cause problems if it becomes incompatible with new versions of Active Record.
7
+ Additionally, there are lots of issues that have been raised and there could be
8
+ other features of Active Record that should be supported. However, the tests
9
+ not easy to understand as they generally comprise a large setup of data
10
+ followed by multiple expectations with no indication of their purpose. A better
11
+ structure for the tests would allow for making changes with more confidence.
12
+
13
+ ## Plan
14
+
15
+ All of the tests are currently in `spec/lib/amoeba_spec.rb`. New tests will be
16
+ created to mimic the modules so, for example;
17
+
18
+ * `spec/lib/amoeba/cloner_spec.rb` to test the `Amoeba::Cloner` class.
19
+ * `spec/lib/amoeba/macros/has_many_spec.rb` to test the
20
+ `Amoeba::Macros::HasMany` module.
data/lib/amoeba/cloner.rb CHANGED
@@ -52,7 +52,7 @@ module Amoeba
52
52
  return unless _parent_amoeba.inherit
53
53
  return unless %w[strict relaxed submissive].include?(parenting_style.to_s)
54
54
 
55
- __send__("inherit_#{parenting_style}_parent_settings".to_sym)
55
+ __send__(:"inherit_#{parenting_style}_parent_settings")
56
56
  end
57
57
 
58
58
  def apply_clones
@@ -127,7 +127,9 @@ module Amoeba
127
127
 
128
128
  def process_null_fields
129
129
  # nullify any fields the user has configured
130
- amoeba.null_fields.each do |field_key|
130
+ amoeba.null_fields.each do |field_key, options|
131
+ next if options[:if] && !@old_object.send(options[:if])
132
+
131
133
  @new_object[field_key] = nil
132
134
  end
133
135
  end
@@ -156,6 +158,8 @@ module Amoeba
156
158
  def process_regexes
157
159
  # regex any fields that need changing
158
160
  amoeba.regexes.each do |field, action|
161
+ next if @new_object[field].nil?
162
+
159
163
  @new_object[field].gsub!(action[:replace], action[:with])
160
164
  end
161
165
  end
data/lib/amoeba/config.rb CHANGED
@@ -15,7 +15,7 @@ module Amoeba
15
15
  clones: [],
16
16
  customizations: [],
17
17
  overrides: [],
18
- null_fields: [],
18
+ null_fields: {},
19
19
  coercions: {},
20
20
  prefixes: {},
21
21
  suffixes: {},
@@ -123,8 +123,7 @@ module Amoeba
123
123
  push_value_to_array(value, :known_macros)
124
124
  end
125
125
 
126
- { override: 'overrides', customize: 'customizations',
127
- nullify: 'null_fields' }.each do |method, key|
126
+ { override: 'overrides', customize: 'customizations' }.each do |method, key|
128
127
  class_eval <<-EOS, __FILE__, __LINE__ + 1
129
128
  def #{method}(value = nil) # def override(value = nil)
130
129
  @config[:do_preproc] = true # @config[:do_preproc] = true
@@ -133,6 +132,12 @@ module Amoeba
133
132
  EOS
134
133
  end
135
134
 
135
+ def nullify(value = nil, options = {})
136
+ @config[:do_preproc] = true
137
+ @config[:null_fields] = {} if value.is_a?(::Array)
138
+ push_value_to_hash(Array(value).to_h { |field| [field, options] }, :null_fields)
139
+ end
140
+
136
141
  { set: 'coercions', prepend: 'prefixes',
137
142
  append: 'suffixes', regex: 'regexes' }.each do |method, key|
138
143
  class_eval <<-EOS, __FILE__, __LINE__ + 1
data/lib/amoeba/macros.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  module Amoeba
4
4
  module Macros
5
5
  extend self
6
+
6
7
  def list
7
8
  @list ||= {}
8
9
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Amoeba
4
- VERSION = '3.3.0'
4
+ VERSION = '3.4.1'
5
5
  end
metadata CHANGED
@@ -1,137 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amoeba
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vaughn Draughon
8
8
  - Oleksandr Simonov
9
- autorequire:
9
+ - Joseph Haig
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-30 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rspec
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: 3.0.0
21
- type: :development
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: 3.0.0
28
- - !ruby/object:Gem::Dependency
29
- name: rubocop
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - "~>"
33
- - !ruby/object:Gem::Version
34
- version: '1.16'
35
- type: :development
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - "~>"
40
- - !ruby/object:Gem::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'
70
- - !ruby/object:Gem::Dependency
71
- name: sqlite3
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: '1.3'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ">="
82
- - !ruby/object:Gem::Version
83
- version: '1.3'
84
14
  - !ruby/object:Gem::Dependency
85
15
  name: activerecord
86
16
  requirement: !ruby/object:Gem::Requirement
87
17
  requirements:
88
18
  - - ">="
89
19
  - !ruby/object:Gem::Version
90
- version: 5.2.0
20
+ version: 7.1.0
91
21
  type: :runtime
92
22
  prerelease: false
93
23
  version_requirements: !ruby/object:Gem::Requirement
94
24
  requirements:
95
25
  - - ">="
96
26
  - !ruby/object:Gem::Version
97
- version: 5.2.0
98
- description: |
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.
27
+ version: 7.1.0
28
+ description: 'Duplicate ActiveRecord models and their nested child associations with
29
+ configurable cloning behavior.
100
30
 
101
- 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
102
- email: alex@simonov.me
31
+ '
32
+ email: josephhaig@gmail.com
103
33
  executables: []
104
34
  extensions: []
105
35
  extra_rdoc_files: []
106
36
  files:
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"
116
- - ".gitignore"
117
- - ".rspec"
118
- - ".rubocop.yml"
119
- - ".rubocop_todo.yml"
120
- - Appraisals
121
37
  - CHANGELOG.md
122
- - Gemfile
123
38
  - LICENSE.md
124
39
  - README.md
125
- - Rakefile
126
- - amoeba.gemspec
127
- - defaults.reek
128
- - gemfiles/activerecord_5.2.gemfile
129
- - gemfiles/activerecord_6.0.gemfile
130
- - gemfiles/activerecord_6.1.gemfile
131
- - gemfiles/activerecord_7.0.gemfile
132
- - gemfiles/activerecord_head.gemfile
133
- - gemfiles/jruby_activerecord_7.0.gemfile
134
- - gemfiles/jruby_activerecord_head.gemfile
40
+ - docs/contributing.md
41
+ - docs/test_refactor.md
135
42
  - lib/amoeba.rb
136
43
  - lib/amoeba/class_methods.rb
137
44
  - lib/amoeba/cloner.rb
@@ -143,16 +50,14 @@ files:
143
50
  - lib/amoeba/macros/has_many.rb
144
51
  - lib/amoeba/macros/has_one.rb
145
52
  - lib/amoeba/version.rb
146
- - spec/lib/amoeba_spec.rb
147
- - spec/spec_helper.rb
148
- - spec/support/data.rb
149
- - spec/support/models.rb
150
- - spec/support/schema.rb
151
- homepage: http://github.com/amoeba-rb/amoeba
53
+ homepage: https://github.com/amoeba-rb/amoeba
152
54
  licenses:
153
55
  - BSD-2-Clause
154
- metadata: {}
155
- post_install_message:
56
+ metadata:
57
+ homepage_uri: https://github.com/amoeba-rb/amoeba
58
+ source_code_uri: https://github.com/amoeba-rb/amoeba
59
+ changelog_uri: https://github.com/amoeba-rb/amoeba/CHANGELOG.md
60
+ bug_tracker_uri: https://github.com/amoeba-rb/amoeba/issues
156
61
  rdoc_options: []
157
62
  require_paths:
158
63
  - lib
@@ -160,15 +65,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
65
  requirements:
161
66
  - - ">="
162
67
  - !ruby/object:Gem::Version
163
- version: '2.5'
68
+ version: '3.2'
164
69
  required_rubygems_version: !ruby/object:Gem::Requirement
165
70
  requirements:
166
71
  - - ">="
167
72
  - !ruby/object:Gem::Version
168
73
  version: '0'
169
74
  requirements: []
170
- rubygems_version: 3.4.10
171
- signing_key:
75
+ rubygems_version: 4.0.16
172
76
  specification_version: 4
173
- summary: Easy copying of rails models and their child associations.
77
+ summary: Easy copying of ActiveRecord models and their child associations.
174
78
  test_files: []
data/.cane DELETED
@@ -1,4 +0,0 @@
1
- --no-doc
2
- --style-measure 99
3
- --abc-max 5
4
- --style-exclude spec/**/*
@@ -1,27 +0,0 @@
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 }}
@@ -1,30 +0,0 @@
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 }}
@@ -1,30 +0,0 @@
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 }}
@@ -1,30 +0,0 @@
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 }}
@@ -1,34 +0,0 @@
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 }}
@@ -1,34 +0,0 @@
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 }}
@@ -1,34 +0,0 @@
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 }}