[Feature proposal] Add no-template option #8545

Closed
wants to merge 1 commit into
from

Projects

None yet

7 participants

Contributor
banyan commented Dec 18, 2012

I guess not so many people are using Application Template feature, but I like it.
I use with .railsrc which specifies the template path.

However, sometimes I would like to create bare rails with the command rails new foo,
but I can't overwrite or negate the template path, so rename .railsrc is pretty messy.

So this PR allows not to use template with the command rails new foo -M,
What do you guys think of it?

Thanks.

kyanny commented Dec 18, 2012

👍

linyows commented Dec 18, 2012

+1

Member

I'm neither 👍 or 👎. Seems fine.

Member

--no-template or --skip-template already works today (Thor adds such to each option). I don't see a need to give it an alias. Isn't this enough?

Contributor
banyan commented Dec 18, 2012

@josevalim

I don't see a need to give it an alias. Isn't this enough?

Yes, I'm fine if it works.
Are you sure that --no-template or --skip-template works?
It seems there's no feature in thor or rails.

$ echo "-T --skip-bundle -m https://raw.github.com/banyan/my-rails-template/master/template.rb" > ~/.railsrc
$ rails new foo --no-template # or --skip-template
Owner

Yes, it works. See [https://github.com/wycats/thor/blob/master/lib/thor/parser/arguments.rb#L139-142].

But in this case the ~/.railsrc arguments are added after the arguments you passed to the rails new command. So the -m option will take precedence over --no-template.

I personally think this should be inverted and the arguments passed to commands should have precedence over the ~/.railsrc content.

@josevalim @wycats WDYT?

Member
wycats commented Dec 24, 2012

@rafaelfranca explicit options should DEFINITELY take precedence over options in .railsrc

@wycats wycats closed this Dec 24, 2012
@rafaelfranca rafaelfranca reopened this Dec 24, 2012
Contributor
banyan commented Dec 24, 2012

@rafaelfranca

I see and it works fine! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment