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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/CONTRIBUTING.md +29 -0
- data/Gemfile +4 -3
- data/README.md +1 -1
- data/dry-web-roda.gemspec +0 -2
- data/lib/dry/web/roda/cli.rb +2 -2
- data/lib/dry/web/roda/cli/generate.rb +1 -1
- data/lib/dry/web/roda/generate.rb +32 -34
- data/lib/dry/web/roda/generators/abstract_generator.rb +54 -0
- data/lib/dry/web/roda/generators/abstract_project.rb +118 -0
- data/lib/dry/web/roda/generators/flat_project.rb +20 -14
- data/lib/dry/web/roda/generators/sub_app.rb +34 -13
- data/lib/dry/web/roda/generators/umbrella_project.rb +10 -19
- data/lib/dry/web/roda/templates/.env.test.tt +1 -0
- data/lib/dry/web/roda/templates/.env.tt +2 -0
- data/lib/dry/web/roda/templates/.gitignore +8 -0
- data/lib/dry/web/roda/{skeletons/flat_project/lib/__underscored_app_name__ → templates}/.keep +0 -0
- data/lib/dry/web/roda/templates/.rspec +2 -0
- data/lib/dry/web/roda/{skeletons/flat_project → templates}/Gemfile +4 -3
- data/lib/dry/web/roda/{skeletons/umbrella_project → templates}/README.md.tt +2 -2
- data/lib/dry/web/roda/templates/Rakefile.tt +66 -0
- data/lib/dry/web/roda/{skeletons/flat_project/web/templates/layouts → templates}/application.html.slim +0 -0
- data/lib/dry/web/roda/templates/boot__settings.rb.tt +10 -0
- data/lib/dry/web/roda/{skeletons/flat_project → templates}/config.ru.tt +0 -0
- data/lib/dry/web/roda/{skeletons/flat_project/bin → templates}/console.tt +0 -0
- data/lib/dry/web/roda/templates/container.rb.tt +14 -0
- data/lib/dry/web/roda/{skeletons/flat_project/web/routes/example.rb.tt → templates/example_routes.rb.tt} +0 -0
- data/lib/dry/web/roda/{skeletons/flat_project/system/__underscored_app_name__ → templates/flat_project}/application.rb.tt +6 -1
- data/lib/dry/web/roda/templates/flat_project/boot.rb.tt +10 -0
- data/lib/dry/web/roda/{skeletons/flat_project/system/__underscored_app_name__ → templates}/import.rb.tt +0 -0
- data/lib/dry/web/roda/{skeletons/flat_project/system/boot → templates}/monitor.rb.tt +0 -0
- data/lib/dry/web/roda/templates/operation.rb.tt +9 -0
- data/lib/dry/web/roda/{skeletons/flat_project/system/__underscored_app_name__ → templates}/repository.rb.tt +4 -2
- data/lib/dry/web/roda/templates/rom.rb.tt +39 -0
- data/lib/dry/web/roda/{skeletons/flat_project/db → templates}/sample_data.rb +0 -0
- data/lib/dry/web/roda/{skeletons/flat_project/db → templates}/seed.rb +0 -0
- data/lib/dry/web/roda/templates/settings.rb.tt +9 -0
- data/lib/dry/web/roda/{skeletons/flat_project/bin → templates}/setup +0 -0
- data/lib/dry/web/roda/{skeletons/umbrella_project/spec/db_helper.rb.tt → templates/spec/db_spec_helper.rb.tt} +2 -3
- data/lib/dry/web/roda/templates/spec/factories/example.rb +9 -0
- data/lib/dry/web/roda/{skeletons/flat_project → templates}/spec/spec_helper.rb.tt +1 -1
- data/lib/dry/web/roda/templates/spec/support/db/factory.rb +8 -0
- data/lib/dry/web/roda/templates/spec/support/db/helpers.rb.tt +13 -0
- data/lib/dry/web/roda/templates/spec/support/web/helpers.rb.tt +9 -0
- data/lib/dry/web/roda/{skeletons/umbrella_project/spec/app_helper.rb → templates/spec/web_spec_helper.rb} +8 -6
- data/lib/dry/web/roda/{skeletons/sub_app/system/__underscored_app_name__ → templates/subapp}/application.rb.tt +6 -1
- data/lib/dry/web/roda/templates/subapp/boot.rb.tt +5 -0
- data/lib/dry/web/roda/{skeletons/sub_app/system/__underscored_app_name__ → templates/subapp}/container.rb.tt +6 -9
- data/lib/dry/web/roda/{skeletons/sub_app/system/__underscored_app_name__ → templates/subapp}/transactions.rb.tt +2 -3
- data/lib/dry/web/roda/templates/subapp/view_context.rb.tt +8 -0
- data/lib/dry/web/roda/templates/subapp/view_controller.rb.tt +17 -0
- data/lib/dry/web/roda/{skeletons/flat_project/lib → templates}/types.rb +0 -0
- data/lib/dry/web/roda/{skeletons/umbrella_project/system/__underscored_app_name__ → templates/umbrella_project}/application.rb.tt +6 -1
- data/lib/dry/web/roda/templates/umbrella_project/boot.rb.tt +16 -0
- data/lib/dry/web/roda/templates/view_context.rb.tt +43 -0
- data/lib/dry/web/roda/templates/view_controller.rb.tt +17 -0
- data/lib/dry/web/roda/{skeletons/flat_project/web/templates → templates}/welcome.html.slim +0 -0
- data/lib/dry/web/roda/{skeletons/flat_project/lib/__underscored_app_name__/views → templates}/welcome.rb.tt +2 -2
- data/lib/dry/web/roda/version.rb +1 -1
- data/lib/roda/plugins/dry_view.rb +1 -1
- data/spec/support/project.rb +1 -1
- metadata +51 -116
- data/lib/dry/web/roda/skeletons/flat_project/README.md.tt +0 -12
- data/lib/dry/web/roda/skeletons/flat_project/Rakefile.tt +0 -81
- data/lib/dry/web/roda/skeletons/flat_project/config/settings.yml.tt +0 -8
- data/lib/dry/web/roda/skeletons/flat_project/lib/persistence/commands/.keep +0 -0
- data/lib/dry/web/roda/skeletons/flat_project/lib/persistence/relations/.keep +0 -0
- data/lib/dry/web/roda/skeletons/flat_project/log/.keep +0 -0
- data/lib/dry/web/roda/skeletons/flat_project/spec/app_helper.rb +0 -35
- data/lib/dry/web/roda/skeletons/flat_project/spec/db_helper.rb.tt +0 -24
- data/lib/dry/web/roda/skeletons/flat_project/spec/support/db/test_factories.rb +0 -3
- data/lib/dry/web/roda/skeletons/flat_project/spec/support/test_helpers.rb.tt +0 -15
- data/lib/dry/web/roda/skeletons/flat_project/system/__underscored_app_name__/container.rb.tt +0 -23
- data/lib/dry/web/roda/skeletons/flat_project/system/__underscored_app_name__/settings.rb.tt +0 -17
- data/lib/dry/web/roda/skeletons/flat_project/system/__underscored_app_name__/transactions.rb.tt +0 -34
- data/lib/dry/web/roda/skeletons/flat_project/system/__underscored_app_name__/view_context.rb.tt +0 -39
- data/lib/dry/web/roda/skeletons/flat_project/system/__underscored_app_name__/view_controller.rb.tt +0 -13
- data/lib/dry/web/roda/skeletons/flat_project/system/boot.rb.tt +0 -11
- data/lib/dry/web/roda/skeletons/flat_project/system/boot/rom.rb.tt +0 -32
- data/lib/dry/web/roda/skeletons/flat_project/system/boot/view.rb.tt +0 -3
- data/lib/dry/web/roda/skeletons/flat_project/transactions/example.rb.tt +0 -10
- data/lib/dry/web/roda/skeletons/sub_app/lib/__underscored_app_name__/.keep +0 -0
- data/lib/dry/web/roda/skeletons/sub_app/lib/__underscored_app_name__/views/welcome.rb.tt +0 -11
- data/lib/dry/web/roda/skeletons/sub_app/system/__underscored_app_name__/import.rb.tt +0 -5
- data/lib/dry/web/roda/skeletons/sub_app/system/__underscored_app_name__/view_context.rb.tt +0 -6
- data/lib/dry/web/roda/skeletons/sub_app/system/__underscored_app_name__/view_controller.rb.tt +0 -13
- data/lib/dry/web/roda/skeletons/sub_app/system/boot.rb.tt +0 -8
- data/lib/dry/web/roda/skeletons/sub_app/system/boot/view.rb.tt +0 -3
- data/lib/dry/web/roda/skeletons/sub_app/transactions/example.rb.tt +0 -9
- data/lib/dry/web/roda/skeletons/sub_app/web/routes/example.rb.tt +0 -7
- data/lib/dry/web/roda/skeletons/sub_app/web/templates/layouts/application.html.slim +0 -3
- data/lib/dry/web/roda/skeletons/sub_app/web/templates/welcome.html.slim +0 -1
- data/lib/dry/web/roda/skeletons/umbrella_project/.gitignore +0 -8
- data/lib/dry/web/roda/skeletons/umbrella_project/Gemfile +0 -40
- data/lib/dry/web/roda/skeletons/umbrella_project/Rakefile.tt +0 -81
- data/lib/dry/web/roda/skeletons/umbrella_project/bin/console.tt +0 -7
- data/lib/dry/web/roda/skeletons/umbrella_project/bin/setup +0 -7
- data/lib/dry/web/roda/skeletons/umbrella_project/config.ru.tt +0 -2
- data/lib/dry/web/roda/skeletons/umbrella_project/config/settings.yml.tt +0 -8
- data/lib/dry/web/roda/skeletons/umbrella_project/db/sample_data.rb +0 -1
- data/lib/dry/web/roda/skeletons/umbrella_project/db/seed.rb +0 -1
- data/lib/dry/web/roda/skeletons/umbrella_project/lib/__underscored_app_name__/repository.rb.tt +0 -11
- data/lib/dry/web/roda/skeletons/umbrella_project/lib/__underscored_app_name__/transactions.rb.tt +0 -33
- data/lib/dry/web/roda/skeletons/umbrella_project/lib/__underscored_app_name__/view_context.rb.tt +0 -39
- data/lib/dry/web/roda/skeletons/umbrella_project/lib/persistence/commands/.keep +0 -0
- data/lib/dry/web/roda/skeletons/umbrella_project/lib/persistence/relations/.keep +0 -0
- data/lib/dry/web/roda/skeletons/umbrella_project/lib/types.rb +0 -6
- data/lib/dry/web/roda/skeletons/umbrella_project/log/.keep +0 -0
- data/lib/dry/web/roda/skeletons/umbrella_project/spec/spec_helper.rb.tt +0 -61
- data/lib/dry/web/roda/skeletons/umbrella_project/spec/support/db/test_factories.rb +0 -3
- data/lib/dry/web/roda/skeletons/umbrella_project/spec/support/test_helpers.rb.tt +0 -15
- data/lib/dry/web/roda/skeletons/umbrella_project/system/__underscored_app_name__/container.rb.tt +0 -18
- data/lib/dry/web/roda/skeletons/umbrella_project/system/__underscored_app_name__/import.rb.tt +0 -5
- data/lib/dry/web/roda/skeletons/umbrella_project/system/__underscored_app_name__/settings.rb.tt +0 -17
- data/lib/dry/web/roda/skeletons/umbrella_project/system/boot.rb.tt +0 -12
- data/lib/dry/web/roda/skeletons/umbrella_project/system/boot/monitor.rb.tt +0 -9
- data/lib/dry/web/roda/skeletons/umbrella_project/system/boot/rom.rb.tt +0 -32
@@ -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
|