dry-web-roda 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -4
  3. data/CHANGELOG.md +18 -1
  4. data/lib/dry/web/roda/skeletons/app/{component → system}/__underscored_app_name__/application.rb.tt +0 -0
  5. data/lib/dry/web/roda/skeletons/app/{component → system}/__underscored_app_name__/container.rb.tt +3 -2
  6. data/lib/dry/web/roda/skeletons/app/{component → system}/__underscored_app_name__/import.rb.tt +0 -0
  7. data/lib/dry/web/roda/skeletons/app/{component → system}/__underscored_app_name__/page.rb.tt +0 -0
  8. data/lib/dry/web/roda/skeletons/app/{component → system}/__underscored_app_name__/transactions.rb.tt +0 -0
  9. data/lib/dry/web/roda/skeletons/app/{component → system}/__underscored_app_name__/view.rb.tt +0 -0
  10. data/lib/dry/web/roda/skeletons/app/{component → system}/boot.rb.tt +0 -0
  11. data/lib/dry/web/roda/skeletons/umbrella/Gemfile +10 -10
  12. data/lib/dry/web/roda/skeletons/umbrella/Rakefile.tt +1 -1
  13. data/lib/dry/web/roda/skeletons/umbrella/bin/console.tt +1 -1
  14. data/lib/dry/web/roda/skeletons/umbrella/config.ru.tt +1 -1
  15. data/lib/dry/web/roda/skeletons/umbrella/lib/__underscored_app_name__/page.rb.tt +1 -1
  16. data/lib/dry/web/roda/skeletons/umbrella/lib/roda_plugins.rb +1 -1
  17. data/lib/dry/web/roda/skeletons/umbrella/lib/types.rb +1 -0
  18. data/lib/dry/web/roda/skeletons/umbrella/spec/app_helper.rb +1 -1
  19. data/lib/dry/web/roda/skeletons/umbrella/spec/spec_helper.rb.tt +1 -1
  20. data/lib/dry/web/roda/skeletons/umbrella/{component → system}/__underscored_app_name__/application.rb.tt +0 -0
  21. data/lib/dry/web/roda/skeletons/umbrella/{component → system}/__underscored_app_name__/container.rb.tt +1 -1
  22. data/lib/dry/web/roda/skeletons/umbrella/{component → system}/__underscored_app_name__/import.rb.tt +0 -0
  23. data/lib/dry/web/roda/skeletons/umbrella/{component → system}/__underscored_app_name__/settings.rb.tt +0 -0
  24. data/lib/dry/web/roda/skeletons/umbrella/{component → system}/boot.rb.tt +1 -1
  25. data/lib/dry/web/roda/skeletons/umbrella/{component → system}/boot/logger.rb.tt +0 -0
  26. data/lib/dry/web/roda/skeletons/umbrella/system/boot/rom.rb.tt +26 -0
  27. data/lib/dry/web/roda/version.rb +1 -1
  28. data/spec/dummy/bin/console +1 -1
  29. metadata +16 -16
  30. data/lib/dry/web/roda/skeletons/umbrella/component/boot/rom.rb.tt +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d35dfd61f8677597e209b8096632bb2c1db3866d
4
- data.tar.gz: 0a97af17cf4480d1192568eb2bddc93a56ad8d30
3
+ metadata.gz: 162e0fb5d5d74204c4e1abe9f68962acad040064
4
+ data.tar.gz: ff5c3b8c76462d9b1a35aba887d93d7a923b73e0
5
5
  SHA512:
6
- metadata.gz: b9828bdd25a1c1ec4c5a15cfe4d00449d11cf1a9dbd5a8a43e4d7bd83f53191c0b194c8b99c7d4aa17c51f11d6fa2c199cc7301eab5cf55a93de5bb1bf84eb58
7
- data.tar.gz: 285a3e0eab770167ffab195b4dbd7786fa2af8684aba21c4f105eacac9a72d3f085e5d604940094efa1d7c29ea097270b3c64f0691aff81c0531fd0e7a4d3743
6
+ metadata.gz: ccfa0cf8901a6ec6dc9558d9973cff8ae647a3e7523d476c444fe2155ddede2b8b1ab0a44f2e7a0e11bcfd9c150eb5a23cddcaeda603a5ff227c5479038f3203
7
+ data.tar.gz: 6e3d4edf002317f4b81b63011536f1f6deb8ddd036a01d33808c6799b1a53e08d747ccccd6c3527299060d90378595b02081098d69c1d64a5b5024d52d7f5c7d
data/.travis.yml CHANGED
@@ -10,15 +10,12 @@ rvm:
10
10
  - 2.3.0
11
11
  - rbx
12
12
  - jruby-9000
