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

add an --init switch to the rspec command #430

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@phoet
Contributor

phoet commented Jul 28, 2011

i always need to search the rspec documentation (one of the several repos until i find the real wiki) for how to set up my rspec stuff. so i thought it might be a good idea to add an --init switch which does some minor scaffolding for the project.

the fork is just a simple implementation, so that you get the idea.

@dchelimsky

This comment has been minimized.

Member

dchelimsky commented Jul 28, 2011

There was a request for this a while back, but it never got prioritized. I think it's a good idea, but there are a few things we need to consider. This needs to integrate seamlessly with rails generate rspec:install so rspec does the right thing in non-rails and rails projects. Also, this should generate a .rspec file (empty), which is how rspec tells autotest that this is an rspec project.

@phoet

This comment has been minimized.

Contributor

phoet commented Jul 28, 2011

i will have a look into the rails generate stuff and see if i find a generic approach

@conradwt

This comment has been minimized.

conradwt commented Nov 10, 2011

Has there been any movement with adding an --init option to the rspec command in such a way that it can be reused by the rails generate rspec:install?

@phoet

This comment has been minimized.

Contributor

phoet commented Nov 10, 2011

no. i stopped looking for the integration. so i will close this request.

@phoet phoet closed this Nov 10, 2011

@dchelimsky dchelimsky reopened this Nov 10, 2011

@dchelimsky

This comment has been minimized.

Member

dchelimsky commented Nov 10, 2011

I still think this is a good idea, so I've reopened it. Not sure when it'll happen but I'd like to keep it on the radar.

@dchelimsky

This comment has been minimized.

Member

dchelimsky commented Nov 10, 2011

A while back we added a --configure option which generates a .rspec file if there isn't one, and also deletes (on confirmation) autotest/discover.rb, which is not longer used. It was designed in a very autotest-centric way, with the notion that we'd add other options later. My thinking is we can repurpose --configure to be more generic by default: don't require any argument; don't make it about autotest; generate .rspec if not present; generate spec directory if not present; generate spec/spec_helper.rb if not present. Still offer to delete autotest/discover.rb and perhaps lib/tasks/rspec.rake (which would help people upgrading from rails-2 to rails-3. We could also change the name to --init, though I'm not sure if that's necessary or not.

Thoughts?

@dchelimsky

This comment has been minimized.

Member

dchelimsky commented Nov 10, 2011

@phoet - looks like you deleted your fork so I can't merge this. If you restore it I'll merge it. I have some changes I want to make, but this way we'd have your contribution attributed correctly.

@phoet

This comment has been minimized.

Contributor

phoet commented Nov 10, 2011

i will see if i can find it somewhere...

@dchelimsky

This comment has been minimized.

Member

dchelimsky commented Nov 10, 2011

what's odd is that github still shows the diff. Would be nice if I could download it via the github UI :)

@phoet

This comment has been minimized.

Contributor

phoet commented Nov 10, 2011

i guess that they store it internally as a git patch

@benedikt

This comment has been minimized.

benedikt commented Nov 10, 2011

I guess you're looking for this: https://github.com/rspec/rspec-core/pull/430.patch :)

@dchelimsky

This comment has been minimized.

Member

dchelimsky commented Nov 10, 2011

@benedikt - yes, thanks!

@dchelimsky

This comment has been minimized.

Member

dchelimsky commented Nov 10, 2011

@benedikt - do you know how github stores that? i.e. if they do a git gc would this patch go away? Or is it actually stored with this repo (vs @phoet's)?

@benedikt

This comment has been minimized.

benedikt commented Nov 10, 2011

As far as I know they store it separately so you always have the history. I think they mentioned it in one of their talks on how they use pull requests themselves.

@dchelimsky

This comment has been minimized.

Member

dchelimsky commented Nov 10, 2011

Thanks for the info (can't get to this until tonight, so hoping it will still be there :) )

@conradwt

This comment has been minimized.

conradwt commented Nov 10, 2011

@dchelimsky You can save the patch locally so that it's available when you need it. I have saved it locally just in the event it's not there tonight and I can mail it to you.

@dchelimsky

This comment has been minimized.

Member

dchelimsky commented Nov 10, 2011

@conradwt - very kind of you - I have done the same, so you need not hold on to your copy :)

Cheers,
David

@dchelimsky

This comment has been minimized.

Member

dchelimsky commented Nov 10, 2011

Unless you've done a git gc, try git reflog.

Sent from my iPhone

On Nov 10, 2011, at 9:29 AM, Peter Schröderreply@reply.github.com wrote:

i will see if i can find it somewhere...


Reply to this email directly or view it on GitHub:
#430 (comment)

dchelimsky added a commit that referenced this pull request Nov 11, 2011

merge --configure and --init into a single command
- #430

- generates .rspec if not present
- generates spec/spec_helper if not present
- offers to delete obsolete autotest/discover.rb if present
- offers to delete obsolete lib/tasks/rspec.rake if present

dchelimsky added a commit that referenced this pull request Nov 11, 2011

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