archfiend 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/.github/PULL_REQUEST_TEMPLATE.md +18 -0
  3. data/.gitignore +12 -0
  4. data/.rspec +4 -0
  5. data/.rubocop.yml +323 -0
  6. data/.travis.yml +11 -0
  7. data/CHANGES.md +12 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +7 -0
  10. data/Gemfile.lock +122 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +114 -0
  13. data/ROADMAP.md +11 -0
  14. data/Rakefile +6 -0
  15. data/archfiend.gemspec +35 -0
  16. data/bin/console +14 -0
  17. data/bin/setup +8 -0
  18. data/exe/archfiend +4 -0
  19. data/lib/archfiend.rb +18 -0
  20. data/lib/archfiend/application.rb +132 -0
  21. data/lib/archfiend/cli.rb +9 -0
  22. data/lib/archfiend/generators/daemon.rb +144 -0
  23. data/lib/archfiend/generators/daemon/templates/.rspec +4 -0
  24. data/lib/archfiend/generators/daemon/templates/.rubocop.yml +323 -0
  25. data/lib/archfiend/generators/daemon/templates/Gemfile.tt +32 -0
  26. data/lib/archfiend/generators/daemon/templates/README.md.tt +23 -0
  27. data/lib/archfiend/generators/daemon/templates/Rakefile.tt +13 -0
  28. data/lib/archfiend/generators/daemon/templates/app/clockwork/clockwork.rb.tt +14 -0
  29. data/lib/archfiend/generators/daemon/templates/app/models/application_record.rb +3 -0
  30. data/lib/archfiend/generators/daemon/templates/app/subprocess_loops/foo_subprocess_loop.rb +13 -0
  31. data/lib/archfiend/generators/daemon/templates/app/thread_loops/bar_thread_loop.rb +8 -0
  32. data/lib/archfiend/generators/daemon/templates/bin/console +3 -0
  33. data/lib/archfiend/generators/daemon/templates/bin/start.tt +6 -0
  34. data/lib/archfiend/generators/daemon/templates/config/application.rb.tt +27 -0
  35. data/lib/archfiend/generators/daemon/templates/config/boot.rb.tt +3 -0
  36. data/lib/archfiend/generators/daemon/templates/config/daemon.rb.tt +18 -0
  37. data/lib/archfiend/generators/daemon/templates/config/database.yml.example.tt +26 -0
  38. data/lib/archfiend/generators/daemon/templates/config/environment.rb.tt +4 -0
  39. data/lib/archfiend/generators/daemon/templates/config/settings.yml.tt +8 -0
  40. data/lib/archfiend/generators/daemon/templates/config/settings/development.yml.tt +2 -0
  41. data/lib/archfiend/generators/daemon/templates/config/settings/production.yml.tt +2 -0
  42. data/lib/archfiend/generators/daemon/templates/config/settings/staging.yml.tt +5 -0
  43. data/lib/archfiend/generators/daemon/templates/config/settings/test.yml.tt +0 -0
  44. data/lib/archfiend/generators/daemon/templates/db/migrate/.gitkeep +0 -0
  45. data/lib/archfiend/generators/daemon/templates/lib/tasks/.gitkeep +0 -0
  46. data/lib/archfiend/generators/daemon/templates/log/.gitkeep +0 -0
  47. data/lib/archfiend/generators/daemon/templates/spec/factories/.gitkeep +0 -0
  48. data/lib/archfiend/generators/daemon/templates/spec/models/.gitkeep +0 -0
  49. data/lib/archfiend/generators/daemon/templates/spec/spec_helper.rb +43 -0
  50. data/lib/archfiend/generators/daemon/templates/spec/subprocess_loops/foo_subprocess_loop_spec.rb +5 -0
  51. data/lib/archfiend/generators/daemon/templates/spec/support/factory_bot.rb +9 -0
  52. data/lib/archfiend/generators/daemon/templates/spec/support/timecop.rb +9 -0
  53. data/lib/archfiend/generators/daemon/templates/spec/thread_loops/bar_thread_loop_spec.rb +5 -0
  54. data/lib/archfiend/generators/daemon/templates/tmp/.gitkeep +0 -0
  55. data/lib/archfiend/generators/extensions.rb +119 -0
  56. data/lib/archfiend/generators/options.rb +51 -0
  57. data/lib/archfiend/generators/utils.rb +37 -0
  58. data/lib/archfiend/logging.rb +38 -0
  59. data/lib/archfiend/logging/base_formatter.rb +35 -0
  60. data/lib/archfiend/logging/default_formatter.rb +12 -0
  61. data/lib/archfiend/logging/json_formatter.rb +21 -0
  62. data/lib/archfiend/logging/multi_logger.rb +31 -0
  63. data/lib/archfiend/shared_loop/runnable.rb +26 -0
  64. data/lib/archfiend/subprocess_loop.rb +46 -0
  65. data/lib/archfiend/thread_loop.rb +35 -0
  66. data/lib/archfiend/version.rb +3 -0
  67. data/scripts/travis/install +13 -0
  68. data/scripts/travis/script +43 -0
  69. metadata +280 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0b0813d059eaad65a6ea778d47c65addabcd400d7a6f726d20f1cbfc1eeb5826
