Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature proposal] Add no-template option #8545

Closed
wants to merge 1 commit into from

Conversation

banyan
Copy link
Contributor

@banyan 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
Copy link

kyanny commented Dec 18, 2012

👍

1 similar comment
@linyows
Copy link

linyows commented Dec 18, 2012

+1

@steveklabnik
Copy link
Member

I'm neither 👍 or 👎. Seems fine.

@josevalim
Copy link
Contributor

--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?

@banyan
Copy link
Contributor Author

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

@rafaelfranca
Copy link
Member

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?

@wycats
Copy link
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
@banyan
Copy link
Contributor Author

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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants