dry-web-roda 0.6.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/CONTRIBUTING.md +29 -0
  4. data/Gemfile +4 -3
  5. data/README.md +1 -1
  6. data/dry-web-roda.gemspec +0 -2
  7. data/lib/dry/web/roda/cli.rb +2 -2
  8. data/lib/dry/web/roda/cli/generate.rb +1 -1
  9. data/lib/dry/web/roda/generate.rb +32 -34
  10. data/lib/dry/web/roda/generators/abstract_generator.rb +54 -0
  11. data/lib/dry/web/roda/generators/abstract_project.rb +118 -0
  12. data/lib/dry/web/roda/generators/flat_project.rb +20 -14
  13. data/lib/dry/web/roda/generators/sub_app.rb +34 -13
  14. data/lib/dry/web/roda/generators/umbrella_project.rb +10 -19
  15. data/lib/dry/web/roda/templates/.env.test.tt +1 -0
  16. data/lib/dry/web/roda/templates/.env.tt +2 -0
  17. data/lib/dry/web/roda/templates/.gitignore +8 -0
  18. data/lib/dry/web/roda/{skeletons/flat_project/lib/__underscored_app_name__ → templates}/.keep +0 -0
  19. data/lib/dry/web/roda/templates/.rspec +2 -0
  20. data/lib/dry/web/roda/{skeletons/flat_project → templates}/Gemfile +4 -3
  21. data/lib/dry/web/roda/{skeletons/umbrella_project → templates}/README.md.tt +2 -2
  22. data/lib/dry/web/roda/templates/Rakefile.tt +66 -0
  23. data/lib/dry/web/roda/{skeletons/flat_project/web/templates/layouts → templates}/application.html.slim +0 -0
  24. data/lib/dry/web/roda/templates/boot__settings.rb.tt +10 -0
  25. data/lib/dry/web/roda/{skeletons/flat_project → templates}/config.ru.tt +0 -0
  26. data/lib/dry/web/roda/{skeletons/flat_project/bin → templates}/console.tt +0 -0
  27. data/lib/dry/web/roda/templates/container.rb.tt +14 -0
  28. data/lib/dry/web/roda/{skeletons/flat_project/web/routes/example.rb.tt → templates/example_routes.rb.tt} +0 -0
  29. data/lib/dry/web/roda/{skeletons/flat_project/system/__underscored_app_name__ → templates/flat_project}/application.rb.tt +6 -1
  30. data/lib/dry/web/roda/templates/flat_project/boot.rb.tt +10 -0
  31. data/lib/dry/web/roda/{skeletons/flat_project/system/__underscored_app_name__ → templates}/import.rb.tt +0 -0
  32. data/lib/dry/web/roda/{skeletons/flat_project/system/boot → templates}/monitor.rb.tt +0 -0
  33. data/lib/dry/web/roda/templates/operation.rb.tt +9 -0
  34. data/lib/dry/web/roda/{skeletons/flat_project/system/__underscored_app_name__ → templates}/repository.rb.tt +4 -2
  35. data/lib/dry/web/roda/templates/rom.rb.tt +39 -0
  36. data/lib/dry/web/roda/{skeletons/flat_project/db → templates}/sample_data.rb +0 -0
  37. data/lib/dry/web/roda/{skeletons/flat_project/db → templates}/seed.rb +0 -0
  38. data/lib/dry/web/roda/templates/settings.rb.tt +9 -0
  39. data/lib/dry/web/roda/{skeletons/flat_project/bin → templates}/setup +0 -0
  40. data/lib/dry/web/roda/{skeletons/umbrella_project/spec/db_helper.rb.tt → templates/spec/db_spec_helper.rb.tt} +2 -3
  41. data/lib/dry/web/roda/templates/spec/factories/example.rb +9 -0
  42. data/lib/dry/web/roda/{skeletons/flat_project → templates}/spec/spec_helper.rb.tt +1 -1
  43. data/lib/dry/web/roda/templates/spec/support/db/factory.rb +8 -0
  44. data/lib/dry/web/roda/templates/spec/support/db/helpers.rb.tt +13 -0
  45. data/lib/dry/web/roda/templates/spec/support/web/helpers.rb.tt +9 -0
  46. data/lib/dry/web/roda/{skeletons/umbrella_project/spec/app_helper.rb → templates/spec/web_spec_helper.rb} +8 -6
  47. data/lib/dry/web/roda/{skeletons/sub_app/system/__underscored_app_name__ → templates/subapp}/application.rb.tt +6 -1
  48. data/lib/dry/web/roda/templates/subapp/boot.rb.tt +5 -0
  49. data/lib/dry/web/roda/{skeletons/sub_app/system/__underscored_app_name__ → templates/subapp}/container.rb.tt +6 -9
  50. data/lib/dry/web/roda/{skeletons/sub_app/system/__underscored_app_name__ → templates/subapp}/transactions.rb.tt +2 -3
  51. data/lib/dry/web/roda/templates/subapp/view_context.rb.tt +8 -0
  52. data/lib/dry/web/roda/templates/subapp/view_controller.rb.tt +17 -0
  53. data/lib/dry/web/roda/{skeletons/flat_project/lib → templates}/types.rb +0 -0
  54. data/lib/dry/web/roda/{skeletons/umbrella_project/system/__underscored_app_name__ → templates/umbrella_project}/application.rb.tt +6 -1
  55. data/lib/dry/web/roda/templates/umbrella_project/boot.rb.tt +16 -0
  56. data/lib/dry/web/roda/templates/view_context.rb.tt +43 -0
  57. data/lib/dry/web/roda/templates/view_controller.rb.tt +17 -0
  58. data/lib/dry/web/roda/{skeletons/flat_project/web/templates → templates}/welcome.html.slim +0 -0
  59. data/lib/dry/web/roda/{skeletons/flat_project/lib/__underscored_app_name__/views → templates}/welcome.rb.tt +2 -2
  60. data/lib/dry/web/roda/version.rb +1 -1
  61. data/lib/roda/plugins/dry_view.rb +1 -1
  62. data/spec/support/project.rb +1 -1
  63. metadata +51 -116
  64. data/lib/dry/web/roda/skeletons/flat_project/README.md.tt +0 -12
  65. data/lib/dry/web/roda/skeletons/flat_project/Rakefile.tt +0 -81
  66. data/lib/dry/web/roda/skeletons/flat_project/config/settings.yml.tt +0 -8
  67. data/lib/dry/web/roda/skeletons/flat_project/lib/persistence/commands/.keep +0 -0
  68. data/lib/dry/web/roda/skeletons/flat_project/lib/persistence/relations/.keep +0 -0
  69. data/lib/dry/web/roda/skeletons/flat_project/log/.keep +0 -0
  70. data/lib/dry/web/roda/skeletons/flat_project/spec/app_helper.rb +0 -35
  71. data/lib/dry/web/roda/skeletons/flat_project/spec/db_helper.rb.tt +0 -24
  72. data/lib/dry/web/roda/skeletons/flat_project/spec/support/db/test_factories.rb +0 -3
  73. data/lib/dry/web/roda/skeletons/flat_project/spec/support/test_helpers.rb.tt +0 -15
  74. data/lib/dry/web/roda/skeletons/flat_project/system/__underscored_app_name__/container.rb.tt +0 -23
  75. data/lib/dry/web/roda/skeletons/flat_project/system/__underscored_app_name__/settings.rb.tt +0 -17
  76. data/lib/dry/web/roda/skeletons/flat_project/system/__underscored_app_name__/transactions.rb.tt +0 -34
  77. data/lib/dry/web/roda/skeletons/flat_project/system/__underscored_app_name__/view_context.rb.tt +0 -39
  78. data/lib/dry/web/roda/skeletons/flat_project/system/__underscored_app_name__/view_controller.rb.tt +0 -13
  79. data/lib/dry/web/roda/skeletons/flat_project/system/boot.rb.tt +0 -11
  80. data/lib/dry/web/roda/skeletons/flat_project/system/boot/rom.rb.tt +0 -32
  81. data/lib/dry/web/roda/skeletons/flat_project/system/boot/view.rb.tt +0 -3
  82. data/lib/dry/web/roda/skeletons/flat_project/transactions/example.rb.tt +0 -10
  83. data/lib/dry/web/roda/skeletons/sub_app/lib/__underscored_app_name__/.keep +0 -0
  84. data/lib/dry/web/roda/skeletons/sub_app/lib/__underscored_app_name__/views/welcome.rb.tt +0 -11
  85. data/lib/dry/web/roda/skeletons/sub_app/system/__underscored_app_name__/import.rb.tt +0 -5
  86. data/lib/dry/web/roda/skeletons/sub_app/system/__underscored_app_name__/view_context.rb.tt +0 -6
  87. data/lib/dry/web/roda/skeletons/sub_app/system/__underscored_app_name__/view_controller.rb.tt +0 -13
  88. data/lib/dry/web/roda/skeletons/sub_app/system/boot.rb.tt +0 -8
  89. data/lib/dry/web/roda/skeletons/sub_app/system/boot/view.rb.tt +0 -3
  90. data/lib/dry/web/roda/skeletons/sub_app/transactions/example.rb.tt +0 -9
  91. data/lib/dry/web/roda/skeletons/sub_app/web/routes/example.rb.tt +0 -7
  92. data/lib/dry/web/roda/skeletons/sub_app/web/templates/layouts/application.html.slim +0 -3
  93. data/lib/dry/web/roda/skeletons/sub_app/web/templates/welcome.html.slim +0 -1
  94. data/lib/dry/web/roda/skeletons/umbrella_project/.gitignore +0 -8
  95. data/lib/dry/web/roda/skeletons/umbrella_project/Gemfile +0 -40
  96. data/lib/dry/web/roda/skeletons/umbrella_project/Rakefile.tt +0 -81
  97. data/lib/dry/web/roda/skeletons/umbrella_project/bin/console.tt +0 -7
  98. data/lib/dry/web/roda/skeletons/umbrella_project/bin/setup +0 -7
  99. data/lib/dry/web/roda/skeletons/umbrella_project/config.ru.tt +0 -2
  100. data/lib/dry/web/roda/skeletons/umbrella_project/config/settings.yml.tt +0 -8
  101. data/lib/dry/web/roda/skeletons/umbrella_project/db/sample_data.rb +0 -1
  102. data/lib/dry/web/roda/skeletons/umbrella_project/db/seed.rb +0 -1
  103. data/lib/dry/web/roda/skeletons/umbrella_project/lib/__underscored_app_name__/repository.rb.tt +0 -11
  104. data/lib/dry/web/roda/skeletons/umbrella_project/lib/__underscored_app_name__/transactions.rb.tt +0 -33
  105. data/lib/dry/web/roda/skeletons/umbrella_project/lib/__underscored_app_name__/view_context.rb.tt +0 -39
  106. data/lib/dry/web/roda/skeletons/umbrella_project/lib/persistence/commands/.keep +0 -0
  107. data/lib/dry/web/roda/skeletons/umbrella_project/lib/persistence/relations/.keep +0 -0
  108. data/lib/dry/web/roda/skeletons/umbrella_project/lib/types.rb +0 -6
  109. data/lib/dry/web/roda/skeletons/umbrella_project/log/.keep +0 -0
  110. data/lib/dry/web/roda/skeletons/umbrella_project/spec/spec_helper.rb.tt +0 -61
  111. data/lib/dry/web/roda/skeletons/umbrella_project/spec/support/db/test_factories.rb +0 -3
  112. data/lib/dry/web/roda/skeletons/umbrella_project/spec/support/test_helpers.rb.tt +0 -15
  113. data/lib/dry/web/roda/skeletons/umbrella_project/system/__underscored_app_name__/container.rb.tt +0 -18
  114. data/lib/dry/web/roda/skeletons/umbrella_project/system/__underscored_app_name__/import.rb.tt +0 -5
  115. data/lib/dry/web/roda/skeletons/umbrella_project/system/__underscored_app_name__/settings.rb.tt +0 -17
  116. data/lib/dry/web/roda/skeletons/umbrella_project/system/boot.rb.tt +0 -12
  117. data/lib/dry/web/roda/skeletons/umbrella_project/system/boot/monitor.rb.tt +0 -9
  118. data/lib/dry/web/roda/skeletons/umbrella_project/system/boot/rom.rb.tt +0 -32
@@ -1,9 +0,0 @@
1
- <%= config[:camel_cased_app_name] %>::Container.finalize :monitor do |_container|
2
- init do
3
- require "dry/monitor"
4
- end
5
-
6
- start do
7
- Dry::Monitor::SQL::Logger.new(logger).subscribe(notifications)
8
- end
9
- end
@@ -1,32 +0,0 @@
1
- <%= config[:camel_cased_app_name] %>::Container.namespace "persistence" do |persistence|
2
- persistence.finalize(:rom) do
3
- init do
4
- require "sequel"
5
- require "rom"
6
-
7
- use :monitor
8
-
9
- Sequel.database_timezone = :utc
10
- Sequel.application_timezone = :local
11
-
12
- rom_config = ROM::Configuration.new(
13
- :sql,
14
- persistence.settings.database_url,
15
- extensions: [:error_sql]
16
- )
17
-
18
- rom_config.plugin(:sql, relations: :instrumentation) do |p|
19
- p.notifications = notifications
20
- end
21
-
22
- persistence.register("config", rom_config)
23
- end
24
-
25
- start do
26
- config = persistence["persistence.config"]
27
- config.auto_registration(persistence.root.join("lib/persistence"))
28
-
29
- persistence.register("rom", ROM.container(config))
30
- end
31
- end
32
- end