4
+ data.tar.gz: 52e45fb839fc32c961a1d9249e190a5ddf952969e1058740bcb28641da7ab651
5
+ SHA512:
6
+ metadata.gz: d1a3ff0a951cd8dbca492ee486a131945bdbb014f66621c81bc46aa39629c0ef2e04a90a8fc7e94aac254e57da44a1a626394e19bc5577fdf2271401b95f2545
7
+ data.tar.gz: 0d68e0690ed1810f25cb88e7db233597bb048db296ba5c49277bb30c92a47a959828d6fb8f9f91dd0d6e3b755423487a7e329239f7eb7a8a0d39e34e31c4d11b
@@ -0,0 +1,18 @@
1
+ **Replace this text with a summary of the changes in your PR.
2
+ The more detailed you are, the better.**
3
+
4
+ -----------------
5
+
6
+ Before submitting the PR make sure the following are checked:
7
+
8
+ * [ ] Wrote [good commit messages][1].
9
+ * [ ] Commit message starts with `[Fix #issue-number]` (if the related issue exists).
10
+ * [ ] Feature branch is up-to-date with `master` (if not - rebase it).
11
+ * [ ] Squashed related commits together.
12
+ * [ ] Added tests.
13
+ * [ ] Added an entry to the [Changelog](../blob/master/CHANGELOG.md) if the new code introduces user-observable changes. See [changelog entry format](../blob/master/CONTRIBUTING.md#changelog-entry-format).
14
+ * [ ] The PR relates to *only* one subject with a clear title
15
+ and description in grammatically correct, complete sentences.
16
+ * [ ] Run `bundle exec rspec` & `bundle exec rubocop`.
17
+
18
+ [1]: http://chris.beams.io/posts/git-commit/
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ spec/fixtures/log/*.log*
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
4
+ --order random
@@ -0,0 +1,323 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ AllCops:
5
+ Exclude:
6
+ - 'db/**/*'
7
+ - 'log/**/*'
8
+ - 'script/**/*'
9
+ - 'tmp/**/*'
10
+ DisplayCopNames: true
11
+ TargetRubyVersion: 2.4
12
+
13
+ ClassAndModuleChildren:
14
+ Enabled: false
15
+
16
+ ClassLength:
17
+ Enabled: false
18
+
19
+ Documentation:
20
+ Enabled: false
21
+
22
+ EmptyLinesAroundClassBody:
23
+ Enabled: false
24
+
25
+ EmptyLinesAroundModuleBody:
26
+ Enabled: false
27
+
28
+ LineLength:
29
+ Enabled: false
30
+
31
+ MethodLength:
32
+ Enabled: false
33
+
34
+ MultilineMethodCallIndentation:
35
+ EnforcedStyle: indented
36
+
37
+ MultilineOperationIndentation:
38
+ EnforcedStyle: indented
39
+
40
+ PercentLiteralDelimiters:
41
+ PreferredDelimiters:
42
+ '%r': '{}'
43
+ '%i': '[]'
44
+ '%w': '[]'
45
+ '%W': '[]'
46
+ '%Q': '{}'
47
+
48
+ PredicateName:
49
+ Enabled: false
50
+
51
+ Rails:
52
+ Enabled: false
53
+
54
+ SignalException:
55
+ EnforcedStyle: semantic
56
+
57
+ SpaceBeforeFirstArg:
58
+ Enabled: false
59
+
60
+ SpaceInsideHashLiteralBraces:
61
+ EnforcedStyle: no_space
62
+
63
+ TrailingCommaInArguments:
64
+ EnforcedStyleForMultiline: no_comma
65
+
66
+ Style/TrailingCommaInArrayLiteral:
67
+ EnforcedStyleForMultiline: no_comma
68
+
69
+ Style/TrailingCommaInHashLiteral:
70
+ EnforcedStyleForMultiline: no_comma
71
+
72
+ Bundler/OrderedGems:
73
+ Enabled: false
74
+
75
+ Lint/AmbiguousBlockAssociation:
76
+ Enabled: false
77
+
78
+ Layout/AlignHash:
79
+ Enabled: false
80
+
81
+ Layout/EmptyLineAfterMagicComment:
82
+ Enabled: false
83
+
84
+ Layout/EmptyLinesAroundArguments:
85
+ Enabled: false
86
+
87
+ Lint/InterpolationCheck:
88
+ Enabled: false
89
+
90
+ Layout/SpaceBeforeBlockBraces:
91
+ EnforcedStyleForEmptyBraces: space
92
+
93
+ Layout/SpaceInsideArrayLiteralBrackets:
94
+ Enabled: false
95
+
96
+ Lint/MissingCopEnableDirective:
97
+ Enabled: false
98
+
99
+ Lint/UriEscapeUnescape:
100
+ Enabled: false
101
+
102
+ Lint/Void:
103
+ Enabled: false
104
+
105
+ Metrics/BlockLength:
106
+ Enabled: false
107
+
108
+ Metrics/ModuleLength:
109
+ Exclude:
110
+ - "**/*_spec.rb"
111
+
112
+ Naming/HeredocDelimiterNaming:
113
+ Enabled: false
114
+
115
+ Rails/ApplicationRecord:
116
+ Enabled: true
117
+ Exclude:
118
+ - db/migrate/*.rb
119
+
120
+ Rails/EnvironmentComparison:
121
+ Enabled: false
122
+
123
+ Rails/HasManyOrHasOneDependent:
124
+ Enabled: false
125
+
126
+ Rails/InverseOf:
127
+ Enabled: false
128
+
129
+ Rails/LexicallyScopedActionFilter:
130
+ Enabled: false
131
+
132
+ Rails/Presence:
133
+ Enabled: false
134
+
135
+ Rails/ReadWriteAttribute:
136
+ Enabled: false
137
+
138
+ Rails/RedundantReceiverInWithOptions:
139
+ Enabled: false
140
+
141
+ Rails/SkipsModelValidations:
142
+ Exclude:
143
+ - "**/*_spec.rb"
144
+ - "**/spec/**/*"
145
+ - "features/**/*"
146
+ - "lib/tasks/**/*"
147
+
148
+ Rails/UnknownEnv:
149
+ Environments:
150
+ - development
151
+ - production
152
+ - staging
153
+ - test
154
+
155
+ RSpec/AnyInstance:
156
+ Enabled: false
157
+
158
+ RSpec/BeEql:
159
+ Enabled: false
160
+
161
+ RSpec/ContextWording:
162
+ Enabled: true
163
+ Prefixes:
164
+ - when
165
+ - with
166
+ - without
167
+
168
+ RSpec/DescribeClass:
169
+ Enabled: false
170
+
171
+ RSpec/DescribedClass:
172
+ Enabled: true
173
+ SkipBlocks: true
174
+
175
+ RSpec/DescribeMethod:
176
+ Enabled: false
177
+
178
+ RSpec/EmptyExampleGroup:
179
+ Enabled: true
180
+ CustomIncludeMethods:
181
+ - requires_ability
182
+ - it_counts
183
+ - it_counts_as_read
184
+ - it_count_as_unread
185
+ - it_does_not_count
186
+ - specify_with_schedule
187
+
188
+ RSpec/EmptyLineAfterFinalLet:
189
+ Enabled: false
190
+
191
+ RSpec/EmptyLineAfterSubject:
192
+ Enabled: false
193
+
194
+ RSpec/ExampleLength:
195
+ Enabled: false
196
+
197
+ RSpec/ExampleWording:
198
+ Enabled: true
199
+
200
+ RSpec/ExpectActual:
201
+ Enabled: true
202
+
203
+ RSpec/ExpectOutput:
204
+ Enabled: true
205
+
206
+ RSpec/Focus:
207
+ Enabled: true
208
+
209
+ RSpec/HookArgument:
210
+ Enabled: true
211
+
212
+ RSpec/ImplicitExpect:
213
+ Enabled: true
214
+
215
+ RSpec/InstanceVariable:
216
+ Enabled: true
217
+
218
+ RSpec/LeadingSubject:
219
+ Enabled: true
220
+
221
+ RSpec/LetSetup:
222
+ Enabled: false
223
+
224
+ RSpec/MessageChain:
225
+ Enabled: false
226
+
227
+ RSpec/MessageExpectation:
228
+ Enabled: false
229
+
230
+ RSpec/MessageSpies:
231
+ Enabled: false
232
+
233
+ RSpec/MultipleDescribes:
234
+ Enabled: true
235
+
236
+ RSpec/MultipleExpectations:
237
+ Enabled: false
238
+
239
+ RSpec/NamedSubject:
240
+ Enabled: false
241
+
242
+ RSpec/NestedGroups:
243
+ Enabled: false
244
+
245
+ RSpec/NotToNot:
246
+ Enabled: false
247
+
248
+ RSpec/RepeatedDescription:
249
+ Enabled: true
250
+
251
+ RSpec/RepeatedExample:
252
+ Enabled: true
253
+
254
+ RSpec/ScatteredLet:
255
+ Enabled: false
256
+
257
+ RSpec/SingleArgumentMessageChain:
258
+ Enabled: true
259
+
260
+ RSpec/ScatteredSetup:
261
+ Enabled: true
262
+
263
+ RSpec/SubjectStub:
264
+ Enabled: false
265
+
266
+ RSpec/VerifiedDoubles:
267
+ Enabled: true
268
+
269
+ Style/BracesAroundHashParameters:
270
+ EnforcedStyle: context_dependent
271
+
272
+ Style/CommentedKeyword:
273
+ Enabled: false
274
+
275
+ Style/DateTime:
276
+ Enabled: false
277
+
278
+ Style/EmptyLambdaParameter:
279
+ Enabled: false
280
+
281
+ Style/EmptyMethod:
282
+ EnforcedStyle: expanded
283
+
284
+ Style/Encoding:
285
+ Enabled: true
286
+
287
+ Style/EvalWithLocation:
288
+ Enabled: false
289
+
290
+ Style/FrozenStringLiteralComment:
291
+ Enabled: false
292
+
293
+ Style/Lambda:
294
+ Enabled: false
295
+
296
+ Style/FormatStringToken:
297
+ Enabled: false
298
+
299
+ Style/MethodCallWithArgsParentheses:
300
+ Enabled: false
301
+
302
+ Style/MixinUsage:
303
+ Enabled: true
304
+ Exclude:
305
+ - 'spec/support/**/*'
306
+
307
+ Style/NumericPredicate:
308
+ Enabled: false
309
+
310
+ Style/OptionHash:
311
+ Enabled: true
312
+
313
+ Style/RandomWithOffset:
314
+ Enabled: false
315
+
316
+ Style/RescueStandardError:
317
+ Enabled: false
318
+
319
+ Style/Send:
320
+ Enabled: true
321
+
322
+ Style/UnneededPercentQ:
323
+ Enabled: true
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.4.2
4
+ sudo: false
5
+ cache: bundler
6
+ addons:
7
+ postgresql: "9.6"
8
+
9
+ install: scripts/travis/install
10
+
11
+ script: scripts/travis/script
@@ -0,0 +1,12 @@
1
+ # Archfiend Changelog
2
+
3
+ All notable changes to this project will be documented in this file, in reverse chronological order.
4
+
5
+ ## [master]
6
+ [master]: https://github.com/toptal/archfiend/compare/ca8f30e...HEAD
7
+
8
+ ### Changes:
9
+
10
+ * updated the documentation
11
+ * added the generator extensions interface
12
+ * extracted the gem
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at maciek@dubinski.net. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/