mattbrictson / rails-template

My former app template for Rails 7. All recommendations you see here have been moved to https://github.com/mattbrictson/nextgen
MIT License
1.09k stars 231 forks source link

Several question to your stack (maybe worth to be noted in readme?) #2

Closed frankis closed 6 years ago

frankis commented 9 years ago

Hi there

I found your stack some days ago, played with it a little and love it. I am very new to RoR so pls. excuse if my questions sounds not to be the smartest.

  1. I found the rubocop.yml to configure rubocop but can´t find it within the gemfile.
    What is the sense of the rubocop.yml in this case / how is it used?
  2. I found two "development" groups targeting "development" only.
    Is that for organisational purposes only?
  3. As you are using sidekiq: I read it requires redis but didn´t find related config.
    Did I misunderstood something?
  4. i have read that minitest-spec-rails (gem) should be the way to move on. Any opinions on that?
  5. Your setup configures nginx in production, I can imagine that would make the whole stack unusable on heroku and other PaaS, it would be great to see a switch at setup on which production env is going to be used to set / unset related config.
mattbrictson commented 9 years ago

@frankis Great questions.

I found the rubocop.yml to configure rubocop but can´t find it within the gemfile. What is the sense of the rubocop.yml in this case / how is it used?

Rubocop is very strict and I am not sure yet whether to officially require it in my projects or make it part of the CI process. Currently I use a plugin in my editor (Sublime Text 3) to show me Rubocop violations. You can also gem install rubocop and then run rubocop on the command line to see violations.

I found two "development" groups targeting "development" only. Is that for organisational purposes only?

Yes, they are both development, but one has :require => false and one does not. They serve two different purposes: the :require => false set are command-line utilities like cap and guard. The other group could be considered "Rails plugins" that enhance the Rails app itself. I split them apart mostly for aesthetic reasons.

As you are using sidekiq: I read it requires redis but didn´t find related config. Did I misunderstood something?

Correct: sidekiq requires Redis. And it sounds like Rails 5 will have other new features that take advantage of Redis as well, so it is good to have it installed. For local development you can install Redis with brew install redis (on the Mac).

i have read that minitest-spec-rails (gem) should be the way to move on. Any opinions on that?

I prefer the test-unit style of writing tests. It is also what Rails ships with by default, and what the official Rails Guides use in the documentation. Mintiest-Spec is BDD style. My opinion is that if you want BDD style, you are probably better served by using RSpec, which has a much larger community.

Your setup configures nginx in production, I can imagine that would make the whole stack unusable on heroku and other PaaS, it would be great to see a switch at setup on which production env is going to be used to set / unset related config.

Good point. I have been considering that. I don't have any production apps running on Heroku, so I would like to wait until I have more experience with PaaS before prescribing a "best practice" in this template.

mattbrictson commented 8 years ago

Some follow-up for those reading this issue:

I found the rubocop.yml to configure rubocop but can't find it within the gemfile. What is the sense of the rubocop.yml in this case / how is it used?

RuboCop is now included in the Gemfile and can be run via bin/rubocop in the generated app.

I found two "development" groups targeting "development" only. Is that for organisational purposes only?

This was a poor decision on my part. I've since combined these into a single group.

mattbrictson commented 6 years ago

One final update: the template now produces an app that works with Heroku out of the box.