13
- - ruby-head
14
- - jruby-head
15
13
  env:
16
14
  global:
17
15
  - JRUBY_OPTS='--dev -J-Xmx1024M'
18
16
  matrix:
19
17
  allow_failures:
20
- - rvm: ruby-head
21
- - rvm: jruby-head
18
+ - rvm: rbx
22
19
  notifications:
23
20
  email: false
24
21
  webhooks:
data/CHANGELOG.md CHANGED
@@ -1,6 +1,23 @@
1
+ # 0.5.0 - 2016-10-21
2
+
3
+ ### Changed
4
+
5
+ - Depend on the version of shotgun with fixes for Rack 2.0 (timriley)
6
+ - Update to work with latest dry-web and dry-system
7
+ - Expect `system/` dirs instead of `component/` (gotar)
8
+ - Update bootable dependency files to match latest dry-system API for bootable dependencies with lifecycles (gotar)
9
+ - Use latest released versions of rom-repository and rom-sql, instead of relying on their master branches (wafcio)
10
+ - Replace dry-result_matcher gem with dry-matcher (gotar)
11
+ - Add dry-monads and dry-struct gems to generated Gemfile (gotar)
12
+ - Expect symbols for flash keys in generated `Page` class (timriley)
13
+
14
+ ### Fixed
15
+
16
+ - Update `view` roda plugin to expect default namespace in sub-app containers (timriley)
17
+
1
18
  # 0.4.0 - 2016-08-15
2
19
 
3
- Update to dry-web with dry-system
20
+ Update to dry-web with dry-system (solnic)
4
21
 
5
22
  # 0.3.0 - 2016-07-26
6
23
 
@@ -3,11 +3,12 @@ require "dry/web/container"
3
3
 
4
4
  module <%= config[:camel_cased_app_name] %>
5
5
  class Container < Dry::Web::Container
6
- require root.join("component/<%= config[:underscored_umbrella_name] %>/container")
6
+ require root.join("system/<%= config[:underscored_umbrella_name] %>/container")
7
7
  import <%= config[:camel_cased_umbrella_name] %>::Container
8
8
 
9
9
  configure do |config|
10
10
  config.root = Pathname(__FILE__).join("../..").realpath.dirname.freeze
11
+
11
12
  config.default_namespace = "<%= config[:underscored_app_name] %>"
12
13
 
13
14
  config.auto_register = %w[
@@ -15,6 +16,6 @@ module <%= config[:camel_cased_app_name] %>
15
16
  ]
16
17
  end
17
18
 
18
- load_paths! "lib", "component"
19
+ load_paths! "lib", "system"
19
20
  end
20
21
  end
@@ -3,22 +3,23 @@ source "https://rubygems.org"
3
3
  gem "rake"
4
4
 
5
5
  # Web framework
6
- gem "dry-web", ">= 0.4.0"
7
- gem "dry-web-roda", ">= 0.3.0"
6
+ gem "dry-web", ">= 0.5.0"
7
+ gem "dry-web-roda", ">= 0.5.0"
8
8
  gem "puma"
9
9
  gem "rack_csrf"
10
- gem "shotgun"
10
+
11
+ gem "rack", ">= 2.0"
12
+ gem "shotgun", ">= 0.9.2"
11
13
 
12
14
  # Database persistence
13
15
  gem "pg"
14
- gem "rom", github: "rom-rb/rom"
15
- gem "rom-mapper", github: "rom-rb/rom-mapper"
16
- gem "rom-repository", github: "rom-rb/rom-repository"
17
- gem "rom-sql", github: "rom-rb/rom-sql"
18
- gem "rom-support", github: "rom-rb/rom-support"
16
+ gem "rom-repository"
17
+ gem "rom-sql"
19
18
 
20
19
  # Application dependencies
21
- gem "dry-result_matcher"
20
+ gem "dry-matcher"
21
+ gem "dry-monads"
22
+ gem "dry-struct"
22
23
  gem "dry-transaction"
23
24
  gem "dry-types"
24
25
  gem "dry-validation"
@@ -26,7 +27,6 @@ gem "dry-view"
26
27
  gem "slim"
27
28
 
28
29
  group :development, :test do
29
- gem "guard-rspec"
30
30
  gem "pry-byebug"
31
31
  end
32
32
 
@@ -9,7 +9,7 @@ begin
9
9
  rescue LoadError
10
10
  end
11
11
 
12
- require_relative "component/<%= config[:underscored_app_name] %>/container"
12
+ require_relative "system/<%= config[:underscored_app_name] %>/container"
13
13
 
14
14
  require "rom/sql/rake_task"
15
15
  require "sequel"
@@ -2,6 +2,6 @@
2
2
 
3
3
  require "bundler/setup"
