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

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
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.

Owner

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.

Contributor

phoet commented Jul 28, 2011

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

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?

Contributor

phoet commented Nov 10, 2011

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

phoet closed this Nov 10, 2011

dchelimsky reopened this Nov 10, 2011

Owner

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.

Owner

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?

Owner

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.

Contributor

phoet commented Nov 10, 2011

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

Owner

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 :)

Contributor

phoet commented Nov 10, 2011

i guess that they store it internally as a git patch

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

Owner

dchelimsky commented Nov 10, 2011

@benedikt - yes, thanks!

Owner

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

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.

Owner

dchelimsky commented Nov 10, 2011

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

@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.

Owner

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

Owner

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 dchelimsky added a commit that referenced this pull request Nov 11, 2011

@dchelimsky dchelimsky 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
3eff799

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

@dchelimsky dchelimsky changelog for #430 8a613b5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment