[rspec-devel] [ rspec-Patches-10574 ] Pre_commit refactoring

noreply at rubyforge.org noreply at rubyforge.org
Sun May 27 06:46:22 EDT 2007


Patches item #10574, was opened at 2007-05-04 18:25
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=10574&group_id=797

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Antti Tarvainen (tarvaina)
Assigned to: Nobody (None)
Summary: Pre_commit refactoring

Initial Comment:
Here's a refactoring of the rails plugin part of the pre_commit code. Since it's a lot of code, you might want to try it out for a couple of days before you decide if it should be committed to the trunk.

The code is fully specced, but the specs don't run as part of the pre_commit procedure yet. To run them, run rake in new_pre_commit directory.


I tried to change the functionality as little as possible. However, a few things did change. Most notably:

* The output is a little different.
* The current Rails edge succeeds on the old pre_commit, but fails on the new one. The new pre_commit doesn't tolerate the config.breakpoint_server deprecation warning. The old pre_commit tries to guess from the script/generate output, which lines are errors and which are not. The new pre_commit uses script/generate --quiet and assumes any output is an error message.


Other things:

* The code still uses SVN export and revert, so pre_commit fails if you try to run it on svn-exported code rather than svn-checked-out.
* I have only run the code on Mac. If someone wants to test it on Windows, that would be great. You will probably need the win32-popen.gem to run it, though.


I probably won't have any time next week, but I plan to refactor the rest of the pre_commit code the week after. If someone else wants to do it before that, that's fine also.


----------------------------------------------------------------------

>Comment By: Antti Tarvainen (tarvaina)
Date: 2007-05-27 13:46

Message:
Here's an updated version of the patch. Changes:

- It's a real diff (the old patch was also a diff, but in a
parallel directory structure, so you couldn't see what was
removed).
- Doesn't support Rails 1.1.6 anymore.
- Uses rspec_scaffold instead of rspec_resource.



----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-05-27 06:41

Message:
Antti - can you resubmit this as a diff? I want to be able to see what you're actually changing.

----------------------------------------------------------------------

Comment By: Antti Tarvainen (tarvaina)
Date: 2007-05-10 18:24

Message:
The purpose is to add specs to it so that we know that we
don't break it when we change it. In the original form, it
was too complicated to spec in a reasonable manner.

For an example of the type of problems that can go unnoticed
without specs, see patch 10315.

http://rubyforge.org/tracker/index.php?func=detail&aid=10315&group_id=797&atid=3151
 

In my opinion, although it is "just" the build code it
should not be left unspecced.


----------------------------------------------------------------------

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-10 16:35

Message:
What's the purpose of this refactoring?

----------------------------------------------------------------------

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-04 18:37

Message:
Just a quick heads up before I look at this. I just removed the call to config.breakpoint_server, so that shouldn't be an issue any more.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=10574&group_id=797


More information about the rspec-devel mailing list