4
4
  require "dry/web/console"
5
- require_relative "../component/boot"
5
+ require_relative "../system/boot"
6
6
 
7
7
  Dry::Web::Console.start
@@ -1,2 +1,2 @@
1
- require_relative "component/boot"
1
+ require_relative "system/boot"
2
2
  run <%= config[:camel_cased_app_name] %>::Application.freeze.app
@@ -30,7 +30,7 @@ module <%= config[:camel_cased_app_name] %>
30
30
  end
31
31
 
32
32
  def flash?
33
- %w(notice alert).any? { |type| flash[type] }
33
+ %i[notice alert].any? { |type| flash[type] }
34
34
  end
35
35
 
36
36
  def with_flash(flash)
@@ -23,7 +23,7 @@ class Roda
23
23
  module RequestMethods
24
24
  def view(name, overrides = {})
25
25
  options = {scope: scope.current_page}.merge(overrides)
26
- is to: "#{scope.name}.views.#{name}", call_with: [options]
26
+ is to: "views.#{name}", call_with: [options]
27
27
  end
28
28
  end
29
29
  end
@@ -1,3 +1,4 @@
1
+ require "dry-struct"
1
2
  require "dry-types"
2
3
 
3
4
  module Types
@@ -8,7 +8,7 @@ require "capybara/poltergeist"
8
8
  Dir[SPEC_ROOT.join("support/app/*.rb").to_s].each(&method(:require))
9
9
  Dir[SPEC_ROOT.join("shared/app/*.rb").to_s].each(&method(:require))
10
10
 
11
- require SPEC_ROOT.join("../component/boot").realpath
11
+ require SPEC_ROOT.join("../system/boot").realpath
12
12
 
13
13
  Capybara.app = TestHelpers.app
14
14
  Capybara.server_port = 3001
@@ -7,7 +7,7 @@ SPEC_ROOT = Pathname(__FILE__).dirname
7
7
  Dir[SPEC_ROOT.join("support/*.rb").to_s].each(&method(:require))
8
8
  Dir[SPEC_ROOT.join("shared/*.rb").to_s].each(&method(:require))
9
9
 
10
- require SPEC_ROOT.join("../component/<%= config[:underscored_app_name] %>/container")
10
+ require SPEC_ROOT.join("../system/<%= config[:underscored_app_name] %>/container")
11
11
 
12
12
  RSpec.configure do |config|
13
13
  config.disable_monkey_patching!
@@ -8,7 +8,7 @@ module <%= config[:camel_cased_app_name] %>
8
8
  config.settings_loader = <%= config[:camel_cased_app_name] %>::Settings
9
9
  end
10
10
 
11
- load_paths! "lib", "component"
11
+ load_paths! "lib", "system"
12
12
 
13
13
  def self.settings
14
14
  config.settings
@@ -7,6 +7,6 @@ require_relative "<%= config[:underscored_app_name] %>/container"
7
7
  end
8
8
 
9
9
  app_paths = Pathname(__FILE__).dirname.join("../apps").realpath.join("*")
10
- Dir[app_paths].each { |f| require "#{f}/component/boot" }
10
+ Dir[app_paths].each { |f| require "#{f}/system/boot" }
11
11
 
12
12
  require_relative "<%= config[:underscored_app_name] %>/application"
@@ -0,0 +1,26 @@
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
+ Sequel.database_timezone = :utc
8
+ Sequel.application_timezone = :local
9
+
10
+ rom_config = ROM::Configuration.new(
11
+ :sql,
12
+ persistence.settings.database_url,
13
+ extensions: [:error_sql]
14
+ )
15
+
16
+ persistence.register("config", rom_config)
17
+ end
18
+
19
+ start do
20
+ config = persistence["persistence.config"]
21
+ config.auto_registration(persistence.root.join("lib/persistence"))
22
+
23
+ persistence.register("rom", ROM.container(config))
24
+ end
25
+ end
26
+ end
@@ -1,7 +1,7 @@
1
1
  module Dry
2
2
  module Web
3
3
  module Roda
4
- VERSION = "0.4.0".freeze
4
+ VERSION = "0.5.0".freeze
5
5
  end
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'dry/web/cli'
4
- # require_relative '../component/boot'
4
+ # require_relative '../system/boot'
5
5
 
6
6
  Dry::Web::Cli.start
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-web-roda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2016-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-web
@@ -175,14 +175,14 @@ files:
175
175
  - lib/dry/web/roda/generate.rb
176
176
  - lib/dry/web/roda/generators/app.rb
177
177
  - lib/dry/web/roda/generators/umbrella.rb
