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

Read extra args for 'rails new' from ~/.railsrc #2583

Merged
merged 2 commits into from Oct 2, 2011

Conversation

guilleiguaran
Copy link
Member

@guilleiguaran
Copy link
Member Author

@josevalim please check this and let me know if can be done in a better way

@josevalim
Copy link
Contributor

/cc @fxn @jonleighton @tenderlove @spastorino - whatcha your feelings bros?

@hoff2
Copy link

hoff2 commented Sep 30, 2011

Not that anyone asked me, but I think this could have a lot of interesting potential uses. Just now is the first I've heard of it though.

@jonleighton
Copy link
Member

I don't have a problem with the idea, but I also don't create new projects regularly enough that it's annoying to have to specify the options. But perhaps some people do.

If we merge it probably needs to be made windows compatible.

@spastorino
Copy link
Contributor

I like the idea and agree with Jon, this should be compatible with Windows

@guilleiguaran
Copy link
Member Author

testing in Windows:

railsrc = File.join(File.expand_path("~"), ".railsrc")
#=> c//documents and settings/administrador/.railsrc

Windows Explorer still prohibiting files without name? :-) (in console I know this can be avoided: ren railsrc .railsrc)

What do you think that we should do for Windows users?

@spastorino
Copy link
Contributor

@guilleiguaran we should ping @luislavena? :P

@luislavena
Copy link

@guilleiguaran any decent editor will allow you create file without names, so don't worry about that, even from notepad you can workaround the limitation using double quotes around the filename.

@spastorino: Ruby 1.8.7, 1.9.2 and 1.9.3 resolve the expansion of ~ properly to the right environment variables (HOME, HOMEDRIVE+HOMEPATH or USERPROFILE)

I don't think Windows will be a problem with this.

Just my two cents.

Cheers.

@josevalim
Copy link
Contributor

That was the fastest github summoning i have ever seen!

@josevalim
Copy link
Contributor

Just to add my $0.02:

  1. I can easily see people forgetting they have a .railsrc and wondering "why is bundler being skipped in my machine". That said, I think we should print a message that says "Using CONTENT from PATH/TO/.RAILSRC".

  2. If I add --skip-bundler to .railsrc, rails new --help will still show me the default with bundler true. I am just adding this as general information as I don't think this particular problem could be easily solved.

  3. We should also update the --help message for the rails new generator to mention the possibility of adding a ~/.railsrc and mention that ~/.railsrc does not affect the values shown in the --help message (the issue 2 cited above).

@guilleiguaran
Copy link
Member Author

@luislavena thanks for your feedback

@josevalim totally agree, I will update this adding 1) and 3)

@guilleiguaran
Copy link
Member Author

@josevalim updated

josevalim added a commit that referenced this pull request Oct 2, 2011
Read extra args for 'rails new' from ~/.railsrc
@josevalim josevalim merged commit 5af5e77 into rails:master Oct 2, 2011
@spastorino
Copy link
Contributor

I think an explanation about the format of the .railsrc could be a good thing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants