These are chat archives for dry-rb/chat

30th
Oct 2017
Jeff Dickey
@jdickey
Oct 30 2017 16:20

It Would Be Very Nice If™ there were a --force option for dry-web-roda app new that worked like the Rails app-generator option, to overwrite existing files (in my case, a Gemfile). I'm adapting https://docs.docker.com/compose/rails/ to build a dry-web-roda app rather than a Rails app, and the extra manual intervention is…unfortunate

on the same general topic, what's the dry-web-roda convention for database configuration/connections? Specifically, is there an analogue to Rails' config/database.yml file?

Jeff Dickey
@jdickey
Oct 30 2017 16:31
or is that (database config) supposed to always use the environment variables in .env?
Jeff Dickey
@jdickey
Oct 30 2017 17:12
…and another difference between dry-web-roda's and Rails' app generation relevant to my adaptation of that tut is that dry-web-roda new . generates an app, but doesn't take the current directory name as the app name, so you have bugs like config.ru having a line like run .::Web.freeze.app, which of course Shotgun barfs on. I see the workaround, but it makes the Docker interaction much more fragile, especially for a sub-padawan-level student like my boss :P
Jeff Dickey
@jdickey
Oct 30 2017 17:19
pinging @timriley ^^
Gustavo Caso
@GustavoCaso
Oct 30 2017 17:44
Jeff I’m not at home at the moment but once I get there I will happily answer you
Jeff Dickey
@jdickey
Oct 30 2017 17:53
Great, thanks, @GustavoCaso
Gustavo Caso
@GustavoCaso
Oct 30 2017 21:07
@jdickey regarding the force option I agree with you it would be useful I know @timriley is currently working on a new implementation of the CLI so I would wait some time for adding new CLI options
Tim Riley
@timriley
Oct 30 2017 21:08
@jdickey You’re right about all of these shortcomings. As @GustavoCaso, we’re beginning to work on a better CLI and along with that we’ll hopefully address these sorts of things you bring up.
@jdickey Unfortunately, until that’s done, you might need to make do with what we have right now, sorry. I know it’s limited, but I wanted to make the project generator just exist in the first place to help people who want to get started with apps like these.
I want to build a bunch more generators, too.
@jdickey database setup works with app config (.env files or ENV vars) like everything else, so you’re on the right track there. right now we explicitly generate a rom bootable component for setting up the DB (into system/boot/persistence.rb) but eventually that will become an “external component” (a new feature of dry-system) and be hosted within some gem, so we won’t have to generate the same boilerplate into every project. It’ll also give us the ability to tweak the DB setup over time without requiring project maintainers to make those changes themselves.