178
- - lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/application.rb.tt
179
- - lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/container.rb.tt
180
- - lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/import.rb.tt
181
- - lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/page.rb.tt
182
- - lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/transactions.rb.tt
183
- - lib/dry/web/roda/skeletons/app/component/__underscored_app_name__/view.rb.tt
184
- - lib/dry/web/roda/skeletons/app/component/boot.rb.tt
185
178
  - lib/dry/web/roda/skeletons/app/lib/__underscored_app_name__/.keep
179
+ - lib/dry/web/roda/skeletons/app/system/__underscored_app_name__/application.rb.tt
180
+ - lib/dry/web/roda/skeletons/app/system/__underscored_app_name__/container.rb.tt
181
+ - lib/dry/web/roda/skeletons/app/system/__underscored_app_name__/import.rb.tt
182
+ - lib/dry/web/roda/skeletons/app/system/__underscored_app_name__/page.rb.tt
183
+ - lib/dry/web/roda/skeletons/app/system/__underscored_app_name__/transactions.rb.tt
184
+ - lib/dry/web/roda/skeletons/app/system/__underscored_app_name__/view.rb.tt
185
+ - lib/dry/web/roda/skeletons/app/system/boot.rb.tt
186
186
  - lib/dry/web/roda/skeletons/app/transactions/example.rb.tt
187
187
  - lib/dry/web/roda/skeletons/app/web/routes/example.rb.tt
188
188
  - lib/dry/web/roda/skeletons/app/web/templates/layouts/application.html.slim
@@ -192,13 +192,6 @@ files:
192
192
  - lib/dry/web/roda/skeletons/umbrella/Rakefile.tt
193
193
  - lib/dry/web/roda/skeletons/umbrella/bin/console.tt
194
194
  - lib/dry/web/roda/skeletons/umbrella/bin/setup
195
- - lib/dry/web/roda/skeletons/umbrella/component/__underscored_app_name__/application.rb.tt
196
- - lib/dry/web/roda/skeletons/umbrella/component/__underscored_app_name__/container.rb.tt
197
- - lib/dry/web/roda/skeletons/umbrella/component/__underscored_app_name__/import.rb.tt
198
- - lib/dry/web/roda/skeletons/umbrella/component/__underscored_app_name__/settings.rb.tt
199
- - lib/dry/web/roda/skeletons/umbrella/component/boot.rb.tt
200
- - lib/dry/web/roda/skeletons/umbrella/component/boot/logger.rb.tt
201
- - lib/dry/web/roda/skeletons/umbrella/component/boot/rom.rb.tt
202
195
  - lib/dry/web/roda/skeletons/umbrella/config.ru.tt
203
196
  - lib/dry/web/roda/skeletons/umbrella/config/settings.yml.tt
204
197
  - lib/dry/web/roda/skeletons/umbrella/db/sample_data.rb
@@ -216,6 +209,13 @@ files:
216
209
  - lib/dry/web/roda/skeletons/umbrella/spec/spec_helper.rb.tt
217
210
  - lib/dry/web/roda/skeletons/umbrella/spec/support/db/test_factories.rb
218
211
  - lib/dry/web/roda/skeletons/umbrella/spec/support/test_helpers.rb.tt
212
+ - lib/dry/web/roda/skeletons/umbrella/system/__underscored_app_name__/application.rb.tt
213
+ - lib/dry/web/roda/skeletons/umbrella/system/__underscored_app_name__/container.rb.tt
214
+ - lib/dry/web/roda/skeletons/umbrella/system/__underscored_app_name__/import.rb.tt
215
+ - lib/dry/web/roda/skeletons/umbrella/system/__underscored_app_name__/settings.rb.tt
216
+ - lib/dry/web/roda/skeletons/umbrella/system/boot.rb.tt
217
+ - lib/dry/web/roda/skeletons/umbrella/system/boot/logger.rb.tt
218
+ - lib/dry/web/roda/skeletons/umbrella/system/boot/rom.rb.tt
219
219
  - lib/dry/web/roda/version.rb
220
220
  - spec/dummy/apps/main/lib/main/entities/user.rb
221
221
  - spec/dummy/apps/main/lib/main/persistence/repositories/users.rb
@@ -1,16 +0,0 @@
1
- require "sequel"
2
- require "rom"
3
-
4
- Sequel.database_timezone = :utc
5
- Sequel.application_timezone = :local
6
-
7
- <%= config[:camel_cased_app_name] %>::Container.namespace "persistence" do |container|
8
- config = ROM::Configuration.new(:sql, container.settings.database_url, extensions: [:error_sql])
9
-
10
- container.register "config", config
11
-
12
- container.finalize :rom do
13
- config.auto_registration container.root.join("lib/persistence")
14
- container.register "rom", ROM.container(config)
15
- end
16
- end