shiftable 0.1.0 → 0.4.0

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.
@@ -13,7 +13,7 @@
13
13
  # extend Shiftable::Single.new(
14
14
  # belongs_to: :captain,
15
15
  # has_one: :spaceship,
16
- # preflight_checks: true,
16
+ # precheck: true,
17
17
  # before_shift: ->(shifting:, shift_to:, shift_from:) { shifting.ownership_changes += 1 }
18
18
  # )
19
19
  # end
@@ -21,76 +21,59 @@
21
21
  module Shiftable
22
22
  # Inheriting from Module is a powerful pattern. If you like it checkout the debug_logging gem!
23
23
  class Single < Module
24
- def initialize(belongs_to:, has_one:, method_prefix: nil, preflight_checks: true, before_save: nil)
24
+ def initialize(belongs_to:, has_one:, method_prefix: nil, precheck: true, before_shift: nil)
25
+ # Ruby's Module initializer doesn't take any arguments
25
26
  super()
26
- raise ArgumentError, "belongs_to must be a symbol" unless belongs_to.is_a?(Symbol)
27
- raise ArgumentError, "has_one must be a symbol" unless has_one.is_a?(Symbol)
28
27
 
29
- # For the following, imagine you are a Spaceship Captain, the Spaceship belongs_to you, and it has only one Captain.
30
- # But you have to sell it to your nemesis!
31
- #
32
- # The name of the belongs_to association, defined on the shifting model, e.g. Spaceship
33
- # Normally a camel-cased, symbolized, version of the class name.
34
- # In the case where Spaceship belongs_to: :captain, this is :captain.
35
- @belongs_to = belongs_to
36
-
37
- # The name of the has_one association, defined on the shift_to/shift_from model, e.g. Captain.
38
- # Normally a camel-cased, symbolized, version of the class name.
39
- # In the case where Captain has_one: :spaceship, this is :spaceship.
40
- @has_one = has_one
41
-
42
- @method_prefix = method_prefix
43
-
44
- # Do not move record if a record already exists (we are shifting a "has_one" association, after all)
45
- @preflight_checks = preflight_checks
46
-
47
- # will prevent the save if it returns false
48
- # allows for any custom logic to be run, such as setting shift_from attributes, prior to the shift is saved.
49
- @before_save = before_save
28
+ @signature = ModSignature.new(
29
+ # For the following, imagine you are a Spaceship Captain, the Spaceship belongs_to you, and it has only one Captain.
30
+ # But you have to sell it to your nemesis!
31
+ associations: {
32
+ # The name of the belongs_to association, defined on the shifting model, e.g. Spaceship
33
+ # Normally a camel-cased, symbolized, version of the class name.
34
+ # In the case where Spaceship belongs_to: :captain, this is :captain.
35
+ belongs_to: belongs_to.to_s.to_sym,
36
+ # The name of the has_one association, defined on the shift_to/shift_from model, e.g. Captain.
37
+ # Normally a camel-cased, symbolized, version of the class name.
38
+ # In the case where Captain has_one: :spaceship, this is :spaceship.
39
+ has_one: has_one.to_s.to_sym
40
+ },
41
+ options: {
42
+ # Do not move record if a record already exists (we are shifting a "has_one" association, after all)
43
+ precheck: precheck,
44
+ method_prefix: method_prefix,
45
+ # will prevent the save if it returns false
46
+ # allows for any custom logic to be run, such as setting attributes, prior to the shift (save).
47
+ before_shift: before_shift
48
+ },
49
+ type: :sg
50
+ )
50
51
  end
51
52
 
53
+ # NOTE: Possible difference in how inheritance works when using extend vs include
54
+ # with Shiftable::Single.new
52
55
  def extended(base)
53
- shift_single_modulizer = ShiftSingleModulizer.to_mod(@belongs_to, @has_one, @method_prefix, @preflight_checks,
54
- @before_save)
56
+ shift_single_modulizer = ShiftSingleModulizer.to_mod(@signature.add_base(base))
55
57
  base.singleton_class.send(:prepend, shift_single_modulizer)
56
58
  end
57
59
 
60
+ # NOTE: Possible difference in how inheritance works when using extend vs include
61
+ # with Shiftable::Single.new
58
62
  def included(base)
59
- shift_single_modulizer = ShiftSingleModulizer.to_mod(@belongs_to, @has_one, @method_prefix, @preflight_checks,
60
- @before_save)
63
+ shift_single_modulizer = ShiftSingleModulizer.to_mod(@signature.add_base(base))
61
64
  base.send(:prepend, shift_single_modulizer)
62
65
  end
63
66
 
64
67
  # Creates anonymous Ruby Modules, containing dynamically built methods
