void_method 1.0.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c94b34d98fe45eca38afc5376859200b70ad5c765b830d22df3cad5392cc168c
4
+ data.tar.gz: a8acdcf2a3fd6e877987c295a203f17473e50b01203dd768e38e9e8d5a6ba464
5
+ SHA512:
6
+ metadata.gz: b4de3d7a61701067f336dd021fb03fcbfdfd2687b83dda9d6119ce1a46032c81e757cff50f9786215edb7d9e8126e3c9172ac7b1198a72414d80a25497f37411
7
+ data.tar.gz: 129e7aa0f63c5c7b5d2364bcb6f9a4c99633cfa7ef1ad4ec5b022657851c2c6f02c4851019e86d1fb0f116aed1e9ea25bb422503c466770c1546a5a824ac6e59
data/.rubocop.yml ADDED
@@ -0,0 +1,452 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ Exclude:
4
+ - "bin/**"
5
+
6
+ Gemspec/DeprecatedAttributeAssignment:
7
+ Enabled: true
8
+
9
+ Gemspec/DevelopmentDependencies:
10
+ Enabled: true
11
+
12
+ Gemspec/RequireMFA:
13
+ Enabled: false
14
+
15
+ Layout/AccessModifierIndentation:
16
+ EnforcedStyle: outdent
17
+
18
+ Layout/BeginEndAlignment:
19
+ EnforcedStyleAlignWith: begin
20
+
21
+ Layout/BlockAlignment:
22
+ EnforcedStyleAlignWith: start_of_block
23
+
24
+ Layout/CommentIndentation:
25
+ AllowForAlignment: true
26
+
27
+ Layout/EmptyLineAfterMultilineCondition:
28
+ Enabled: true
29
+
30
+ Layout/EndOfLine:
31
+ EnforcedStyle: lf
32
+
33
+ Layout/ExtraSpacing:
34
+ AllowForAlignment: true
35
+ AllowBeforeTrailingComments: true
36
+
37
+ Layout/HashAlignment:
38
+ EnforcedHashRocketStyle: table
39
+ EnforcedColonStyle: table
40
+ EnforcedLastArgumentHashStyle: ignore_implicit
41
+
42
+ Layout/LineContinuationLeadingSpace:
43
+ Enabled: true
44
+
45
+ Layout/LineContinuationSpacing:
46
+ Enabled: true
47
+
48
+ Layout/LineEndStringConcatenationIndentation:
49
+ Enabled: true
50
+
51
+ Layout/MultilineArrayLineBreaks:
52
+ Enabled: true
53
+
54
+ Layout/MultilineAssignmentLayout:
55
+ Enabled: true
56
+ EnforcedStyle: same_line
57
+
58
+ Layout/MultilineHashKeyLineBreaks:
59
+ Enabled: true
60
+
61
+ Layout/MultilineMethodArgumentLineBreaks:
62
+ Enabled: true
63
+
64
+ Layout/MultilineMethodCallIndentation:
65
+ EnforcedStyle: indented_relative_to_receiver
66
+
67
+ Layout/SingleLineBlockChain:
68
+ Enabled: true
69
+
70
+ Layout/SpaceAroundEqualsInParameterDefault:
71
+ EnforcedStyle: no_space
72
+
73
+ Layout/SpaceAroundOperators:
74
+ EnforcedStyleForExponentOperator: space
75
+
76
+ Layout/SpaceBeforeBrackets:
77
+ Enabled: true
78
+
79
+ Layout/SpaceInsideHashLiteralBraces:
80
+ EnforcedStyle: no_space
81
+
82
+ Layout/TrailingWhitespace:
83
+ AllowInHeredoc: true
84
+
85
+ Lint/AmbiguousAssignment:
86
+ Enabled: true
87
+
88
+ Lint/AmbiguousOperatorPrecedence:
89
+ Enabled: true
90
+
91
+ Lint/AmbiguousRange:
92
+ Enabled: true
93
+ RequireParenthesesForMethodChains: true
94
+
95
+ Lint/AssignmentInCondition:
96
+ AllowSafeAssignment: false
97
+
98
+ Lint/ConstantOverwrittenInRescue:
99
+ Enabled: true
100
+
101
+ Lint/DeprecatedConstants:
102
+ Enabled: true
103
+
104
+ Lint/DuplicateBranch:
105
+ Enabled: true
106
+ IgnoreLiteralBranches: true
107
+ IgnoreConstantBranches: true
108
+
109
+ Lint/DuplicateMagicComment:
110
+ Enabled: true
111
+
112
+ Lint/DuplicateRegexpCharacterClassElement:
113
+ Enabled: true
114
+
115
+ Lint/EmptyBlock:
116
+ Enabled: true
117
+
118
+ Lint/EmptyClass:
119
+ Enabled: true
120
+ AllowComments: true
121
+
122
+ Lint/EmptyInPattern:
123
+ Enabled: true
124
+
125
+ Lint/HeredocMethodCallPosition:
126
+ Enabled: true
127
+
128
+ Lint/IncompatibleIoSelectWithFiberScheduler:
129
+ Enabled: false
130
+
131
+ Lint/LambdaWithoutLiteralBlock:
132
+ Enabled: true
133
+
134
+ Lint/NoReturnInBeginEndBlocks:
135
+ Enabled: true
136
+
137
+ Lint/NonAtomicFileOperation:
138
+ Enabled: true
139
+
140
+ Lint/NumberedParameterAssignment:
141
+ Enabled: true
142
+
143
+ Lint/OrAssignmentToConstant:
144
+ Enabled: true
145
+
146
+ Lint/RedundantDirGlobSort:
147
+ Enabled: true
148
+
149
+ Lint/RedundantSplatExpansion:
150
+ AllowPercentLiteralArrayArgument: false
151
+
152
+ Lint/RefinementImportMethods:
153
+ Enabled: true
154
+
155
+ Lint/RequireRangeParentheses:
156
+ Enabled: true
157
+
158
+ Lint/RequireRelativeSelfPath:
159
+ Enabled: true
160
+
161
+ Lint/SymbolConversion:
162
+ Enabled: true
163
+
164
+ Lint/ToEnumArguments:
165
+ Enabled: true
166
+
167
+ Lint/TripleQuotes:
168
+ Enabled: true
169
+
170
+ Lint/UnexpectedBlockArity:
171
+ Enabled: true
172
+
173
+ Lint/UnmodifiedReduceAccumulator:
174
+ Enabled: true
175
+
176
+ Lint/UnusedBlockArgument:
177
+ AutoCorrect: false
178
+
179
+ Lint/UnusedMethodArgument:
180
+ AutoCorrect: false
181
+
182
+ Lint/UselessRescue:
183
+ Enabled: true
184
+
185
+ Lint/UselessRuby2Keywords:
186
+ Enabled: true
187
+
188
+ Metrics:
189
+ Enabled: false
190
+
191
+ Naming/BlockForwarding:
192
+ Enabled: true
193
+
194
+ Naming/InclusiveLanguage:
195
+ Enabled: false
196
+
197
+ Security/CompoundHash:
198
+ Enabled: true
199
+
200
+ Security/Eval:
201
+ Enabled: false
202
+
203
+ Security/IoMethods:
204
+ Enabled: true
205
+
206
+ Style/AccessorGrouping:
207
+ EnforcedStyle: separated
208
+
209
+ Style/ArgumentsForwarding:
210
+ Enabled: false
211
+
212
+ Style/ArrayIntersect:
213
+ Enabled: true
214
+
215
+ Style/AutoResourceCleanup:
216
+ Enabled: true
217
+
218
+ Style/CollectionCompact:
219
+ Enabled: true
220
+
221
+ Style/CollectionMethods:
222
+ Enabled: true
223
+
224
+ Style/ComparableClamp:
225
+ Enabled: true
226
+
227
+ Style/ConcatArrayLiterals:
228
+ Enabled: true
229
+
230
+ Style/DirEmpty:
231
+ Enabled: true
232
+
233
+ Style/DocumentDynamicEvalDefinition:
234
+ Enabled: false
235
+
236
+ Style/Documentation:
237
+ Enabled: false
238
+
239
+ Style/DocumentationMethod:
240
+ Enabled: false
241
+
242
+ Style/DoubleNegation:
243
+ EnforcedStyle: forbidden
244
+
245
+ Style/EmptyHeredoc:
246
+ Enabled: true
247
+
248
+ Style/EmptyMethod:
249
+ EnforcedStyle: expanded
250
+
251
+ Style/EndlessMethod:
252
+ Enabled: true
253
+ EnforcedStyle: disallow
254
+
255
+ Style/EnvHome:
256
+ Enabled: true
257
+
258
+ Style/FetchEnvVar:
259
+ Enabled: false
260
+
261
+ Style/FileEmpty:
262
+ Enabled: true
263
+
264
+ Style/FileRead:
265
+ Enabled: true
266
+
267
+ Style/FileWrite:
268
+ Enabled: true
269
+
270
+ Style/FormatString:
271
+ EnforcedStyle: percent
272
+
273
+ Style/FrozenStringLiteralComment:
274
+ Enabled: false
275
+
276
+ Style/HashConversion:
277
+ Enabled: true
278
+
279
+ Style/HashExcept:
280
+ Enabled: true
281
+
282
+ Style/HashSyntax:
283
+ EnforcedShorthandSyntax: never
284
+
285
+ Style/IfWithBooleanLiteralBranches:
286
+ Enabled: true
287
+
288
+ Style/ImplicitRuntimeError:
289
+ Enabled: true
290
+
291
+ Style/InPatternThen:
292
+ Enabled: true
293
+
294
+ Style/IpAddresses:
295
+ Enabled: true
296
+
297
+ Style/MagicCommentFormat:
298
+ Enabled: true
299
+
300
+ Style/MapCompactWithConditionalBlock:
301
+ Enabled: true
302
+
303
+ Style/MapToHash:
304
+ Enabled: true
305
+
306
+ Style/MapToSet:
307
+ Enabled: true
308
+
309
+ Style/MethodCallWithArgsParentheses:
310
+ Enabled: true
311
+ EnforcedStyle: omit_parentheses
312
+ AllowParenthesesInMultilineCall: true
313
+ AllowParenthesesInChaining: true
314
+ AllowParenthesesInCamelCaseMethod: true
315
+
316
+ Style/MethodDefParentheses:
317
+ EnforcedStyle: require_no_parentheses_except_multiline
318
+
319
+ Style/MinMaxComparison:
320
+ Enabled: true
321
+
322
+ Style/MultilineBlockChain:
323
+ Enabled: false
324
+
325
+ Style/MultilineInPatternThen:
326
+ Enabled: true
327
+
328
+ Style/NegatedIfElseCondition:
329
+ Enabled: true
330
+
331
+ Style/NestedFileDirname:
332
+ Enabled: true
333
+
334
+ Style/NestedParenthesizedCalls:
335
+ Enabled: false
336
+
337
+ Style/NilLambda:
338
+ Enabled: true
339
+
340
+ Style/NonNilCheck:
341
+ Enabled: false
342
+
343
+ Style/NumberedParameters:
344
+ Enabled: true
345
+
346
+ Style/NumberedParametersLimit:
347
+ Enabled: true
348
+ Max: 2
349
+
350
+ Style/ObjectThen:
351
+ Enabled: true
352
+
353
+ Style/OpenStructUse:
354
+ Enabled: false
355
+
356
+ Style/OperatorMethodCall:
357
+ Enabled: true
358
+
359
+ Style/OptionHash:
360
+ Enabled: true
361
+
362
+ Style/QuotedSymbols:
363
+ Enabled: true
364
+
365
+ Style/RedundantArgument:
366
+ Enabled: false
367
+
368
+ Style/RedundantConstantBase:
369
+ Enabled: false
370
+
371
+ Style/RedundantDoubleSplatHashBraces:
372
+ Enabled: true
373
+
374
+ Style/RedundantEach:
375
+ Enabled: true
376
+
377
+ Style/RedundantException:
378
+ Enabled: false
379
+
380
+ Style/RedundantHeredocDelimiterQuotes:
381
+ Enabled: true
382
+
383
+ Style/RedundantInitialize:
384
+ Enabled: true
385
+
386
+ Style/RedundantParentheses:
387
+ Enabled: false
388
+
389
+ Style/RedundantSelfAssignmentBranch:
390
+ Enabled: true
391
+
392
+ Style/RedundantStringEscape:
393
+ Enabled: true
394
+
395
+ Style/RegexpLiteral:
396
+ EnforcedStyle: percent_r
397
+
398
+ Style/ReturnNil:
399
+ Enabled: true
400
+
401
+ Style/SelectByRegexp:
402
+ Enabled: true
403
+
404
+ Style/SingleLineMethods:
405
+ AllowIfMethodIsEmpty: false
406
+
407
+ Style/StaticClass:
408
+ Enabled: true
409
+
410
+ Style/StringChars:
411
+ Enabled: true
412
+
413
+ Style/StringHashKeys:
414
+ Enabled: false
415
+
416
+ Style/SwapValues:
417
+ Enabled: true
418
+
419
+ Style/SymbolArray:
420
+ EnforcedStyle: brackets
421
+
422
+ Style/TernaryParentheses:
423
+ EnforcedStyle: require_parentheses_when_complex
424
+ AllowSafeAssignment: false
425
+
426
+ Style/TopLevelMethodDefinition:
427
+ Enabled: true
428
+
429
+ Style/TrailingCommaInArguments:
430
+ Enabled: true
431
+ EnforcedStyleForMultiline: no_comma
432
+
433
+ Style/TrailingCommaInArrayLiteral:
434
+ Enabled: true
435
+ EnforcedStyleForMultiline: no_comma
436
+
437
+ Style/TrailingCommaInBlockArgs:
438
+ Enabled: true
439
+
440
+ Style/TrailingCommaInHashLiteral:
441
+ Enabled: true
442
+ EnforcedStyleForMultiline: no_comma
443
+
444
+ Style/UnlessLogicalOperators:
445
+ EnforcedStyle: forbid_logical_operators
446
+
447
+ Style/WordArray:
448
+ EnforcedStyle: brackets
449
+
450
+ Style/YodaCondition:
451
+ Enabled: true
452
+ EnforcedStyle: forbid_for_all_comparison_operators
data/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ <!--[//]: # (
4
+ ## <Release number> <Date YYYY-MM-DD>
5
+ ### Breaking changes
6
+ ### Deprecations
7
+ ### New features
8
+ ### Bug fixes
9
+ )-->
10
+
11
+ ## 1.0.0 2024-10-18
12
+
13
+ First release. Refer to [README.md](README.md) for the full documentation.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Moku S.r.l., Riccardo Agatea
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # Void Method
2
+
3
+ A simple gem for a method that always returns void.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'void_method', '~> 1.0'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or you can install the gem on its own:
20
+
21
+ ```bash
22
+ gem install void_method
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ Call the `void` method to declaratively execute code and return `nil`:
28
+
29
+ ```ruby
30
+ void do
31
+ # some code that returns a value to be ignored
32
+ end
33
+ # => nil
34
+ ```
35
+
36
+ The block is passed the receiver of `void` as parameter, so it can be used like `tap` and `then`.
37
+
38
+ If `Kernel#void` is already defined, the gem raises an exception.
39
+
40
+ ## Version numbers
41
+
42
+ Void Method loosely follows [Semantic Versioning](https://semver.org/), with a hard guarantee that breaking changes to the public API will always coincide with an increase to the `MAJOR` number.
43
+
44
+ Version numbers are in three parts: `MAJOR.MINOR.PATCH`.
45
+
46
+ - Breaking changes to the public API increment the `MAJOR`. There may also be changes that would otherwise increase the `MINOR` or the `PATCH`.
47
+ - Additions, deprecations, and "big" non breaking changes to the public API increment the `MINOR`. There may also be changes that would otherwise increase the `PATCH`.
48
+ - Bug fixes and "small" non breaking changes to the public API increment the `PATCH`.
49
+
50
+ Notice that any feature deprecated by a minor release can be expected to be removed by the next major release.
51
+
52
+ ## Changelog
53
+
54
+ Full list of changes in [CHANGELOG.md](CHANGELOG.md)
55
+
56
+ ## Contributing
57
+
58
+ Bug reports and pull requests are welcome on GitHub at https://github.com/moku-io/void_method.
59
+
60
+ ## License
61
+
62
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ require 'rubocop/rake_task'
4
+
5
+ RuboCop::RakeTask.new
6
+
7
+ task default: [:rubocop]
@@ -0,0 +1,3 @@
1
+ module VoidMethod
2
+ VERSION = '1.0.0'.freeze
3
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'void_method/version'
2
+
3
+ if Kernel.method_defined? :void
4
+ raise RuntimeError,
5
+ 'Kernel#void is already defined. Previous definition is at ' \
6
+ "#{Kernel.instance_method(:void).source_location.join(':')}"
7
+ end
8
+
9
+ module Kernel
10
+ def void &block
11
+ nil.tap do
12
+ tap(&block)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1 @@
1
+
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: void_method
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Riccardo Agatea
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-10-18 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple gem for a method that always returns void.
14
+ email:
15
+ - riccardo@moku.io
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rubocop.yml"
21
+ - CHANGELOG.md
22
+ - LICENSE
23
+ - README.md
24
+ - Rakefile
25
+ - lib/void_method.rb
26
+ - lib/void_method/version.rb
27
+ - sig/void_method.rbs
28
+ homepage: https://github.com/moku-io/void_method
29
+ licenses: []
30
+ metadata:
31
+ homepage_uri: https://github.com/moku-io/void_method
32
+ source_code_uri: https://github.com/moku-io/void_method
33
+ changelog_uri: https://github.com/moku-io/void_method/blob/master/CHANGELOG.md
34
+ post_install_message:
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 3.0.0
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubygems_version: 3.5.11
50
+ signing_key:
51
+ specification_version: 4
52
+ summary: A simple gem for a method that always returns void.
53
+ test_files: []