junk_drawer 1.8.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3530e5bd07d747b2cd7d34ffe7b48df7833f031a1f5dc43ee9c803b1422bff7d
4
- data.tar.gz: 9abd08c0735f544d9e065b62df069a854e4e3411b3c3252b906c5a1682fdcece
3
+ metadata.gz: 10b296732de43157b6cdde42030553a98da2223a7c31d035e4a89b82db768df2
4
+ data.tar.gz: febc4381da50ed66564deecd40adf47444a8d7e7ccee07f212b8ed649a14ebaf
5
5
  SHA512:
6
- metadata.gz: 349d50e5b1fe6c431fedb262a1736e922110ec414388b7efc43f73d348e0788be2f9535ffede6482eb25f2838b5aaedd7cc419da2874623df8fc71cd345b7737
7
- data.tar.gz: f8621c8eac83068c5e6d7efc832501cac8e2bb1d06ac7d3efdf729313400e83da01863c3a38e3a6cbd8e4ba9f8bfda24f7cf76e7e7fb57357ed8d59a1f3f6d57
6
+ metadata.gz: eedb847db634ecd05167f8861991941be34f7d2ddc5cfad041f0cd13c60a8894371b84556ae8d8770e3ebaf63055e5c0a19631ae146480d2baff6f0788aadcf6
7
+ data.tar.gz: a217f282c5f5083d4ffeea568431b93680a319564d71d0b17e0861ab37a19fb30b6466c5cdbad3a7f4cbc7351713cc6ba92b1eac3d94fe363d9a3d417967d273
@@ -9,11 +9,14 @@ on:
9
9
  jobs:
10
10
  test:
11
11
  runs-on: ubuntu-latest
12
+ env:
13
+ BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gems
12
14
  strategy:
13
15
  matrix:
14
- ruby: [2.4, 2.5, 2.6, 2.7]
15
- postgres: [10, 11, 12, 13, 14]
16
- name: Ruby ${{ matrix.ruby }} x Postgres ${{ matrix.postgres }}
16
+ ruby: ['3.0', '3.1', '3.2']
17
+ postgres: [12, 13, 14]
18
+ rails: ['7.0']
19
+ name: Ruby ${{ matrix.ruby }} x Postgres ${{ matrix.postgres }} x Rails ${{ matrix.rails }}
17
20
 
18
21
  services:
19
22
  postgres:
data/.rubocop.yml CHANGED
@@ -1,9 +1,18 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
1
3
  require: rubocop-rspec
2
4
 
3
5
  AllCops:
4
6
  DefaultFormatter: fuubar
5
7
  TargetRubyVersion: 2.3
6
8
  DisplayCopNames: true
9
+ NewCops: enable
10
+
11
+ Layout/AccessModifierIndentation:
12
+ EnforcedStyle: outdent
13
+
14
+ Layout/EmptyLinesAroundClassBody:
15
+ EnforcedStyle: empty_lines
7
16
 
8
17
  Lint/AmbiguousBlockAssociation:
9
18
  Exclude:
@@ -13,27 +22,34 @@ Metrics/AbcSize:
13
22
  Exclude:
14
23
  - lib/junk_drawer/rails/bulk_updatable.rb
15
24
 
16
- Metrics/MethodLength:
17
- Exclude:
18
- - lib/junk_drawer/rails/bulk_updatable.rb
19
-
20
25
  Metrics/BlockLength:
21
26
  Exclude:
22
27
  - junk_drawer.gemspec
23
28
  - spec/**/*
24
29
 
30
+ Metrics/MethodLength:
31
+ Exclude:
32
+ - lib/junk_drawer/rails/bulk_updatable.rb
33
+
34
+ Naming/VariableNumber:
35
+ EnforcedStyle: snake_case
36
+
37
+ RSpec/AnyInstance: { Enabled: false } # broken, re-enable after upgrade
38
+ RSpec/DescribeClass: { Enabled: false } # broken, re-enable after upgrade
39
+
25
40
  RSpec/ExampleLength:
26
41
  Enabled: false
27
42
 
43
+ RSpec/FilePath:
44
+ IgnoreMethods: true
45
+ Exclude:
46
+ - spec/junk_drawer/rails/bulk_updatable_spec.rb
47
+
28
48
  RSpec/MultipleExpectations:
29
49
  Enabled: false
30
50
 
31
- # default disabled rules
32
- Style/AutoResourceCleanup:
33
- Enabled: true
34
-
51
+ # non-conventional rules
35
52
  Style/CollectionMethods:
36
- Enabled: true
37
53
  PreferredMethods:
38
54
  collect: 'map'
39
55
  collect!: 'map!'
@@ -41,62 +57,14 @@ Style/CollectionMethods:
41
57
  find: 'detect'
42
58
  find_all: 'select'
43
59
 
44
- Style/FirstArrayElementLineBreak:
45
- Enabled: true
46
-
47
- Style/FirstHashElementLineBreak:
48
- Enabled: true
49
-
50
- Style/FirstMethodArgumentLineBreak:
51
- Enabled: true
52
-
53
- Style/FirstMethodParameterLineBreak:
54
- Enabled: true
55
-
56
- Style/MultilineArrayBraceLayout:
57
- Enabled: true
58
-
59
- Style/MultilineHashBraceLayout:
60
- Enabled: true
61
-
62
- Style/MultilineMethodCallBraceLayout:
63
- Enabled: true
64
-
65
- Style/MultilineMethodDefinitionBraceLayout:
66
- Enabled: true
67
-
68
- Style/OptionHash:
69
- Enabled: true
70
-
71
- Style/Send:
72
- Enabled: true
73
-
74
- RSpec/FilePath:
75
- IgnoreMethods: true
76
- Exclude:
77
- - spec/junk_drawer/rails/bulk_updatable_spec.rb
78
-
79
- RSpec/VerifiedDoubles:
80
- Enabled: true
81
-
82
- # non-conventional rules
83
60
  Style/LambdaCall:
84
61
  EnforcedStyle: braces
85
62
 
86
- Style/EmptyLinesAroundClassBody:
87
- EnforcedStyle: empty_lines
88
-
89
- Style/AccessModifierIndentation:
90
- EnforcedStyle: outdent
91
-
92
- Style/TrailingCommaInLiteral:
93
- EnforcedStyleForMultiline: comma
94
-
95
63
  Style/TrailingCommaInArguments:
96
64
  EnforcedStyleForMultiline: consistent_comma
97
65
 
98
- Style/TrailingCommaInArguments:
99
- EnforcedStyleForMultiline: consistent_comma
66
+ Style/TrailingCommaInArrayLiteral:
67
+ EnforcedStyleForMultiline: comma
100
68
 
