kowl 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (250) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +7 -0
  3. data/README.md +383 -0
  4. data/bin/console +14 -0
  5. data/bin/kowl +106 -0
  6. data/bin/setup +13 -0
  7. data/lib/kowl/actions.rb +240 -0
  8. data/lib/kowl/docker.rb +447 -0
  9. data/lib/kowl/generators/README.md +5 -0
  10. data/lib/kowl/generators/action_generator.rb +113 -0
  11. data/lib/kowl/generators/admin_generator.rb +114 -0
  12. data/lib/kowl/generators/assets_generator.rb +188 -0
  13. data/lib/kowl/generators/base.rb +40 -0
  14. data/lib/kowl/generators/circleci_generator.rb +11 -0
  15. data/lib/kowl/generators/config_generator.rb +180 -0
  16. data/lib/kowl/generators/controller_generator.rb +64 -0
  17. data/lib/kowl/generators/database_generator.rb +42 -0
  18. data/lib/kowl/generators/decorators_generator.rb +16 -0
  19. data/lib/kowl/generators/docker_generator.rb +40 -0
  20. data/lib/kowl/generators/dotfiles_generator.rb +73 -0
  21. data/lib/kowl/generators/libs_generator.rb +19 -0
  22. data/lib/kowl/generators/mailer_generator.rb +58 -0
  23. data/lib/kowl/generators/misc_generator.rb +20 -0
  24. data/lib/kowl/generators/overrides/app_base.rb +15 -0
  25. data/lib/kowl/generators/overrides/app_builder.rb +58 -0
  26. data/lib/kowl/generators/overrides/app_generator.rb +249 -0
  27. data/lib/kowl/generators/pages_generator.rb +46 -0
  28. data/lib/kowl/generators/routes_generator.rb +20 -0
  29. data/lib/kowl/generators/sidekiq_generator.rb +31 -0
  30. data/lib/kowl/generators/staging_generator.rb +14 -0
  31. data/lib/kowl/generators/test_generator.rb +42 -0
  32. data/lib/kowl/generators/text_files_generator.rb +41 -0
  33. data/lib/kowl/generators/users_and_auth_generator.rb +143 -0
  34. data/lib/kowl/generators/uuid_generator.rb +39 -0
  35. data/lib/kowl/generators/views_and_helpers_generator.rb +104 -0
  36. data/lib/kowl/geodb.rb +96 -0
  37. data/lib/kowl/helpers.rb +139 -0
  38. data/lib/kowl/templates/Gemfile.erb.tt +253 -0
  39. data/lib/kowl/templates/README.md.erb +33 -0
  40. data/lib/kowl/templates/app/assets/javascripts/semantic.js.tt +26 -0
  41. data/lib/kowl/templates/app/assets/stylesheets/administrate/application.scss +44 -0
  42. data/lib/kowl/templates/app/assets/stylesheets/bootstrap/_custom_styling.scss +38 -0
  43. data/lib/kowl/templates/app/assets/stylesheets/bootstrap/application-mailer.scss +1 -0
  44. data/lib/kowl/templates/app/assets/stylesheets/bootstrap/application.scss +14 -0
  45. data/lib/kowl/templates/app/assets/stylesheets/bootstrap/components/_alerts.scss +7 -0
  46. data/lib/kowl/templates/app/assets/stylesheets/bootstrap/components/_errors.scss +28 -0
  47. data/lib/kowl/templates/app/assets/stylesheets/bootstrap/components/_navbar.scss +17 -0
  48. data/lib/kowl/templates/app/assets/stylesheets/bootstrap/variables.scss +6 -0
  49. data/lib/kowl/templates/app/assets/stylesheets/semantic/_custom_styling.scss +20 -0
  50. data/lib/kowl/templates/app/assets/stylesheets/semantic/application.scss +24 -0
  51. data/lib/kowl/templates/app/controllers/admin/application_controller.rb +29 -0
  52. data/lib/kowl/templates/app/controllers/admin/login_activities_controller.rb +29 -0
  53. data/lib/kowl/templates/app/controllers/admin/users_controller.rb +37 -0
  54. data/lib/kowl/templates/app/controllers/concerns/auth/authentication.rb +18 -0
  55. data/lib/kowl/templates/app/controllers/concerns/auth/authorization.rb +20 -0
  56. data/lib/kowl/templates/app/controllers/concerns/auth/error_handlers.rb +27 -0
  57. data/lib/kowl/templates/app/controllers/concerns/noauth/error_handlers.rb +25 -0
  58. data/lib/kowl/templates/app/controllers/users_controller.rb +17 -0
  59. data/lib/kowl/templates/app/dashboards/login_activity_dashboard.rb.tt +59 -0
  60. data/lib/kowl/templates/app/dashboards/rich_text_body_dashboard.rb.tt +17 -0
  61. data/lib/kowl/templates/app/dashboards/user_dashboard.rb.tt +60 -0
  62. data/lib/kowl/templates/app/fields/gravatar_field.rb +10 -0
  63. data/lib/kowl/templates/app/fields/rich_text_area_field.rb +8 -0
  64. data/lib/kowl/templates/app/inputs/rich_text_area_input.rb +11 -0
  65. data/lib/kowl/templates/app/javascript/administrate/components/date_time_picker.js.tt +32 -0
  66. data/lib/kowl/templates/app/javascript/administrate/components/table.js.tt +49 -0
  67. data/lib/kowl/templates/app/javascript/administrate/index.js +3 -0
  68. data/lib/kowl/templates/app/javascript/packs/administrate.js.tt +21 -0
  69. data/lib/kowl/templates/app/javascript/packs/semantic.js +11 -0
  70. data/lib/kowl/templates/app/mailers/application_mailer.rb +7 -0
  71. data/lib/kowl/templates/app/mailers/devise_mailer.rb +5 -0
  72. data/lib/kowl/templates/app/models/login_activity.rb.tt +29 -0
  73. data/lib/kowl/templates/app/models/user.rb.tt +72 -0
  74. data/lib/kowl/templates/app/policies/application_policy.rb +38 -0
  75. data/lib/kowl/templates/app/policies/login_activity_policy.rb +35 -0
  76. data/lib/kowl/templates/app/policies/user_policy.rb +43 -0
  77. data/lib/kowl/templates/app/views/admin/templates/navigation.erb.tt +23 -0
  78. data/lib/kowl/templates/app/views/admin/views/application/_javascript.html.erb +21 -0
  79. data/lib/kowl/templates/app/views/admin/views/users/_collection.html.erb +102 -0
  80. data/lib/kowl/templates/app/views/admin/views/users/_form.html.erb +46 -0
  81. data/lib/kowl/templates/app/views/admin/views/users/edit.html.erb +36 -0
  82. data/lib/kowl/templates/app/views/admin/views/users/index.html.erb +66 -0
  83. data/lib/kowl/templates/app/views/fields/gravatar_field/_form.html.erb +6 -0
  84. data/lib/kowl/templates/app/views/fields/gravatar_field/_index.html.erb +1 -0
  85. data/lib/kowl/templates/app/views/fields/gravatar_field/_show.html.erb +1 -0
  86. data/lib/kowl/templates/app/views/fields/rich_text_area_field/_form.html.erb +6 -0
  87. data/lib/kowl/templates/app/views/fields/rich_text_area_field/_index.html.erb +1 -0
  88. data/lib/kowl/templates/app/views/fields/rich_text_area_field/_show.html.erb +1 -0
  89. data/lib/kowl/templates/app/views/layouts/admin.html.erb.tt +47 -0
  90. data/lib/kowl/templates/app/views/layouts/devise_mailer.html.erb +14 -0
  91. data/lib/kowl/templates/app/views/pages/welcome/bootstrap.html.erb +18 -0
  92. data/lib/kowl/templates/app/views/pages/welcome/bootstrap.html.haml +17 -0
  93. data/lib/kowl/templates/app/views/pages/welcome/bootstrap.html.slim +17 -0
  94. data/lib/kowl/templates/app/views/pages/welcome/default.html.erb +0 -0
  95. data/lib/kowl/templates/app/views/pages/welcome/default.html.haml +0 -0
  96. data/lib/kowl/templates/app/views/pages/welcome/default.html.slim +0 -0
  97. data/lib/kowl/templates/app/views/pages/welcome/semantic.html.erb +20 -0
  98. data/lib/kowl/templates/app/views/pages/welcome/semantic.html.haml +17 -0
  99. data/lib/kowl/templates/app/views/pages/welcome/semantic.html.slim +17 -0
  100. data/lib/kowl/templates/app/views/shared/footer/bootstrap.html.erb.tt +5 -0
  101. data/lib/kowl/templates/app/views/shared/footer/bootstrap.html.haml.tt +3 -0
  102. data/lib/kowl/templates/app/views/shared/footer/bootstrap.html.slim.tt +3 -0
  103. data/lib/kowl/templates/app/views/shared/footer/semantic.html.erb.tt +7 -0
  104. data/lib/kowl/templates/app/views/shared/footer/semantic.html.haml.tt +5 -0
  105. data/lib/kowl/templates/app/views/shared/footer/semantic.html.slim.tt +5 -0
  106. data/lib/kowl/templates/app/views/shared/navigation/bootstrap.html.erb.tt +51 -0
  107. data/lib/kowl/templates/app/views/shared/navigation/bootstrap.html.haml.tt +36 -0
  108. data/lib/kowl/templates/app/views/shared/navigation/bootstrap.html.slim.tt +36 -0
  109. data/lib/kowl/templates/app/views/shared/navigation/semantic.html.erb.tt +48 -0
  110. data/lib/kowl/templates/app/views/shared/navigation/semantic.html.haml.tt +36 -0
  111. data/lib/kowl/templates/app/views/shared/navigation/semantic.html.slim.tt +36 -0
  112. data/lib/kowl/templates/app/workers/scheduler/pghero_scheduler.rb +11 -0
  113. data/lib/kowl/templates/config/autoprefixer.yml +4 -0
  114. data/lib/kowl/templates/config/db/mysql.yml.tt +43 -0
  115. data/lib/kowl/templates/config/db/oracle.yml.tt +29 -0
  116. data/lib/kowl/templates/config/db/postgresql.yml.tt +37 -0
  117. data/lib/kowl/templates/config/db/sqlite3.yml.tt +20 -0
  118. data/lib/kowl/templates/config/db/sqlserver.yml.tt +28 -0
  119. data/lib/kowl/templates/config/initializers/administrate.rb.tt +9 -0
  120. data/lib/kowl/templates/config/initializers/bullet.rb +21 -0
  121. data/lib/kowl/templates/config/initializers/devise-security.rb +44 -0
  122. data/lib/kowl/templates/config/initializers/devise_argon2.rb +29 -0
  123. data/lib/kowl/templates/config/initializers/faker.rb +6 -0
  124. data/lib/kowl/templates/config/initializers/generators.rb.tt +31 -0
  125. data/lib/kowl/templates/config/initializers/geocoder.rb +10 -0
  126. data/lib/kowl/templates/config/initializers/letter_opener.rb +13 -0
  127. data/lib/kowl/templates/config/initializers/lockbox.rb +11 -0
  128. data/lib/kowl/templates/config/initializers/logging.rb +6 -0
  129. data/lib/kowl/templates/config/initializers/lograge.rb +7 -0
  130. data/lib/kowl/templates/config/initializers/logstop.rb +4 -0
  131. data/lib/kowl/templates/config/initializers/middleware.rb +9 -0
  132. data/lib/kowl/templates/config/initializers/oj.rb +7 -0
  133. data/lib/kowl/templates/config/initializers/pagy.rb.tt +16 -0
  134. data/lib/kowl/templates/config/initializers/postmark.rb +8 -0
  135. data/lib/kowl/templates/config/initializers/rack_attack.rb.tt +71 -0
  136. data/lib/kowl/templates/config/initializers/sass.rb +5 -0
  137. data/lib/kowl/templates/config/initializers/sidekiq.rb +11 -0
  138. data/lib/kowl/templates/config/initializers/simpleform/semantic.rb +225 -0
  139. data/lib/kowl/templates/config/initializers/slim.rb +6 -0
  140. data/lib/kowl/templates/config/initializers/sparkpost.rb +13 -0
  141. data/lib/kowl/templates/config/routes.rb.tt +28 -0
  142. data/lib/kowl/templates/config/sidekiq.yml.tt +17 -0
  143. data/lib/kowl/templates/db/migrations/create_action_text_tables.action_text.rb.tt +16 -0
  144. data/lib/kowl/templates/db/migrations/create_active_storage_tables.active_storage.rb.tt +29 -0
  145. data/lib/kowl/templates/db/migrations/devise.rb.tt +59 -0
  146. data/lib/kowl/templates/db/migrations/login_activities.rb.tt +41 -0
  147. data/lib/kowl/templates/db/seeds.rb.tt +14 -0
  148. data/lib/kowl/templates/docker/Dockerfile.alpine.tt +92 -0
  149. data/lib/kowl/templates/docker/Dockerfile.debian.tt +133 -0
  150. data/lib/kowl/templates/docker/docker-compose.yml.tt +55 -0
  151. data/lib/kowl/templates/docker/mysql/Dockerfile.tt +15 -0
  152. data/lib/kowl/templates/dotfiles/Aptfile.tt +34 -0
  153. data/lib/kowl/templates/dotfiles/Brewfile.tt +49 -0
  154. data/lib/kowl/templates/dotfiles/Procfile.tt +12 -0
  155. data/lib/kowl/templates/dotfiles/codeclimate.yml +76 -0
  156. data/lib/kowl/templates/dotfiles/coffeelint.json +10 -0
  157. data/lib/kowl/templates/dotfiles/coffeelintignore +15 -0
  158. data/lib/kowl/templates/dotfiles/dockerignore +23 -0
  159. data/lib/kowl/templates/dotfiles/editorconfig +13 -0
  160. data/lib/kowl/templates/dotfiles/env.tt +58 -0
  161. data/lib/kowl/templates/dotfiles/erb-lint.yml +10 -0
  162. data/lib/kowl/templates/dotfiles/erdconfig.tt +24 -0
  163. data/lib/kowl/templates/dotfiles/eslintignore +20 -0
  164. data/lib/kowl/templates/dotfiles/eslintrc.js +31 -0
  165. data/lib/kowl/templates/dotfiles/fasterer.yml +14 -0
  166. data/lib/kowl/templates/dotfiles/foreman +1 -0
  167. data/lib/kowl/templates/dotfiles/gitattributes +15 -0
  168. data/lib/kowl/templates/dotfiles/gitignore +69 -0
  169. data/lib/kowl/templates/dotfiles/haml-lint.yml +23 -0
  170. data/lib/kowl/templates/dotfiles/jsbeautifyrc +15 -0
  171. data/lib/kowl/templates/dotfiles/jshintrc +3 -0
  172. data/lib/kowl/templates/dotfiles/mailmap +3 -0
  173. data/lib/kowl/templates/dotfiles/nvmrc +1 -0
  174. data/lib/kowl/templates/dotfiles/prettierignore +21 -0
  175. data/lib/kowl/templates/dotfiles/prettierrc.js +62 -0
  176. data/lib/kowl/templates/dotfiles/pryrc +7 -0
  177. data/lib/kowl/templates/dotfiles/rspec +3 -0
  178. data/lib/kowl/templates/dotfiles/rubocop.yml.tt +78 -0
  179. data/lib/kowl/templates/dotfiles/scss-lint.yml +132 -0
  180. data/lib/kowl/templates/dotfiles/simplecov +19 -0
  181. data/lib/kowl/templates/dotfiles/slim-lint.yml +23 -0
  182. data/lib/kowl/templates/dotfiles/slugignore +10 -0
  183. data/lib/kowl/templates/dotfiles/yamllint +7 -0
  184. data/lib/kowl/templates/dotfiles/yarnclean +46 -0
  185. data/lib/kowl/templates/lib/tasks/stats.rake +42 -0
  186. data/lib/kowl/templates/tests/factories/README.md +0 -0
  187. data/lib/kowl/templates/tests/factories/login_activity.rb +11 -0
  188. data/lib/kowl/templates/tests/factories/user.rb +11 -0
  189. data/lib/kowl/templates/tests/minitest/README.md +3 -0
  190. data/lib/kowl/templates/tests/minitest/application_system_test_case.rb +7 -0
  191. data/lib/kowl/templates/tests/minitest/controllers/pages_controller_test.rb +10 -0
  192. data/lib/kowl/templates/tests/minitest/models/login_activity_test.rb +8 -0
  193. data/lib/kowl/templates/tests/minitest/models/user_test.rb +15 -0
  194. data/lib/kowl/templates/tests/minitest/policies/login_activity_policy_test.rb +7 -0
  195. data/lib/kowl/templates/tests/minitest/policies/user_policy_test.rb +7 -0
  196. data/lib/kowl/templates/tests/minitest/support/capybara.rb +38 -0
  197. data/lib/kowl/templates/tests/minitest/support/database_cleaner.rb +20 -0
  198. data/lib/kowl/templates/tests/minitest/support/database_cleaner_support.rb +15 -0
  199. data/lib/kowl/templates/tests/minitest/support/deferred_garbage_collection.rb +21 -0
  200. data/lib/kowl/templates/tests/minitest/support/devise.rb +16 -0
  201. data/lib/kowl/templates/tests/minitest/support/factories.rb +6 -0
  202. data/lib/kowl/templates/tests/minitest/support/formulaic.rb +8 -0
  203. data/lib/kowl/templates/tests/minitest/support/helpers/devise_helper.rb +57 -0
  204. data/lib/kowl/templates/tests/minitest/support/papertrail.rb +17 -0
  205. data/lib/kowl/templates/tests/minitest/support/pundit.rb +0 -0
  206. data/lib/kowl/templates/tests/minitest/support/shoulda.rb +11 -0
  207. data/lib/kowl/templates/tests/minitest/support/simplecov.rb +8 -0
  208. data/lib/kowl/templates/tests/minitest/test_helper.rb +17 -0
  209. data/lib/kowl/templates/tests/rspec/README.md +9 -0
  210. data/lib/kowl/templates/tests/rspec/controllers/admin/application_controller_spec.rb +12 -0
  211. data/lib/kowl/templates/tests/rspec/controllers/admin/users_controller_spec.rb +14 -0
  212. data/lib/kowl/templates/tests/rspec/controllers/pages_controller_spec.rb +10 -0
  213. data/lib/kowl/templates/tests/rspec/features/README.md +15 -0
  214. data/lib/kowl/templates/tests/rspec/features/visitor_sign_up_spec.rb +25 -0
  215. data/lib/kowl/templates/tests/rspec/helpers/application_helper_spec.rb +7 -0
  216. data/lib/kowl/templates/tests/rspec/helpers/pages_helper_spec.rb +15 -0
  217. data/lib/kowl/templates/tests/rspec/models/login_activity_spec.rb +11 -0
  218. data/lib/kowl/templates/tests/rspec/models/user_spec.rb +21 -0
  219. data/lib/kowl/templates/tests/rspec/policies/login_activity_policy_spec.rb +59 -0
  220. data/lib/kowl/templates/tests/rspec/policies/user_policy_spec.rb +56 -0
  221. data/lib/kowl/templates/tests/rspec/rails_helper.rb +72 -0
  222. data/lib/kowl/templates/tests/rspec/requests/pages_spec.rb +11 -0
  223. data/lib/kowl/templates/tests/rspec/spec_helper.rb +96 -0
  224. data/lib/kowl/templates/tests/rspec/support/bullet.rb +17 -0
  225. data/lib/kowl/templates/tests/rspec/support/capybara.rb +37 -0
  226. data/lib/kowl/templates/tests/rspec/support/controller_testing.rb +10 -0
  227. data/lib/kowl/templates/tests/rspec/support/database_cleaner.rb +55 -0
  228. data/lib/kowl/templates/tests/rspec/support/deferred_garbage_collection.rb +32 -0
  229. data/lib/kowl/templates/tests/rspec/support/devise.rb +21 -0
  230. data/lib/kowl/templates/tests/rspec/support/factories.rb +5 -0
  231. data/lib/kowl/templates/tests/rspec/support/formulaic.rb +8 -0
  232. data/lib/kowl/templates/tests/rspec/support/helpers/devise_helpers.rb +56 -0
  233. data/lib/kowl/templates/tests/rspec/support/papertrail.rb +5 -0
  234. data/lib/kowl/templates/tests/rspec/support/pi_ci.rb +6 -0
  235. data/lib/kowl/templates/tests/rspec/support/pundit.rb +6 -0
  236. data/lib/kowl/templates/tests/rspec/support/shoulda.rb +10 -0
  237. data/lib/kowl/templates/tests/rspec/support/sidekiq.rb +10 -0
  238. data/lib/kowl/templates/tests/rspec/support/simplecov.rb +7 -0
  239. data/lib/kowl/templates/tests/rspec/support/warden.rb +8 -0
  240. data/lib/kowl/templates/text_files/AUTHORS.md +4 -0
  241. data/lib/kowl/templates/text_files/CHANGELOG.md.tt +12 -0
  242. data/lib/kowl/templates/text_files/CODE_OF_CONDUCT.md +76 -0
  243. data/lib/kowl/templates/text_files/TODO.md +7 -0
  244. data/lib/kowl/templates/text_files/VERSION +1 -0
  245. data/lib/kowl/templates/text_files/humans.txt.tt +15 -0
  246. data/lib/kowl/templates/text_files/robots.txt.tt +6 -0
  247. data/lib/kowl/templates/text_files/security.txt +6 -0
  248. data/lib/kowl/version.rb +9 -0
  249. data/lib/kowl.rb +18 -0
  250. metadata +404 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 37b79c3271568b76ecec53940a1c57cb99746d520b5a6f6ab5cf9f9e8cca7c35
