These are chat archives for dry-rb/chat
Next-gen ruby libs! » github.com/dry-rb » website: https://dry-rb.org » forum: https://discourse.dry-rb.org
module Dryonly, your app does the same thing with its own top-level module.
Blogand my sub-app is
Blog::Admin, then in apps/admin/lib/blog/admin/whatever.rb I can more easily e.g. inherit from
require “blog/something” module Blog module Admin class Whatever < Something # doesn’t reqiure explicit Blog::Something naming because we’re already in that namespace end end end
Thanks for the reply TIm. Just one other thing I noticed (and maybe I'm missing some default cfg somewhere) but the routing seems to work differently vs default Roda routes.
r.get "ping" do 'pong' end
with App < Roda this matches only <url>/ping
whereas with App < Dry::Web::Roda::Application this appears to match <url>/ping/*
Is this intentional or did I miss something silly?
@solnic weird, cos I just typed up this config.ru file
# cat config.ru require 'roda' require 'dry/web/roda/application' class App < Dry::Web::Roda::Application # Roda plugin :json route do |r| r.get 'ping' do 'pong' end end end run App.freeze.app
and verified the behaviour on both my windows & osx box
Importis a global object and
Equalizeris a global function, objects are stateful, functions are stateless hence the difference
Drynamespace, so you can do both