101
- Style/VariableNumber:
102
- EnforcedStyle: snake_case
69
+ Style/TrailingCommaInHashLiteral:
70
+ EnforcedStyleForMultiline: comma
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,111 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 400`
3
+ # on 2023-04-08 01:57:20 UTC using RuboCop version 1.49.0.
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
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: Severity, Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/RequireMFA:
14
+ Exclude:
15
+ - 'junk_drawer.gemspec'
16
+
17
+ # Offense count: 1
18
+ # Configuration parameters: Severity, Include.
19
+ # Include: **/*.gemspec
20
+ Gemspec/RequiredRubyVersion:
21
+ Exclude:
22
+ - 'junk_drawer.gemspec'
23
+
24
+ # Offense count: 2
25
+ # This cop supports safe autocorrection (--autocorrect).
26
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
27
+ # SupportedStyles: aligned, indented
28
+ Layout/LineEndStringConcatenationIndentation:
29
+ Exclude:
30
+ - 'lib/junk_drawer/callable.rb'
31
+ - 'lib/junk_drawer/rails/bulk_updatable.rb'
32
+
33
+ # Offense count: 4
34
+ # This cop supports safe autocorrection (--autocorrect).
35
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
36
+ # SupportedStyles: aligned, indented, indented_relative_to_receiver
37
+ Layout/MultilineMethodCallIndentation:
38
+ Exclude:
39
+ - 'spec/junk_drawer/rails/bulk_updatable_spec.rb'
40
+
41
+ # Offense count: 14
42
+ # Configuration parameters: AllowedMethods.
43
+ # AllowedMethods: enums
44
+ Lint/ConstantDefinitionInBlock:
45
+ Exclude:
46
+ - 'spec/junk_drawer/callable_spec.rb'
47
+ - 'spec/junk_drawer/notifier/honeybadger_strategy_spec.rb'
48
+ - 'spec/junk_drawer/notifier/null_strategy_spec.rb'
49
+ - 'spec/junk_drawer/rails/bulk_updatable_spec.rb'
50
+
51
+ # Offense count: 1
52
+ # Configuration parameters: MaximumRangeSize.
53
+ Lint/MissingCopEnableDirective:
54
+ Exclude:
55
+ - 'spec/junk_drawer/callable_spec.rb'
56
+
57
+ # Offense count: 1
58
+ Lint/MissingSuper:
59
+ Exclude:
60
+ - 'lib/junk_drawer/callable.rb'
61
+
62
+ # Offense count: 1
63
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
64
+ Metrics/CyclomaticComplexity:
65
+ Exclude:
66
+ - 'lib/junk_drawer/rails/bulk_updatable.rb'
67
+
68
+ # Offense count: 1
69
+ # This cop supports safe autocorrection (--autocorrect).
70
+ # Configuration parameters: EnforcedStyle.
71
+ # SupportedStyles: be, be_nil
72
+ RSpec/BeNil:
73
+ Exclude:
74
+ - 'spec/junk_drawer_spec.rb'
75
+
76
+ # Offense count: 5
77
+ # This cop supports unsafe autocorrection (--autocorrect-all).
78
+ # Configuration parameters: SkipBlocks, EnforcedStyle.
79
+ # SupportedStyles: described_class, explicit
80
+ RSpec/DescribedClass:
81
+ Exclude:
82
+ - 'spec/junk_drawer/notifier_spec.rb'
83
+ - 'spec/junk_drawer/rails/bulk_updatable_spec.rb'
84
+
85
+ # Offense count: 14
86
+ RSpec/LeakyConstantDeclaration:
87
+ Exclude:
88
+ - 'spec/junk_drawer/callable_spec.rb'
89
+ - 'spec/junk_drawer/notifier/honeybadger_strategy_spec.rb'
90
+ - 'spec/junk_drawer/notifier/null_strategy_spec.rb'
91
+ - 'spec/junk_drawer/rails/bulk_updatable_spec.rb'
92
+
93
+ # Offense count: 1
94
+ RSpec/StubbedMock:
95
+ Exclude:
96
+ - 'spec/junk_drawer/callable_spec.rb'
97
+
98
+ # Offense count: 2
99
+ # This cop supports safe autocorrection (--autocorrect).
100
+ # Configuration parameters: EnforcedStyle.
101
+ # SupportedStyles: braces, no_braces
102
+ Style/HashAsLastArrayItem:
103
+ Exclude:
104
+ - 'spec/junk_drawer/notifier/honeybadger_strategy_spec.rb'
105
+ - 'spec/junk_drawer/rails/bulk_updatable_spec.rb'
106
+
107
+ # Offense count: 2
108
+ # This cop supports safe autocorrection (--autocorrect).
109
+ Style/RedundantConstantBase:
110
+ Exclude:
111
+ - 'spec/junk_drawer/rails/bulk_updatable_spec.rb'
data/Gemfile CHANGED
@@ -3,8 +3,3 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
-
7
- gem 'activerecord', '~> 5.2.0'
8
- gem 'activesupport', '~> 5.2.0'
9
- gem 'hstore_accessor', '~> 1.1.1'
10
- gem 'jsonb_accessor', '~> 1.3.6'
data/README.md CHANGED
@@ -255,7 +255,7 @@ In order to run tests against different Rails versions, you can use
255
255
  `BUNDLE_GEMFILE`:
256
256
 
257
257
  ```sh