65
68
  module ShiftSingleModulizer
66
- def to_mod(belongs_to, has_one, mepr, preflight_checks, before_save)
69
+ def to_mod(signature)
70
+ prefix = signature.method_prefix
67
71
  Module.new do
68
- define_method(:"#{mepr}shift_column") do
69
- reflection = reflect_on_association(belongs_to).klass.reflect_on_association(has_one)
70
- reflection.foreign_key
71
- end
72
- define_method(:"#{mepr}shift_find") do |id|
73
- return nil unless id
74
-
75
- find_by(send("#{mepr}shift_column") => id)
72
+ define_method(:"#{prefix}shift_column") do
73
+ signature.shift_column
76
74
  end
77
- define_method(:"#{mepr}shift_safe_find") do |shift_to:, shift_from:|
78
- return false if shift_from&.id.nil?
79
- return false if shift_to&.id.nil?
80
-
81
- if preflight_checks
82
- already_exists = shift_to.send(has_one)
83
- return false if already_exists
84
- end
85
-
86
- send("#{mepr}shift_find", shift_from.id)
87
- end
88
- define_method(:"#{mepr}shift_single") do |shift_to:, shift_from:|
89
- shifting = send("#{mepr}shift_safe_find", shift_to: shift_to, shift_from: shift_from)
90
- return false unless shifting
91
-
92
- shifting.send("#{send("#{mepr}shift_column")}=", shift_to.id)
93
- shifting.save if before_save.nil? || before_save.call(shifting: shifting, shift_to: shift_to, shift_from: shift_from)
75
+ define_method(:"#{prefix}shift_single") do |shift_to:, shift_from:|
76
+ signature.shift_data!(shift_to: shift_to, shift_from: shift_from)
94
77
  end
95
78
  end
96
79
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shiftable
4
- VERSION = "0.1.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/shiftable.rb CHANGED
@@ -1,8 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "shiftable/version"
4
- require_relative "shiftable/single"
4
+ require_relative "shiftable/shifting"
5
+ require_relative "shiftable/shifting_record"
6
+ require_relative "shiftable/shifting_relation"
7
+ require_relative "shiftable/mod_signature"
5
8
  require_relative "shiftable/collection"
9
+ require_relative "shiftable/single"
6
10
 
7
11
  module Shiftable
8
12
  class Error < StandardError; end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shiftable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-23 00:00:00.000000000 Z
11
+ date: 2021-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,112 +16,112 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '11.1'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '11.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: database_cleaner-active_record
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '2.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: factory_bot
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '6.2'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '6.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: faker
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '2.19'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '2.19'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '13'
89
+ version: '13.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '13'
96
+ version: '13.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '3'
103
+ version: '3.10'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '3'
110
+ version: '3.10'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec-block_is_expected
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: '1.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: '1.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rubocop
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -136,90 +136,174 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '1.2'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop-faker
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '1.1'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '1.1'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: rubocop-md
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
- - - ">="
157
+ - - "~>"
144
158
  - !ruby/object:Gem::Version
145
- version: '0'
159
+ version: '1.0'
146
160
  type: :development
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
- - - ">="
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop-minitest
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.15'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.15'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop-packaging
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '0.5'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
151
193
  - !ruby/object:Gem::Version
152
- version: '0'
194
+ version: '0.5'
153
195
  - !ruby/object:Gem::Dependency
154
196
  name: rubocop-performance
155
197
  requirement: !ruby/object:Gem::Requirement
156
198
  requirements:
157
- - - ">="
199
+ - - "~>"
158
200
  - !ruby/object:Gem::Version
159
- version: '0'
201
+ version: '1.11'
160
202
  type: :development
161
203
  prerelease: false
162
204
  version_requirements: !ruby/object:Gem::Requirement
163
205
  requirements:
164
- - - ">="
206
+ - - "~>"
165
207
  - !ruby/object:Gem::Version
166
- version: '0'
208
+ version: '1.11'
167
209
  - !ruby/object:Gem::Dependency
168
210
  name: rubocop-rake
169
211
  requirement: !ruby/object:Gem::Requirement
170
212
  requirements:
171
- - - ">="
213
+ - - "~>"
172
214
  - !ruby/object:Gem::Version
173
- version: '0'
215
+ version: '0.6'
174
216
  type: :development
175
217
  prerelease: false
176
218
  version_requirements: !ruby/object:Gem::Requirement
177
219
  requirements:
178
- - - ">="
220
+ - - "~>"
179
221
  - !ruby/object:Gem::Version
180
- version: '0'
222
+ version: '0.6'
181
223
  - !ruby/object:Gem::Dependency
182
224
  name: rubocop-rspec
183
225
  requirement: !ruby/object:Gem::Requirement
184
226
  requirements:
185
227
  - - "~>"
186
228
  - !ruby/object:Gem::Version
187
- version: '2.0'
229
+ version: '2.5'
188
230
  type: :development
189
231
  prerelease: false
190
232
  version_requirements: !ruby/object:Gem::Requirement
191
233
  requirements:
192
234
  - - "~>"
193
235
  - !ruby/object:Gem::Version
194
- version: '2.0'
236
+ version: '2.5'
237
+ - !ruby/object:Gem::Dependency
238
+ name: rubocop-rspec-focused
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - "~>"
242
+ - !ruby/object:Gem::Version
243
+ version: '1.0'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - "~>"
249
+ - !ruby/object:Gem::Version
250
+ version: '1.0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: rubocop-thread_safety
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - "~>"
256
+ - !ruby/object:Gem::Version
257
+ version: '0.4'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - "~>"
263
+ - !ruby/object:Gem::Version
264
+ version: '0.4'
195
265
  - !ruby/object:Gem::Dependency
196
266
  name: simplecov
197
267
  requirement: !ruby/object:Gem::Requirement
198
268
  requirements:
199
- - - ">="
269
+ - - "~>"
200
270
  - !ruby/object:Gem::Version
201
- version: '0'
271
+ version: '0.21'
202
272
  type: :development
203
273
  prerelease: false
204
274
  version_requirements: !ruby/object:Gem::Requirement
205
275
  requirements:
206
- - - ">="
276
+ - - "~>"
207
277
  - !ruby/object:Gem::Version
208
- version: '0'
278
+ version: '0.21'
279
+ - !ruby/object:Gem::Dependency
280
+ name: simplecov-cobertura
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - "~>"
284
+ - !ruby/object:Gem::Version
285
+ version: '1.4'
286
+ type: :development
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - "~>"
291
+ - !ruby/object:Gem::Version
292
+ version: '1.4'
209
293
  - !ruby/object:Gem::Dependency
210
294
  name: sqlite3
211
295
  requirement: !ruby/object:Gem::Requirement
212
296
  requirements:
213
- - - ">="
297
+ - - "~>"
214
298
  - !ruby/object:Gem::Version
215
- version: '0'
299
+ version: '1'
216
300
  type: :development
217
301
  prerelease: false
218
302
  version_requirements: !ruby/object:Gem::Requirement
219
303
  requirements:
220
- - - ">="
304
+ - - "~>"
221
305
  - !ruby/object:Gem::Version
222
- version: '0'
306
+ version: '1'
223
307
  - !ruby/object:Gem::Dependency
224
308
  name: yard
225
309
  requirement: !ruby/object:Gem::Requirement
@@ -242,19 +326,16 @@ executables: []
242
326
  extensions: []
243
327
  extra_rdoc_files: []
244
328
  files:
245
- - ".rspec"
246
- - ".rubocop.yml"
247
- - ".rubocop_todo.yml"
248
329
  - CHANGELOG.md
249
330
  - CODE_OF_CONDUCT.md
250
- - Gemfile
251
331
  - LICENSE.txt
252
332
  - README.md
253
- - Rakefile
254
- - bin/console
255
- - bin/setup
256
333
  - lib/shiftable.rb
257
334
  - lib/shiftable/collection.rb
335
+ - lib/shiftable/mod_signature.rb
336
+ - lib/shiftable/shifting.rb
337
+ - lib/shiftable/shifting_record.rb
338
+ - lib/shiftable/shifting_relation.rb
258
339
  - lib/shiftable/single.rb
259
340
  - lib/shiftable/version.rb
260
341
  homepage: https://railsbling.com/tags/shiftable
@@ -272,7 +353,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
272
353
  requirements:
273
354
  - - ">="
274
355
  - !ruby/object:Gem::Version
275
- version: 2.6.0
356
+ version: '2.5'
276
357
  required_rubygems_version: !ruby/object:Gem::Requirement
277
358
  requirements:
278
359
  - - ">="
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,100 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- AllCops:
4
- NewCops: enable
5
- TargetRubyVersion: 2.6
6
-
7
- Gemspec/DateAssignment: # new in 1.10
8
- Enabled: true
9
- Layout/LineEndStringConcatenationIndentation: # new in 1.18
10
- Enabled: true
11
- Layout/SpaceBeforeBrackets: # new in 1.7
12
- Enabled: true
13
- Lint/AmbiguousAssignment: # new in 1.7
14
- Enabled: true
15
- Lint/AmbiguousOperatorPrecedence: # new in 1.21
16
- Enabled: true
17
- Lint/AmbiguousRange: # new in 1.19
18
- Enabled: true
19
- Lint/DeprecatedConstants: # new in 1.8
20
- Enabled: true
21
- Lint/DuplicateBranch: # new in 1.3
22
- Enabled: true
23
- Lint/DuplicateRegexpCharacterClassElement: # new in 1.1
24
- Enabled: true
25
- Lint/EmptyBlock: # new in 1.1
26
- Enabled: true
27
- Lint/EmptyClass: # new in 1.3
28
- Enabled: true
29
- Lint/EmptyInPattern: # new in 1.16
30
- Enabled: true
31
- Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
32
- Enabled: true
33
- Lint/LambdaWithoutLiteralBlock: # new in 1.8
34
- Enabled: true
35
- Lint/NoReturnInBeginEndBlocks: # new in 1.2
36
- Enabled: true
37
- Lint/NumberedParameterAssignment: # new in 1.9
38
- Enabled: true
39
- Lint/OrAssignmentToConstant: # new in 1.9
40
- Enabled: true
41
- Lint/RedundantDirGlobSort: # new in 1.8
42
- Enabled: true
43
- Lint/RequireRelativeSelfPath: # new in 1.22
44
- Enabled: true
45
- Lint/SymbolConversion: # new in 1.9
46
- Enabled: true
47
- Lint/ToEnumArguments: # new in 1.1
48
- Enabled: true
49
- Lint/TripleQuotes: # new in 1.9
50
- Enabled: true
51
- Lint/UnexpectedBlockArity: # new in 1.5
52
- Enabled: true
53
- Lint/UnmodifiedReduceAccumulator: # new in 1.1
54
- Enabled: true
55
- Security/IoMethods: # new in 1.22
56
- Enabled: true
57
- Style/ArgumentsForwarding: # new in 1.1
58
- Enabled: true
59
- Style/CollectionCompact: # new in 1.2
60
- Enabled: true
61
- Style/DocumentDynamicEvalDefinition: # new in 1.1
62
- Enabled: true
63
- Style/EndlessMethod: # new in 1.8
64
- Enabled: true
65
- Style/HashConversion: # new in 1.10
66
- Enabled: true
67
- Style/HashExcept: # new in 1.7
68
- Enabled: true
69
- Style/IfWithBooleanLiteralBranches: # new in 1.9
70
- Enabled: true
71
- Style/InPatternThen: # new in 1.16
72
- Enabled: true
73
- Style/MultilineInPatternThen: # new in 1.16
74
- Enabled: true
75
- Style/NegatedIfElseCondition: # new in 1.2
76
- Enabled: true
77
- Style/NilLambda: # new in 1.3
78
- Enabled: true
79
- Style/NumberedParameters: # new in 1.22
80
- Enabled: true
81
- Style/NumberedParametersLimit: # new in 1.22
82
- Enabled: true
83
- Style/QuotedSymbols: # new in 1.16
84
- Enabled: true
85
- Style/RedundantArgument: # new in 1.4
86
- Enabled: true
87
- Style/RedundantSelfAssignmentBranch: # new in 1.19
88
- Enabled: true
89
- Style/SelectByRegexp: # new in 1.22
90
- Enabled: true
91
- Style/StringChars: # new in 1.12
92
- Enabled: true
93
- Style/StringLiterals:
94
- Enabled: true
95
- EnforcedStyle: double_quotes
96
- Style/StringLiteralsInInterpolation:
97
- Enabled: true
98
- EnforcedStyle: double_quotes
99
- Style/SwapValues: # new in 1.1
100
- Enabled: true
data/.rubocop_todo.yml DELETED
@@ -1,46 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2021-10-23 07:00:27 UTC using RuboCop version 1.22.2.
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: 1
10
- # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
11
- Metrics/AbcSize:
12
- Max: 27
13
-
14
- # Offense count: 7
15
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
16
- # IgnoredMethods: refine
17
- Metrics/BlockLength:
18
- Max: 58
19
-
20
- # Offense count: 1
21
- # Configuration parameters: IgnoredMethods.
22
- Metrics/CyclomaticComplexity:
23
- Max: 11
24
-
25
- # Offense count: 2
26
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
27
- Metrics/MethodLength:
28
- Max: 25
29
-
30
- # Offense count: 1
31
- # Configuration parameters: IgnoredMethods.
32
- Metrics/PerceivedComplexity:
33
- Max: 11
34
-
35
- # Offense count: 2
36
- # Cop supports --auto-correct.
37
- Style/EvalWithLocation:
38
- Exclude:
39
- - 'spec/shiftable/single_spec.rb'
40
-
41
- # Offense count: 2
42
- # Cop supports --auto-correct.
43
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
44
- # URISchemes: http, https
45
- Layout/LineLength:
46
- Max: 130