4
+ data.tar.gz: 48292531cc963a910fdf60b85018b3536c828553206f5a92a985fca5691979d6
5
+ SHA512:
6
+ metadata.gz: 60023e7a74732f0b65e5d120f3dce0ec2157d2eee1a5d2b8a4bd099d37d42dc61f2dbb0d57eac23f9fb6170a3cf05d5091bc229a9ad5a5abb5cff5552e2dc9a0
7
+ data.tar.gz: 985cd1a6d89df7bf30c11595babd094f3ce5f9af66bad9a0eaa69be168798337dfd324f59e130dc7636df42777bd312dc25c5bc063d9fcf816dee571cdc3da2c
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2020 Brandon Hicks
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,383 @@
1
+ [![Contributors][contributors-shield]][contributors-url]
2
+ [![Forks][forks-shield]][forks-url]
3
+ [![Stargazers][stars-shield]][stars-url]
4
+ [![Issues][issues-shield]][issues-url]
5
+ [![MIT License][license-shield]][license-url]
6
+
7
+ [![Kowl][rubygems-downloads]][rubygems-link]
8
+ [![Gem Version][rubygems-version]][rubygems-link]
9
+
10
+ <br />
11
+ <p align="center">
12
+ <a href="https://github.com/tarellel/kowl">
13
+ <img src="docs/images/cover.png" alt="Kowl Header Image">
14
+ </a>
15
+ <h3 align="center">Kowl (Ruby gem)</h3>
16
+ <p align="center">
17
+ Kowl is a Rails <em>(v6.*)</em> based <em>opinionated</em> application generator used to get started quick. It's purpose is so you can focus on building your application rather spending days setting up the basic gems every time.
18
+ <br /><br />
19
+ · <a href="https://github.com/tarellel/kowl/issues">Report Bug</a>
20
+ · <a href="https://github.com/tarellel/kowl/issues">Request Feature</a>
21
+ </p>
22
+ </p>
23
+
24
+ ## Table of Contents
25
+
26
+ * [About the Project](#about-the-project)
27
+ * [Getting Started](#getting-started)
28
+ * [Prerequisites](#prerequisites)
29
+ * [Installation](#installation)
30
+ * [Usage](#usage)
31
+ * [Gems](#gems)
32
+ * [Notes](#notes)
33
+ * [Roadmap](#roadmap)
34
+ * [Contributing](#contributing)
35
+ * [License](#license)
36
+ * [Contact](#contact)
37
+ * [Acknowledgements](#acknowledgements)
38
+
39
+ ## About The Project
40
+
41
+ Kowl is tool to easily generate a Rails (~> 6) application with a number of configurations, templates, and generators applied.
42
+ That way your're not spending days running through gems and documentation to get an application setup.
43
+ (This can include setting up bootstrap, devise, sidekiq, linters, dockerizing your application, and various other steps)
44
+
45
+ ## Getting Started
46
+
47
+ To get a local copy up and running follow these simple steps.
48
+
49
+ ### Prerequisites
50
+
51
+ Requires a minimum of:
52
+
53
+ * `Ruby >= 2.5`
54
+ * `Rails >= 2.6`
55
+
56
+ ```shell
57
+ # If using RVM
58
+ rvm install 2.6.5
59
+ rvm use 2.6.5 --default
60
+ ```
61
+
62
+ ### Installation
63
+
64
+ **1.** Install the required dependencies
65
+
66
+ Depending on the options you want to use when generating an application your dependencies will vary.
67
+
68
+ * `autogen autoconf cmake libtool make v8` - For nokogiri, sassc, and various C based ruby gems.
69
+ * `docker` - If you want to build a docker image using the application specific generated Dockerfile.
70
+ * `git` - Is generally required for installing rubygems anyways.
71
+ * `graphviz` - For generating an applications [ERD](https://github.com/voormedia/rails-erd) (unless you skip generating an ERD for your application `--skip_erd`)
72
+ * `jemalloc` - _**Optional**_, but helps with improving rubies memory allocation. (If using RVM you can install a ruby version to utilize jemalloc using: `rvm install 2.6.5 -C --with-jemalloc`)
73
+ * `imagemagick` - If you plan on using ActionText/Trix you'll want `imagemagick` or `vips` for processing image uploads
74
+ * `libsodium` - If you wish to encrypt particular PII user attributes (using the [lockbox gem](https://github.com/ankane/lockbox) by generating an application with the encrypt flag `--encrypt`)
75
+ * `node && yarn` - Generally any new rails app requires node and yarn for installing and transpiling JS dependencies.
76
+
77
+ Dependant on the database your application will be using, you'll also need to install their required C adapters
78
+
79
+ * PostgreSQL - `postgresql`
80
+ * Oracle - `instantclient-basic && instantclient-sdk`
81
+
82
+ ```shell
83
+ brew update
84
+ brew tap InstantClientTap/instantclient
85
+
86
+ brew install instantclient-basic instantclient-sdk
87
+ ```
88
+
89
+ * SQLserver - `freetds`
90
+
91
+ **2.** Install ruby gem
92
+
93
+ ```bash
94
+ gem install kowl
95
+ ```
96
+
97
+ ## Usage
98
+
99
+ ```shell
100
+ Usage:
101
+ kowl AppName
102
+
103
+ Options:
104
+ -d [--database=DATABASE] # If you want to use a specific database for the application (builds with sqlite3 until you are ready)
105
+ # Default: sqlite3
106
+ [--docker_distro=DISTRO] # Specify what docker distro to use for the application (alpine, debian)
107
+ # Default: alpine (If you specify to use Oracle your distro will default to Debian)
108
+ [--encrypt] # If you want encrypt various user data (using lockbox)? (For GDPR compliance)
109
+ # Default: false (This requires you to install libsodium in order to encrypt the user data)
110
+ [--framework=CSSFRAMEWORK] # If you want to generate views using a specific CSS framework (bootstrap, semantic, none)
111
+ # Default: bootstrap
112
+ [--git_repo=REPO_NAME] # If you've already created a gitlab repo, specify the repo and and it will be added.
113
+ # ie: https://github/username/REPO_NAME.git
114
+ # Default: nil
115
+ [--mailer=MAILER] # Which transactional mailer you want to use in production (postmark or sparkpost)?
116
+ # Default: sparkpost (unless you specify to --skip_mailer, than neither will be used)
117
+ [--noauth] # If you would like to skip adding devise and pundit to the application
118
+ # Default: false
119
+ [--simpleform] # Do you want your application to use simpleform to generate forms
120
+ # Default: false
121
+ [--skip_docker] # If you want your application to skip generating any docker files (Dockerfile, docker-compose.yml, and .dockerignore)
122
+ # Default: false
123
+ [--skip_erd] # If you want to skip generating an ERD for your application (requires graphviz to be installed)
124
+ # Default: false
125
+ -G [--skip_git] # Do you want the generator to skip creating initializing and commit files to git
126
+ # Default: false
127
+ [--skip_javascript] # Skip adding javascript (webpacker) to the application
128
+ # Default: false
129
+ [--skip_mailer] # Do you want to skip setting up a
130
+ # Default: false
131
+ [--skip_pagination] # Do you want to skip using pagination with your application?
132
+ # Default: false
133
+ [--skip_pry] # Do you want to skip using pry with your applications rails console?
134
+ # Default: false
135
+ [--skip_sidekiq] # Do you want to skip setting up sidekiq (for background jobs, mailers, etc.)
136
+ # Default: false
137
+ [--skip_spring] # If you hate spring and want to skip using it with your application.
138
+ # Default: false
139
+ -T [--skip_tests] # Do you want your application to skip building with tests
140
+ # Default: false
141
+ [--skip_turbolinks] # If you want to skip adding turbolinks to your applications assets
142
+ # Default: false
143
+ [--template_engine=ENGINE] # Assign a template_engine to use for the applications views (erb, slim, haml)
144
+ # Default: erb
145
+ [--test_engine=TEST_ENGINE] # If you want to generate the application using a specific test suite (minitest, RSpec, none)
146
+ # Default: rspec
147
+ [--uuid] # Enable setting as database primary keys as UUIDs (Only while using PostgreSQL)
148
+ # Default: false (NOTE: This feature is still under development)
149
+ -W [--webpack=JSFRAMEWORK] # If you want initialize to webpacker with a specific JS framework (react vue angular elm stimulus)
150
+ # Default: nil
151
+ ```
152
+
153
+ **Examples:**
154
+
155
+ `kowl AppName`
156
+
157
+ Generate an application using sqlite3, with a name of "AppName", requiring authentication, using RSpec, and using bootstrap.
158
+
159
+ `kowl AppName --database=oracle --simpleform --noauth`
160
+
161
+ This will generate an application using the Oracle database, using simple_form, and not requiring any sort of authentication (anyone can hit this app.)
162
+
163
+ `kowl AppName --simpleform --template_engine=slim`
164
+
165
+ This will generate an application defaulting to sqlite3, using simple_form, the Slim template engine, with pagination, and requiring authentication to load the application.
166
+
167
+ `kowl AppName --simpleform --template_engine=slim --skip_tests`
168
+
169
+ Generate an application using sqlite3, using bootstrap CSS framework, using the slim template engine, and build without any tests.
170
+
171
+ `kowl AppName --git_repo=https://github/username/REPO_NAME.git`
172
+
173
+ Will generate an app with remote directory of https://github/username/REPO_NAME.git
174
+
175
+ `kowl foobar --template_engine=haml --simpleform --framework=semantic;`
176
+
177
+ This will generating an app with the HAML template engine, using simpleform, and using the Semantic UI CSS Framework
178
+
179
+ ### Walk-Throughts
180
+
181
+ * [#](/docs/actiontext.md) Create an application using simple_form and create posts scaffold and admin page that will use ActionText
182
+
183
+ ## Gems
184
+
185
+ The gems included in the applications Gemfile are dependant on options passed when generating an application.
186
+
187
+ #### Assets
188
+
189
+ * [autoprefixer-rails](https://github.com/ai/autoprefixer-rails) parse CSS and add vendor prefixes to CSS rules using values from the Can I Use database
190
+ * [font-awesome-sass](https://github.com/FortAwesome/font-awesome-sass) for including fontawesome in your applications CSS.
191
+ * [sass-rails](https://github.com/rails/sass-rails) integration for Ruby on Rails projects with the Sass stylesheet language
192
+ * Dependant on the framework specified, these gems will be used to generate scaffold, devise, and layout views.
193
+ * [bootstrap_views_generator](https://github.com/tarellel/bootstrap_views_generator) for generating [Bootstrap](https://getbootstrap.com/) based scaffold views, devise views, and layouts _.(also dependant on if you want to use pagination, simple_form, and/or what template engine you use)_.
194
+ * [semantic_ui_views_generator](https://github.com/tarellel/semantic_ui_views_generator) for generating [SemanticUI](https://semantic-ui.com/) based scaffold views, devise views, and layouts _.(also dependant on if you want to use pagination, simple_form, and/or what template engine you use)_.
195
+
196
+ #### Database gems
197
+
198
+ These gems are in addition to your applications required database adapters
199
+
200
+ * [bullet](https://github.com/flyerhzm/bullet) help to hunt down and catch N+1 queries throughout the application.
201
+ * [rails_erd](https://github.com/voormedia/rails-erd) used to generate Entity-Relationship Diagrams for Rails applications.
202
+ * [strong_migrations](https://github.com/ankane/strong_migrations) used to catch unsafe migrations in development
203
+ * If the application is generated to use postgresql as it's database.
204
+ * [pghero](https://github.com/ankane/pghero) a dashboard for monitor application query performance.
205
+ * [pg_query](https://github.com/lfittl/pg_query) allows you to normalize queries and parse these normalized queries.
206
+
207
+ #### Devise/Users
208
+
209
+ User gems that will be included unless the `--noauth` flag is specified when generating an application.
210
+
211
+ * [Argon2](https://github.com/technion/ruby-argon2) will be used for devise as as the devise encryption method _([based on Ankane's recommendations](https://ankane.org/devise-argon2))_
212
+ * [AuthTrail](https://github.com/ankane/authtrail) used to track Devise login activity.
213
+ * [Devise](https://github.com/heartcombo/devise) a flexible authentication solution build with rails in mind.
214
+ * [Devise-Security](https://github.com/devise-security/devise-security) used to enforce better security measures with devise.
215
+ * [MaxmindDB](https://github.com/yhirose/maxminddb) used for add getting GeoLocation details for the applications AuthTrail entries. The simplest and cheapest method to download the [GeoLite2](https://dev.maxmind.com/geoip/geoip2/geolite2/) database. _(MaxMind now requires you to login to download the geolocation database)_ Uncompress and put the geolocation database in `db/maxmind`.
216
+ * [Pretender](https://github.com/ankane/pretender) to login as another use with devise _(helps when developing various rolls and permissions)_.
217
+ * [Pundit](https://github.com/varvet/pundit) an authorization system build off a basic OOP pattern.
218
+ * [valid_email2](https://github.com/micke/valid_email2) an email validation library.
219
+
220
+ #### Mailers
221
+
222
+ * [bootstrap-email](https://bootstrapemail.com/) for cleaning up and formatting emails with bootstrap syntax (responsive and clean).
223
+ * [letter_opener](https://github.com/ryanb/letter_opener) to preview outgoing mails in your rails application.
224
+ * [letter_opener_web](https://github.com/fgrehm/letter_opener_web) a web interface for browsing all outbound emails.
225
+ * Dependant on the mailer you specified
226
+ * [postmark-rails](https://github.com/wildbit/postmark-rails) for sending transactional emails with [postmark](https://postmarkapp.com/).
227
+ * [sparkpost_rails](https://github.com/the-refinery/sparkpost_rails) for sending transactional emails with [sparkpost](https://www.sparkpost.com/).
228
+
229
+ #### Misc
230
+
231
+ * [active_decorator](https://github.com/amatsuda/active_decorator) OOP view helpers for cleaning up your models.
232
+ * [annotate](https://github.com/ctran/annotate_models) for adding a comment summarizing the current schema to models, routes, etc.
233
+ * [auto_strip_attributes](https://github.com/holli/auto_strip_attributes) remove unnecessary whitespace from ActiveRecord attributes.
234
+ * [fast_jsonapi](fast-jsonapi/fast_jsonapi) lightning fast JSON:API serializer (originally releases by [Netflix](https://github.com/Netflix/fast_jsonapi))
235
+ * [meta-tags](https://github.com/kpumuk/meta-tags) helpers for making SEO/meta-tags easier to manage with your rails application.
236
+ * [oj](http://www.ohler.com/oj/) a fast JSON object serializer.
237
+ * [simple_form](https://github.com/heartcombo/simple_form) a DSL for making forms easy to style and manage.
238
+ * [pagy](https://github.com/ddnexus/pagy) for lightening fast and easy to use pagination.
239
+ * Dependant on the `--template_engine` specified when generating an application.
240
+ * [haml-rails](https://github.com/haml/haml-rails) enables the [HAML](http://haml.info/) templaing engine and generators with your rails application.
241
+ * [slim-rails](https://github.com/slim-template/slim-rails) enables the [SLIM](http://slim-lang.com/) templating engine and generators with your rails application.
242
+ * [pry](https://github.com/pry/pry) a powerful IRB alternative.
243
+ * [pry-rails](https://github.com/rweng/pry-rails) a adapter to make it easy to use pry with a rails application.
244
+ * [spirit_hands](https://github.com/steakknife/spirit_hands) a opinionated console adapter for cleaning up your application output.
245
+
246
+
247
+ #### Performance
248
+
249
+ * [attendance](https://github.com/schneems/attendance) change the behavior of `present?` to prevent unnecessary SQL queries.
250
+ * [fast_blank](https://github.com/SamSaffron/fast_blank) a C extension which provides a fast implementation of Active Support's `String#blank?`.
251
+
252
+ #### Responses, Errors, and Security
253
+
254
+ * [dotenv-rails](https://github.com/bkeepers/dotenv) to enable loading of environment variables with `.env` files.
255
+ * [Rack-attack](https://github.com/kickstarter/rack-attack) Rack middleware for blocking & throttling
256
+ * [Slowpoke](https://github.com/ankane/slowpoke) timeout long running page requests.
257
+
258
+ #### Security and Logging
259
+
260
+ * [blind_index](https://github.com/ankane/blind_index) for search encrypted database fields.
261
+ * [lockbox](https://github.com/ankane/lockbox) for encrypting database fields when at rest.
262
+ * [rbnacl](https://github.com/RubyCrypto/rbnacl) a ruby adapter to enable using using libsodium (NaCl) for encryption.
263
+ * Logging
264
+ * [lograge](https://github.com/roidrage/lograge) is used to cleanup and tame Rails logs.
265
+ * [logstop](https://github.com/ankane/logstop) for filtering out a list of basic PII/PHI attributes from Application logs.
266
+
267
+ #### Sidekiq and Background Jobs
268
+
269
+ These gems will be included to setup sidekiq unless the `--skip_sidekiq` flag is used when generating an application.
270
+
271
+ * [hiredis](https://github.com/redis/hiredis-rb) a C adapter for connecting your application to a Redis datestore _(faster than the ruby redis library)_.
272
+ * [Sidekiq](https://github.com/mperham/sidekiq/)
273
+ * [Sidekiq-Failures](https://github.com/mhfs/sidekiq-failures/) to get a better view of what jobs are failing.
274
+ * [Sidekiq-Scheduler](https://moove-it.github.io/sidekiq-scheduler/) to schedule sidekiq jobs on a given interval.
275
+ * [Sidekiq-Status](https://github.com/utgarda/sidekiq-status) is sidekiq extension to get a better status report of all currently running jobs.
276
+
277
+ #### Linter gems included
278
+
279
+ * [brakeman](https://brakemanscanner.org/) a static code analyser to detect possible ruby/rails vulnerabilities.
280
+ * [bundler-audit](https://github.com/rubysec/bundler-audit) used to check andd verify if any of the applications gems have known updates/vulnerabilities.
281
+ * [rails_best_practices](https://github.com/flyerhzm/rails_best_practices) a code metric tool to check the quality of Rails code.
282
+ * Rubocop
283
+ * [rubocop](https://github.com/rubocop-hq/rubocop/) A Ruby static code analyzer and formatter based of the [Ruby style guide](https://rubystyle.guide/).
284
+ * [rubocop-performance](https://github.com/rubocop-hq/rubocop-performance/) an extension of RuboCop focused on code performance checks.
285
+ * [rubocop-rails](https://github.com/rubocop-hq/rubocop-rails/) a RuboCop extension focused on enforcing Rails best practices and coding conventions.
286
+ * Dependant on the test_engine you specified to use when generating the application
287
+ * [rubocop-minitest](https://github.com/rubocop-hq/rubocop-minitest) a Rubocop extension focused on enforcing Minitest best practices and coding conventions
288
+ * [rubocop-rspec](https://github.com/rubocop-hq/rubocop-rspec) a Rubocop extension focused on enforcing Rspec best practices.
289
+ * [scss_lint](https://github.com/sds/scss-lint) is linter to help you keep your SCSS/SASS clean and readable.
290
+ * [rubycritic](https://github.com/whitesmith/rubycritic) a Ruby code quality reporter.
291
+ * Dependant on the template engine you specified to use
292
+ * [erb_lint](https://github.com/Shopify/erb-lint) a linter to validate you're writing clean and valid erbs views
293
+ * [haml_lint](https://github.com/sds/haml-lint) a linter to validate you're writing clean and valid haml views
294
+ * [slim_lint](https://github.com/sds/slim-lint) a linter to validate you're writing clean and valid slims views
295
+
296
+ #### Test gems included _(dependant on test_engine used)_
297
+
298
+ * [Database Cleaner](https://github.com/DatabaseCleaner/database_cleaner) for flushing databases as you run tests
299
+ * [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) a fixtures replacement for generating sample data with tests.
300
+ * [faker](https://github.com/faker-ruby/faker) for generating sample data for your appliaction or tests.
301
+ * [rails-controller-testing](https://github.com/rails/rails-controller-testing) added to add additional methods for controller integration tests.
302
+ * [shoulda](https://github.com/thoughtbot/shoulda) helps you write understandable, maintainable Rails-specific tests. _(also contains [shoulda-matchers](https://matchers.shoulda.io/) and [should-context](https://github.com/thoughtbot/shoulda-context))_
303
+ * [simplecov](https://github.com/colszowka/simplecovs) for generating a code coverage report when running tests.
304
+ * [test-prof](https://test-prof.evilmartians.io/#/) helps with application test profiling and performance stats.
305
+ * [timecop](https://github.com/travisjeffery/timecop) used to run time bases tests across your application
306
+ * Integration Testing
307
+ - [capybara](https://github.com/teamcapybara/capybara) a test framework to make building integration tests easy to get started with.
308
+ - [selenium-webdriver](https://github.com/SeleniumHQ/selenium) a webdriver to make running selenium based tests easier to build.
309
+ - [webdrivers](https://github.com/titusfortner/webdrivers) used to selenium based tests against your application to simulaet actual user requests.
310
+
311
+ ##### MiniTest
312
+
313
+ * [minitest](https://github.com/seattlerb/minitest) a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.
314
+ * [minitest-reporters](https://github.com/kern/minitest-reporters) customizable output for minitest results.
315
+
316
+ ##### Rspec
317
+
318
+ * [formulaic](https://github.com/thoughtbot/formulaic) allows you to perform easier form testing with Capybara
319
+ * [fuubar](https://github.com/thekompanee/fuubar) a progressbar to display when running rspec tests.
320
+ * [pig-ci-rails](https://github.com/PigCI/pig-ci-rails) For displaying application memory metrics while running tests
321
+ * [pundit-matchers](https://github.com/chrisalley/pundit-matchers) matchers for testing Pundit authorisation policies. _(unless you generate your app with `--noauth`)_
322
+ * [rspec-rails](https://github.com/rspec/rspec-rails) easily include rspec with a rails application.
323
+ * [rspec-sidekiq](https://github.com/philostler/rspec-sidekiq) a collection of methods to assist with create tests for Sidekiq workers _(unless you specific to `--skip_sidekiq`)_
324
+
325
+ If using ruby `>= 2.7` it also includes `e2mmap` and `thwait` to prevent ruby dependency errors.
326
+
327
+ ## Additonal Stuff
328
+
329
+ * When using this gem to generate applications it changes the devise password encrypting from bcrypt to [Argon2](https://cryptobook.nakov.com/mac-and-key-derivation/argon2)
330
+ * When generating application Dockerfiles it defaults to using [Alpine](https://alpinelinux.org/) which will produce smaller docker images. But if applications are specified to use Oracle as the database it will default to [Debian](https://www.debian.org/) _(due to the required dependencies to use the [Oracle InstantClient](https://www.oracle.com/database/technologies/instant-client.html))_.
331
+ * The `--encrypt` flag is used to enforce [GDPR](https://gdprchecklist.io/) and [CCPA](https://oag.ca.gov/privacy/ccpa) compliance to encrypt PII for users. _([GDPR Article 34, Section 3 (a)](https://gdpr-info.eu/art-34-gdpr/))_ By encrypting user identifiable information; this ensurers PII isn't plain text readable by hackers in case there is a data breach with the application. When encrypting user data it will use the [lockbox](https://github.com/ankane/lockbox) with the [xsalsa20](https://en.wikipedia.org/wiki/Salsa20) algorithm which requires [libsodium](https://libsodium.gitbook.io/doc/).
332
+ * When using javascript/webpacker not only will it gzip js assets, it will also compress assets with brotli and zopfli compression.
333
+ * A number of linter dotfiles added so you don't have to hunt down how they are setup.
334
+
335
+ ## Notes
336
+
337
+ * If looking to build a secure rails application I would begin by reading Ankane's article [Securing Sensitive Data in Rails](https://ankane.org/sensitive-data-rails) for some basic for rails security best practices.
338
+
339
+
340
+ ## Roadmap
341
+
342
+ See the [open issues](https://github.com/tarellel/kowl/issues) for a list of proposed features (and known issues).
343
+
344
+ ## Contributing
345
+
346
+ Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
347
+
348
+ 1. Fork the Project
349
+ 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
350
+ 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
351
+ 4. Push to the Branch (`git push origin feature/AmazingFeature`)
352
+ 5. Open a Pull Request
353
+
354
+ ## License
355
+
356
+ Distributed under the MIT License. See `LICENSE` for more information.
357
+
358
+ ## Contact
359
+
360
+ Brandon Hicks ([@tarellel](https://twitter.com/tarellel))
361
+
362
+ Project Link: [https://github.com/tarellel/kowl](https://github.com/tarellel/kowl)
363
+
364
+ ## Acknowledgements
365
+
366
+ * [@ankane](https://github.com/ankane) - For various rails related security [recommendations](https://ankane.org/sensitive-data-rails)
367
+
368
+ [contributors-shield]: https://img.shields.io/github/contributors/tarellel/kowl.svg?style=flat-square
369
+ [contributors-url]: https://github.com/tarellel/kowl/graphs/contributors
370
+ [forks-shield]: https://img.shields.io/github/forks/tarellel/kowl.svg?style=flat-square
371
+ [forks-url]: https://github.com/tarellel/kowl/network/members
372
+ [stars-shield]: https://img.shields.io/github/stars/tarellel/kowl.svg?style=flat-square
373
+ [stars-url]: https://github.com/tarellel/kowl/stargazers
374
+ [issues-shield]: https://img.shields.io/github/issues/tarellel/kowl.svg?style=flat-square
375
+ [issues-url]: https://github.com/tarellel/kowl/issues
376
+ [license-shield]: https://img.shields.io/github/license/tarellel/kowl.svg?style=flat-square
377
+ [license-url]: https://github.com/tarellel/kowl/blob/master/LICENSE.txt
378
+ [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
379
+ [product-screenshot]: docs/images/cover.png
380
+
381
+ [rubygems-downloads]: https://ruby-gem-downloads-badge.herokuapp.com/kowl?type=total
382
+ [rubygems-link]: https://rubygems.org/gems/kowl
383
+ [rubygems-version]: https://badge.fury.io/rb/kowl.svg
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'kowl'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require 'pry'
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start(__FILE__)
data/bin/kowl ADDED
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ source_path = (Pathname.new(__FILE__).dirname + '../lib').expand_path
4
+ $LOAD_PATH << source_path
5
+
6
+ # require is down here, so files won't be loaded if the kowl command has failed to reach this point
7
+ require 'kowl'
8
+
9
+ if ARGV.empty?
10
+ puts "\e[31mPlease provide a name for the new application.\e[0m"
11
+ puts "\nSee --help for more info\n"
12
+ exit 0
13
+ elsif ['-h', '--help'].include? ARGV[0]
14
+ help_output = <<~HELPSTR
15
+ Usage:
16
+ kowl AppName
17
+
18
+ Options:
19
+ -d [#{highlight('--database=DATABASE')}] # If you want to use a specific database for the application (builds with sqlite3 until you are ready)
20
+ # #{dh('Default: sqlite3')}
21
+ [#{highlight('--docker_distro=DISTRO')}] # Specify what docker distro to use for the application (alpine, debian)
22
+ # #{dh('Default: alpine')} \e[33m(If you specify to use Oracle your distro will default to Debian)\e[0m
23
+ [#{highlight('--encrypt')}] # If you want encrypt various user data (using lockbox)? (For GDPR compliance)
24
+ # #{dh('Default: false')} \e[33m(This requires you to install libsodium in order to encrypt the user data)\e[0m
25
+ [#{highlight('--framework=CSSFRAMEWORK')}] # If you want to generate views using a specific CSS framework (bootstrap, semantic, none)
26
+ # #{dh('Default: bootstrap')}
27
+ [#{highlight('--git_repo=REPO_NAME')}] # If you've already created a gitlab repo, specify the repo and and it will be added.
28
+ # ie: \e[33mhttps://github/username/REPO_NAME.git\e[0m
29
+ # #{dh('Default: nil')}
30
+ [#{highlight('--mailer=MAILER')}] # Which transactional mailer you want to use in production (postmark or sparkpost)?
31
+ # #{dh('Default: sparkpost')} (unless you specify to --skip_mailer, than neither will be used)
32
+ [#{highlight('--noauth')}] # If you would like to skip adding devise and pundit to the application
33
+ # #{dh('Default: false')}
34
+ [#{highlight('--simpleform')}] # Do you want your application to use simpleform to generate forms
35
+ # #{dh('Default: false')}
36
+ [#{highlight('--skip_docker')}] # If you want your application to skip generating any docker files (Dockerfile, docker-compose.yml, and .dockerignore)
37
+ # #{dh('Default: false')}
38
+ [#{highlight('--skip_erd')}] # If you want to skip generating an ERD for your application (requires graphviz to be installed)
39
+ # #{dh('Default: false')}
40
+ -G [#{highlight('--skip_git')}] # Do you want the generator to skip creating initializing and commit files to git
41
+ # #{dh('Default: false')}
42
+ [#{highlight('--skip_javascript')}] # Skip adding javascript (webpacker) to the application
43
+ # #{dh('Default: false')}
44
+ [#{highlight('--skip_mailer')}] # Do you want to skip setting up a
45
+ # #{dh('Default: false')}
46
+ [#{highlight('--skip_pagination')}] # Do you want to skip using pagination with your application?
47
+ # #{dh('Default: false')}
48
+ [#{highlight('--skip_pry')}] # Do you want to skip using pry with your applications rails console?
49
+ # #{dh('Default: false')}
50
+ [#{highlight('--skip_sidekiq')}] # Do you want to skip setting up sidekiq (for background jobs, mailers, etc.)
51
+ # #{dh('Default: false')}
52
+ [#{highlight('--skip_spring')}] # If you hate spring and want to skip using it with your application.
53
+ # #{dh('Default: false')}
54
+ -T [#{highlight('--skip_tests')}] # Do you want your application to skip building with tests
55
+ # #{dh('Default: false')}
56
+ [#{highlight('--skip_turbolinks')}] # If you want to skip adding turbolinks to your applications assets
57
+ # #{dh('Default: false')}
58
+ [#{highlight('--template_engine=ENGINE')}] # Assign a template_engine to use for the applications views (erb, slim, haml)
59
+ # #{dh('Default: erb')}
60
+ [#{highlight('--test_engine=TEST_ENGINE')}] # If you want to generate the application using a specific test suite (minitest, RSpec, none)
61
+ # #{dh('Default: rspec')}
62
+ [#{highlight('--uuid')}] # Enable setting as database primary keys as UUIDs (Only while using PostgreSQL)
63
+ # #{dh('Default: false')} (NOTE: This feature is still under development)
64
+ -W [#{highlight('--webpack=JSFRAMEWORK')}] # If you want initialize to webpacker with a specific JS framework (react vue angular elm stimulus)
65
+ # #{dh('Default: nil')}
66
+
67
+ Description:
68
+ A tool to easily generate a Rails (~> 6) application with a number of configurations, templates, and generators applied.
69
+ That way your're not spending days running through gems and documentation to get an application setup.
70
+ (This can include setting up bootstrap, devise, sidekiq, linters, dockerizing your application, and various other steps)
71
+
72
+
73
+ Examples:
74
+ \e[34mkowl AppName\e[0m
75
+ Generate an application using sqlite3, with a name of "AppName", requiring authentication, using RSpec, and using bootstrap.
76
+
77
+ \e[34mkowl AppName --database=oracle --simpleform --noauth\e[0m
78
+ This will generate an application using the Oracle database, using simple_form, and not requiring any sort of authentication (anyone can hit this app.)
79
+
80
+ \e[34mkowl AppName --simpleform --template_engine=slim\e[0m
81
+ This will generate an application defaulting to sqlite3, using simple_form, the Slim template engine, with pagination, and requiring authentication to load the application.
82
+
83
+ \e[34mkowl AppName --simpleform --template_engine=slim --skip_tests\e[0m
84
+ Generate an application using sqlite3, using bootstrap CSS framework, using the slim template engine, and build without any tests.
85
+
86
+ \e[34mkowl AppName --git_repo=https://github/username/REPO_NAME.git\e[0m
87
+ Will generate an app with remote directory of https://github/username/REPO_NAME.git
88
+
89
+ \e[34mkowl foobar --template_engine=haml --simpleform --framework=semantic;\e[0m
90
+ This will generating an app with the HAML template engine, using simpleform, and using the Semantic UI CSS Framework
91
+ HELPSTR
92
+ puts help_output
93
+ exit 0
94
+ elsif ['-v', '--version'].include? ARGV[0]
95
+ puts "\e[34mKowl\e[0m #{Kowl::VERSION}"
96
+ exit 0
97
+ elsif !ENV['RAILS_ENV'].blank? && ENV['RAILS_ENV'] != 'development'
98
+ # This application generator should be ran with RAILS_ENV set as development
99
+ puts "\e[31mIn order to generate the application you need to set your RAILS_ENV to development mode.\e[0m"
100
+ exit 0
101
+ end
102
+
103
+ templates_root = File.expand_path(File.join('..', 'lib', 'kowl', 'templates'), File.dirname(__FILE__))
104
+ Kowl::Overrides::AppGenerator.source_root templates_root
105
+ Kowl::Overrides::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << templates_root
106
+ Kowl::Overrides::AppGenerator.start
data/bin/setup ADDED
@@ -0,0 +1,13 @@
1
+ #!/bin/sh
2
+
3
+ # Run this script immediately after cloning the codebase.
4
+
5
+ # Exit if any subcommand fails
6
+ set -e
7
+
8
+ # Set up Ruby dependencies via Bundler
9
+ bundle install
10
+
11
+ # Add binstubs to PATH in ~/.zshenv like this:
12
+ # export PATH=".git/safe/../../bin:$PATH"
13
+ mkdir -p .git/safe