258
- $ BUNDLE_GEMFILE=gemfiles/rails_4.2.gems rake spec
258
+ $ BUNDLE_GEMFILE=gemfiles/rails_5.0.gems rake spec
259
259
  ```
260
260
 
261
261
  ## Contributing
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec path: '../'
6
+
7
+ gem 'activerecord', '~> 7.0.0'
8
+ gem 'activesupport', '~> 7.0.0'
9
+ gem 'jsonb_accessor', '~> 1.3'
10
+ gem 'pg', '~> 1.4'
data/junk_drawer.gemspec CHANGED
@@ -21,17 +21,15 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.required_ruby_version = '>= 2.1'
23
23
 
24
- spec.add_runtime_dependency 'ruby2_keywords', '~> 0.0.2'
25
24
  spec.add_development_dependency 'guard', '~> 2.14'
26
25
  spec.add_development_dependency 'guard-rspec', '~> 4.7'
27
26
  spec.add_development_dependency 'guard-rubocop', '~> 1.2'
28
- spec.add_development_dependency 'pg', '~> 0.20'
29
27
  spec.add_development_dependency 'pry', '~> 0.10'
30
- spec.add_development_dependency 'pry-byebug', '~> 3.6.0'
31
- spec.add_development_dependency 'rake', '~> 12.0'
28
+ spec.add_development_dependency 'pry-byebug', '~> 3.10.1'
29
+ spec.add_development_dependency 'rake', '~> 13.0'
32
30
  spec.add_development_dependency 'rspec', '~> 3.0'
33
- spec.add_development_dependency 'rubocop', '~> 0.48.1'
34
- spec.add_development_dependency 'rubocop-rspec', '~> 1.15.0'
31
+ spec.add_development_dependency 'rubocop', '1.49.0'
32
+ spec.add_development_dependency 'rubocop-rspec', '2.19.0'
35
33
  spec.add_development_dependency 'simplecov', '~> 0.14'
36
34
  spec.add_development_dependency 'with_model', '~> 2.0'
37
35
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'ruby2_keywords'
4
-
5
3
  module JunkDrawer
6
4
  # error to be thrown by Callable
7
5
  class CallableError < StandardError
@@ -21,8 +19,8 @@ module JunkDrawer
21
19
  # an instance. It also causes an error to be raised if a public instance
22
20
  # method is defined with a name other than `call`
23
21
  module ClassMethods
24
- ruby2_keywords def call(*args, &block)
25
- new.(*args, &block)
22
+ def call(*args, **kwargs, &block)
23
+ new.(*args, **kwargs, &block)
26
24
  end
27
25
 
28
26
  def to_proc
@@ -27,8 +27,8 @@ module JunkDrawer
27
27
  null: NullStrategy,
28
28
  }.freeze
29
29
 
30
- def call(*args)
31
- self.class.strategy.(*args)
30
+ def call(*args, **kwargs)
31
+ self.class.strategy.(*args, **kwargs)
32
32
  end
33
33
 
34
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JunkDrawer
4
- VERSION = '1.8.0'
4
+ VERSION = '2.0.0'
5
5
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junk_drawer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Fletcher
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-28 00:00:00.000000000 Z
11
+ date: 2023-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: ruby2_keywords
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 0.0.2
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 0.0.2
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: guard
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -66,20 +52,6 @@ dependencies:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
54
  version: '1.2'
69
- - !ruby/object:Gem::Dependency
70
- name: pg
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '0.20'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '0.20'
83
55
  - !ruby/object:Gem::Dependency
84
56
  name: pry
85
57
  requirement: !ruby/object:Gem::Requirement
@@ -100,28 +72,28 @@ dependencies:
100
72
  requirements:
101
73
  - - "~>"
102
74
  - !ruby/object:Gem::Version
103
- version: 3.6.0
75
+ version: 3.10.1
104
76
  type: :development
105
77
  prerelease: false
106
78
  version_requirements: !ruby/object:Gem::Requirement
107
79
  requirements:
108
80
  - - "~>"
109
81
  - !ruby/object:Gem::Version
110
- version: 3.6.0
82
+ version: 3.10.1
111
83
  - !ruby/object:Gem::Dependency
112
84
  name: rake
113
85
  requirement: !ruby/object:Gem::Requirement
114
86
  requirements:
115
87
  - - "~>"
116
88
  - !ruby/object:Gem::Version
117
- version: '12.0'
89
+ version: '13.0'
118
90
  type: :development
119
91
  prerelease: false
120
92
  version_requirements: !ruby/object:Gem::Requirement
121
93
  requirements:
122
94
  - - "~>"
123
95
  - !ruby/object:Gem::Version
124
- version: '12.0'
96
+ version: '13.0'
125
97
  - !ruby/object:Gem::Dependency
126
98
  name: rspec
127
99
  requirement: !ruby/object:Gem::Requirement
@@ -140,30 +112,30 @@ dependencies:
140
112
  name: rubocop
141
113
  requirement: !ruby/object:Gem::Requirement
142
114
  requirements:
143
- - - "~>"
115
+ - - '='
144
116
  - !ruby/object:Gem::Version
145
- version: 0.48.1
117
+ version: 1.49.0
146
118
  type: :development
147
119
  prerelease: false
148
120
  version_requirements: !ruby/object:Gem::Requirement
149
121
  requirements:
150
- - - "~>"
122
+ - - '='
151
123
  - !ruby/object:Gem::Version
152
- version: 0.48.1
124
+ version: 1.49.0
153
125
  - !ruby/object:Gem::Dependency
154
126
  name: rubocop-rspec
155
127
  requirement: !ruby/object:Gem::Requirement
156
128
  requirements:
157
- - - "~>"
129
+ - - '='
158
130
  - !ruby/object:Gem::Version
159
- version: 1.15.0
131
+ version: 2.19.0
160
132
  type: :development
161
133
  prerelease: false
162
134
  version_requirements: !ruby/object:Gem::Requirement
163
135
  requirements:
164
- - - "~>"
136
+ - - '='
165
137
  - !ruby/object:Gem::Version
166
- version: 1.15.0
138
+ version: 2.19.0
167
139
  - !ruby/object:Gem::Dependency
168
140
  name: simplecov
169
141
  requirement: !ruby/object:Gem::Requirement
@@ -192,7 +164,7 @@ dependencies:
192
164
  - - "~>"
193
165
  - !ruby/object:Gem::Version
194
166
  version: '2.0'
195
- description:
167
+ description:
196
168
  email:
197
169
  - lobatifricha@gmail.com
198
170
  executables: []
@@ -203,6 +175,7 @@ files:
203
175
  - ".gitignore"
204
176
  - ".rspec"
205
177
  - ".rubocop.yml"
178
+ - ".rubocop_todo.yml"
206
179
  - CODE_OF_CONDUCT.md
207
180
  - Gemfile
208
181
  - Guardfile
@@ -211,9 +184,7 @@ files:
211
184
  - Rakefile
212
185
  - bin/console
213
186
  - bin/setup
214
- - bin/test
215
- - gemfiles/rails_4.2.gems
216
- - gemfiles/rails_5.0.gems
187
+ - gemfiles/rails_7.0.gems
217
188
  - junk_drawer.gemspec
218
189
  - lib/junk_drawer.rb
219
190
  - lib/junk_drawer/callable.rb
@@ -228,7 +199,7 @@ homepage: https://github.com/thread-pond/junk_drawer
228
199
  licenses:
229
200
  - MIT
230
201
  metadata: {}
231
- post_install_message:
202
+ post_install_message:
232
203
  rdoc_options: []
233
204
  require_paths:
234
205
  - lib
@@ -243,8 +214,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
214
  - !ruby/object:Gem::Version
244
215
  version: '0'
245
216
  requirements: []
246
- rubygems_version: 3.2.32
247
- signing_key:
217
+ rubygems_version: 3.4.2
218
+ signing_key:
248
219
  specification_version: 4
249
220
  summary: random useful Ruby utilities
250
221
  test_files: []
data/bin/test DELETED
@@ -1,3 +0,0 @@
1
- (export BUNDLE_GEMFILE=Gemfile; bundle && bundle exec rake)
2
- (export BUNDLE_GEMFILE=gemfiles/rails_5.0.gems; bundle && bundle exec rake spec)
3
- (export BUNDLE_GEMFILE=gemfiles/rails_4.2.gems; bundle && bundle exec rake spec)
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec path: '../'
6
-
7
- gem 'activerecord', '~> 4.2.0'
8
- gem 'activesupport', '~> 4.2.0'
9
- gem 'hstore_accessor', '~> 1.1.1'
10
- gem 'jsonb_accessor', '~> 0.3.3'
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec path: '../'
6
-
7
- gem 'activerecord', '~> 5.0.0'
8
- gem 'activesupport', '~> 5.0.0'
9
- gem 'hstore_accessor', '~> 1.1.1'
10
- gem 'jsonb_accessor', '~> 1.0.0'