Captain 0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a87f2b4e2abcc01e664f29302e0362df5c43a698930de1a4cabc29872fc3da38
4
+ data.tar.gz: fed9edda4b7f84eb5eec174b0a289dbf9f6d4f1e7f0acf0b9f0d1dbe1bf9efb0
5
+ SHA512:
6
+ metadata.gz: dddc5bc597815882013be0302bd691d5d0a6965c35b56c9e6292f4c544682101a7b6e62b8d6391238c8273b4e7411c9a6357f46e2dc15746bd2e453bb58f84e3
7
+ data.tar.gz: cfbbf7c27f0dae1af9acb1c0ea876c624a73687a56a66bc98ac57eb05883bf9e34239df0dc3e50d78fb5ea6fee3eedd1eaf63a2d33eae2abd4afc02bbd723dcd
data/.rubocop.yml ADDED
@@ -0,0 +1,459 @@
1
+ require:
2
+ - rubocop-rails
3
+ - ./cops/custom_cops.rb
4
+
5
+ CustomCops/LandlordMailerUsage:
6
+ Exclude:
7
+ - 'test/**/*'
8
+
9
+ AllCops:
10
+ Exclude:
11
+ - 'bin/{rails,rake}'
12
+ - 'config/**/*'
13
+ - 'coverage/**/*'
14
+ - 'db/**/*'
15
+ - 'log/**/*'
16
+ - 'public/**/*'
17
+ - 'tmp/**/*'
18
+ SuggestExtensions: false
19
+
20
+ Gemspec/DateAssignment:
21
+ Enabled: false
22
+
23
+ Gemspec/RequireMFA:
24
+ Enabled: false
25
+
26
+ Layout/BeginEndAlignment:
27
+ Enabled: true
28
+
29
+ Layout/DotPosition:
30
+ EnforcedStyle: leading
31
+
32
+ Layout/EmptyLinesAroundAttributeAccessor:
33
+ Enabled: false
34
+
35
+ Layout/LineEndStringConcatenationIndentation:
36
+ Enabled: true
37
+ EnforcedStyle: indented
38
+
39
+ Layout/LineLength:
40
+ Max: 120
41
+
42
+ Layout/SpaceAroundMethodCallOperator:
43
+ Enabled: true
44
+
45
+ Layout/SpaceBeforeBrackets:
46
+ Enabled: true
47
+
48
+ Lint/AmbiguousAssignment:
49
+ Enabled: true
50
+
51
+ Lint/AmbiguousOperatorPrecedence:
52
+ Enabled: false
53
+
54
+ Lint/AmbiguousRange:
55
+ Enabled: true
56
+
57
+ Lint/BinaryOperatorWithIdenticalOperands:
58
+ Enabled: false
59
+
60
+ Lint/ConstantDefinitionInBlock:
61
+ Enabled: true
62
+
63
+ Lint/DeprecatedConstants:
64
+ Enabled: true
65
+
66
+ Lint/DeprecatedOpenSSLConstant:
67
+ Enabled: false
68
+
69
+ Lint/DuplicateBranch:
70
+ Enabled: true
71
+
72
+ Lint/DuplicateElsifCondition:
73
+ Enabled: true
74
+
75
+ Lint/DuplicateRegexpCharacterClassElement:
76
+ Enabled: true
77
+
78
+ Lint/DuplicateRequire:
79
+ Enabled: true
80
+
81
+ Lint/DuplicateRescueException:
82
+ Enabled: true
83
+
84
+ Lint/EmptyBlock:
85
+ Enabled: true
86
+
87
+ Lint/EmptyClass:
88
+ Enabled: true
89
+ AllowComments: true
90
+
91
+ Lint/EmptyConditionalBody:
92
+ Enabled: true
93
+
94
+ Lint/EmptyFile:
95
+ Enabled: false
96
+
97
+ Lint/EmptyInPattern:
98
+ Enabled: true
99
+ AllowComments: true
100
+
101
+ Lint/FloatComparison:
102
+ Enabled: false
103
+
104
+ Lint/HashCompareByIdentity:
105
+ Enabled: false
106
+
107
+ Lint/IdentityComparison:
108
+ Enabled: true
109
+
110
+ Lint/IncompatibleIoSelectWithFiberScheduler:
111
+ Enabled: false
112
+
113
+ Lint/LambdaWithoutLiteralBlock:
114
+ Enabled: true
115
+
116
+ Lint/MissingSuper:
117
+ Enabled: false
118
+
119
+ Lint/MixedRegexpCaptureTypes:
120
+ Enabled: true
121
+
122
+ Lint/NoReturnInBeginEndBlocks:
123
+ Enabled: true
124
+
125
+ Lint/NumberedParameterAssignment:
126
+ Enabled: true
127
+
128
+ Lint/OrAssignmentToConstant:
129
+ Enabled: true
130
+
131
+ Lint/OutOfRangeRegexpRef:
132
+ Enabled: true
133
+
134
+ Lint/RaiseException:
135
+ Enabled: true
136
+
137
+ Lint/RedundantDirGlobSort:
138
+ Enabled: true
139
+
140
+ Lint/RedundantSafeNavigation:
141
+ Enabled: false
142
+
143
+ Lint/RequireRelativeSelfPath:
144
+ Enabled: true
145
+
146
+ Lint/SelfAssignment:
147
+ Enabled: true
148
+
149
+ Lint/StructNewOverride:
150
+ Enabled: true
151
+
152
+ Lint/SymbolConversion:
153
+ Enabled: true
154
+ EnforcedStyle: consistent
155
+
156
+ Lint/ToEnumArguments:
157
+ Enabled: true
158
+
159
+ Lint/TopLevelReturnWithArgument:
160
+ Enabled: true
161
+
162
+ Lint/TrailingCommaInAttributeDeclaration:
163
+ Enabled: true
164
+
165
+ Lint/TripleQuotes:
166
+ Enabled: true
167
+
168
+ Lint/UnexpectedBlockArity:
169
+ Enabled: false
170
+
171
+ Lint/UnmodifiedReduceAccumulator:
172
+ Enabled: true
173
+
174
+ Lint/UnreachableLoop:
175
+ Enabled: true
176
+
177
+ Lint/UselessMethodDefinition:
178
+ Enabled: true
179
+
180
+ Lint/UselessRuby2Keywords:
181
+ Enabled: true
182
+
183
+ Lint/UselessTimes:
184
+ Enabled: false
185
+
186
+ Metrics/AbcSize:
187
+ Enabled: false
188
+
189
+ Metrics/BlockLength:
190
+ Enabled: false
191
+
192
+ Metrics/ClassLength:
193
+ Enabled: false
194
+
195
+ Metrics/CyclomaticComplexity:
196
+ Enabled: false
197
+
198
+ Metrics/MethodLength:
199
+ Include:
200
+ - 'app/controllers/**/*.rb'
201
+ Enabled: true
202
+ Max: 20
203
+
204
+ Metrics/ModuleLength:
205
+ Enabled: false
206
+
207
+ Metrics/PerceivedComplexity:
208
+ Enabled: false
209
+
210
+ Naming/BlockForwarding:
211
+ Enabled: true
212
+
213
+ Naming/PredicateName:
214
+ Enabled: false
215
+
216
+ Rails/ActiveRecordCallbacksOrder:
217
+ Enabled: true
218
+
219
+ Rails/AfterCommitOverride:
220
+ Enabled: true
221
+
222
+ Rails/AttributeDefaultBlockValue:
223
+ Enabled: true
224
+
225
+ Rails/EnvironmentVariableAccess:
226
+ Enabled: false
227
+
228
+ Rails/FindById:
229
+ Enabled: true
230
+
231
+ Rails/Inquiry:
232
+ Enabled: true
233
+
234
+ Rails/MailerName:
235
+ Enabled: true
236
+
237
+ Rails/MatchRoute:
238
+ Enabled: true
239
+
240
+ Rails/NegateInclude:
241
+ Enabled: true
242
+
243
+ Rails/Pluck:
244
+ Enabled: true
245
+
246
+ Rails/PluckInWhere:
247
+ Enabled: true
248
+
249
+ Rails/RenderInline:
250
+ Enabled: true
251
+
252
+ Rails/RenderPlainText:
253
+ Enabled: true
254
+
255
+ Rails/ShortI18n:
256
+ Enabled: false
257
+
258
+ Rails/SkipsModelValidations:
259
+ Exclude:
260
+ - 'test/**/*'
261
+
262
+ Rails/SquishedSQLHeredocs:
263
+ Enabled: true
264
+
265
+ Rails/TimeZoneAssignment:
266
+ Enabled: true
267
+
268
+ Rails/UnknownEnv:
269
+ Environments:
270
+ - production
271
+ - development
272
+ - test
273
+ - demo
274
+
275
+ Rails/WhereEquals:
276
+ Enabled: true
277
+
278
+ Rails/WhereExists:
279
+ Enabled: false
280
+
281
+ Rails/WhereNot:
282
+ Enabled: true
283
+
284
+ Security/IoMethods:
285
+ Enabled: true
286
+
287
+ Style/AccessorGrouping:
288
+ Enabled: true
289
+ EnforcedStyle: separated
290
+
291
+ Style/ArgumentsForwarding:
292
+ Enabled: true
293
+
294
+ Style/ArrayCoercion:
295
+ Enabled: true
296
+
297
+ Style/AsciiComments:
298
+ Enabled: false
299
+
300
+ Style/BisectedAttrAccessor:
301
+ Enabled: true
302
+
303
+ Style/CaseLikeIf:
304
+ Enabled: true
305
+
306
+ Style/ClassAndModuleChildren:
307
+ EnforcedStyle: compact
308
+
309
+ Style/ClassEqualityComparison:
310
+ Enabled: true
311
+
312
+ Style/CollectionCompact:
313
+ Enabled: true
314
+
315
+ Style/CombinableLoops:
316
+ Enabled: false
317
+
318
+ Style/ConditionalAssignment:
319
+ EnforcedStyle: assign_inside_condition
320
+ IncludeTernaryExpressions: false
321
+
322
+ Style/DocumentDynamicEvalDefinition:
323
+ Enabled: false
324
+
325
+ Style/Documentation:
326
+ Exclude:
327
+ - 'test/**/*'
328
+ - 'app/presenters/**/*'
329
+
330
+ Style/DocumentationMethod:
331
+ Enabled: false
332
+
333
+ Style/EmptyMethod:
334
+ EnforcedStyle: expanded
335
+
336
+ Style/EndlessMethod:
337
+ Enabled: true
338
+ EnforcedStyle: disallow
339
+
340
+ Style/ExplicitBlockArgument:
341
+ Enabled: true
342
+
343
+ Style/ExponentialNotation:
344
+ Enabled: false
345
+
346
+ Style/FileRead:
347
+ Enabled: true
348
+
349
+ Style/FileWrite:
350
+ Enabled: true
351
+
352
+ Style/GlobalStdStream:
353
+ Enabled: true
354
+
355
+ Style/HashAsLastArrayItem:
356
+ Enabled: true
357
+
358
+ Style/HashConversion:
359
+ Enabled: true
360
+
361
+ Style/HashEachMethods:
362
+ Enabled: true
363
+
364
+ Style/HashExcept:
365
+ Enabled: true
366
+
367
+ Style/HashLikeCase:
368
+ Enabled: true
369
+
370
+ Style/HashTransformKeys:
371
+ Enabled: true
372
+
373
+ Style/HashTransformValues:
374
+ Enabled: true
375
+
376
+ Style/IfWithBooleanLiteralBranches:
377
+ Enabled: true
378
+
379
+ Style/InPatternThen:
380
+ Enabled: true
381
+
382
+ Style/KeywordParametersOrder:
383
+ Enabled: true
384
+
385
+ Style/MapToHash:
386
+ Enabled: true
387
+
388
+ Style/MultilineInPatternThen:
389
+ Enabled: true
390
+
391
+ Style/NegatedIfElseCondition:
392
+ Enabled: true
393
+
394
+ Style/NilLambda:
395
+ Enabled: true
396
+
397
+ Style/NumberedParameters:
398
+ Enabled: true
399
+ EnforcedStyle: disallow
400
+
401
+ Style/NumberedParametersLimit:
402
+ Enabled: false
403
+
404
+ Style/OpenStructUse:
405
+ Enabled: true
406
+
407
+ Style/OptionalBooleanParameter:
408
+ Enabled: true
409
+
410
+ Style/QuotedSymbols:
411
+ Enabled: true
412
+
413
+ Style/RedundantArgument:
414
+ Enabled: false
415
+
416
+ Style/RedundantAssignment:
417
+ Enabled: true
418
+
419
+ Style/RedundantFetchBlock:
420
+ Enabled: true
421
+
422
+ Style/RedundantFileExtensionInRequire:
423
+ Enabled: true
424
+
425
+ Style/RedundantRegexpCharacterClass:
426
+ Enabled: true
427
+
428
+ Style/RedundantRegexpEscape:
429
+ Enabled: true
430
+
431
+ Style/RedundantSelfAssignment:
432
+ Enabled: false
433
+
434
+ Style/RedundantSelfAssignmentBranch:
435
+ Enabled: true
436
+
437
+ Style/RegexpLiteral:
438
+ Enabled: false
439
+
440
+ Style/SelectByRegexp:
441
+ Enabled: false
442
+
443
+ Style/SingleArgumentDig:
444
+ Enabled: false
445
+
446
+ Style/SlicingWithRange:
447
+ Enabled: false
448
+
449
+ Style/SoleNestedConditional:
450
+ Enabled: true
451
+
452
+ Style/StringChars:
453
+ Enabled: true
454
+
455
+ Style/StringConcatenation:
456
+ Enabled: true
457
+
458
+ Style/SwapValues:
459
+ Enabled: true
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-06-29
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at gregory@flatlooker.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in Captain.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
11
+
12
+ gem "rubocop", "~> 1.21"
13
+
14
+ gem 'rack'
15
+
16
+ gem 'sinatra'
17
+
18
+ gem 'puma'
19
+
20
+ gem 'ruby_jard'
data/Gemfile.lock ADDED
@@ -0,0 +1,72 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ Captain (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ byebug (11.1.3)
11
+ coderay (1.1.3)
12
+ method_source (1.0.0)
13
+ minitest (5.15.0)
14
+ mustermann (1.1.1)
15
+ ruby2_keywords (~> 0.0.1)
16
+ nio4r (2.5.8)
17
+ parallel (1.22.1)
18
+ parser (3.0.2.0)
19
+ ast (~> 2.4.1)
20
+ pry (0.13.1)
21
+ coderay (~> 1.1)
22
+ method_source (~> 1.0)
23
+ puma (5.6.4)
24
+ nio4r (~> 2.0)
25
+ rack (2.2.3.1)
26
+ rack-protection (2.2.0)
27
+ rack
28
+ rainbow (3.1.1)
29
+ rake (13.0.6)
30
+ regexp_parser (2.5.0)
31
+ rexml (3.2.5)
32
+ rubocop (1.24.1)
33
+ parallel (~> 1.10)
34
+ parser (>= 3.0.0.0)
35
+ rainbow (>= 2.2.2, < 4.0)
36
+ regexp_parser (>= 1.8, < 3.0)
37
+ rexml
38
+ rubocop-ast (>= 1.15.1, < 2.0)
39
+ ruby-progressbar (~> 1.7)
40
+ unicode-display_width (>= 1.4.0, < 3.0)
41
+ rubocop-ast (1.15.2)
42
+ parser (>= 3.0.1.1)
43
+ ruby-progressbar (1.11.0)
44
+ ruby2_keywords (0.0.5)
45
+ ruby_jard (0.3.1)
46
+ byebug (>= 9.1, < 12.0)
47
+ pry (~> 0.13.0)
48
+ tty-screen (~> 0.8.1)
49
+ sinatra (2.2.0)
50
+ mustermann (~> 1.0)
51
+ rack (~> 2.2)
52
+ rack-protection (= 2.2.0)
53
+ tilt (~> 2.0)
54
+ tilt (2.0.10)
55
+ tty-screen (0.8.1)
56
+ unicode-display_width (2.1.0)
57
+
58
+ PLATFORMS
59
+ x86_64-darwin-20
60
+
61
+ DEPENDENCIES
62
+ Captain!
63
+ minitest (~> 5.0)
64
+ puma
65
+ rack
66
+ rake (~> 13.0)
67
+ rubocop (~> 1.21)
68
+ ruby_jard
69
+ sinatra
70
+
71
+ BUNDLED WITH
72
+ 2.2.30
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 TODO: Write your name
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # Captain
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/Captain`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'Captain'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install Captain
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/Captain. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/Captain/blob/master/CODE_OF_CONDUCT.md).
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the Captain project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/Captain/blob/master/CODE_OF_CONDUCT.md).
44
+
45
+ ```ruby
46
+ require 'ruby_jard'
47
+ require_relative "./lib/Captain.rb"
48
+ require_relative "./lib/hooks_controller.rb"
49
+
50
+ Captain.define_hook('test')
51
+ Captain.define_hook('yo')
52
+
53
+ require 'sinatra'
54
+ require_relative 'lib/hooks_controller'
55
+
56
+ class App < Sinatra::Base
57
+ get "/hooks/*" do
58
+ HooksController.new.call(@env)
59
+ end
60
+ end
61
+
62
+ run App
63
+ ```
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ end
11
+
12
+ require "rubocop/rake_task"
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "Captain"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/config.ru ADDED
@@ -0,0 +1,9 @@
1
+ require 'sinatra'
2
+
3
+ class App < Sinatra::Base
4
+ get "/hooks/*" do
5
+ HooksController.new.call(@env)
6
+ end
7
+ end
8
+
9
+ run App
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Captain
4
+ VERSION = "0.0.1"
5
+ end
data/lib/Captain.rb ADDED
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "Captain/version"
4
+ require_relative "hooks_controller"
5
+ require 'rack'
6
+
7
+ module Captain
8
+ class << self
9
+ attr_accessor :config
10
+
11
+ def define_hook(url)
12
+ config[:hooks] ||= []
13
+ config[:hooks] << url
14
+ end
15
+ end
16
+
17
+ Captain.config = {}
18
+ end
@@ -0,0 +1,11 @@
1
+ require 'rack'
2
+
3
+ class HooksController
4
+ def call(env)
5
+ Captain.config[:hooks].each do |hook_path|
6
+ return [200, {"Content-Type" => "text/html"}, ["Hello World!"]] if "/hooks/#{hook_path}" == env['PATH_INFO']
7
+ end
8
+
9
+ [404, {"Content-Type" => "text/html"}, ["Unknown hook route !"]]
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: Captain
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Grégory Prève
8
+ - Antoine Barranco
9
+ autorequire:
10
+ bindir: exe
11
+ cert_chain: []
12
+ date: 2022-07-11 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Gem to handle incoming hooks
15
+ email:
16
+ - gregory@flatlooker.com
17
+ - antoine.barranco@flatlooker.com
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ".rubocop.yml"
23
+ - CHANGELOG.md
24
+ - CODE_OF_CONDUCT.md
25
+ - Gemfile
26
+ - Gemfile.lock
27
+ - LICENSE.txt
28
+ - README.md
29
+ - Rakefile
30
+ - bin/console
31
+ - bin/setup
32
+ - config.ru
33
+ - lib/Captain.rb
34
+ - lib/Captain/version.rb
35
+ - lib/hooks_controller.rb
36
+ homepage: https://github.com/Flatlooker/Captain
37
+ licenses:
38
+ - MIT
39
+ metadata:
40
+ homepage_uri: https://github.com/Flatlooker/Captain
41
+ source_code_uri: https://github.com/Flatlooker/Captain
42
+ changelog_uri: https://github.com/Flatlooker/Captain/CHANGELOG.md
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: 2.6.0
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubygems_version: 3.2.22
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: Gem to handle incoming hooks
62
+ test_files: []