It’s just data

Keeping Up With Rails

J Aaron Farr: the greatest difficultly of Rails development is that “best practices” have a shelf life of < 12 months

In an example in Agile Web Development with Rails, 2nd Edition, there is a test with a setup method that includes a few routes.  This example propagated forward to the third edition essentially unchanged.  This code worked in Rails v1.  It worked up to Rails v 2.2.2.

It fails in Rails 2.3.2.  After debugging, it appears that the culprit is that config/routes.rb is processed before setup is called, and that file provides some default routes which are intended to be the lowest priority, but as they are processed first, they end up overriding.

With 2.3.2 there is a new API (which I can’t find, and doesn’t seem to have much in the way of documentation) that allows you to add routes after startup.  Depending on the precedence order of these additions, this could be useful.

It is this type of change that has lead me to automate my regression testing of the scripts in the book against versions of Rails.  If you are on OSX or Linux, and have Rails 2.2.2 or Rails 2.3.2, you can see it in action in under a minute:

git clone git://github.com/rubys/awdwr.git
cd awdwr
ruby makedepot.rb 6.1-6.5 save

If all went well, what should have happened is that the entire 6th chapter of AWDwR was executed, the results were verified, and a snapshot of the entire application (code+database) was saved.  If you would like to see the actual output, it is captured in makedepot.html.  You can also continue on with the 7th chapter using ruby makedepot.rb restore 7.1-7.4.

My goals are threefold:

At the present time, there are four failures when running this test against HEAD.  Two that I mentioned previously, and two more that I have recently discovered.  The first is truly trivial: timestamps now have a precision of microseconds, which doesn’t match the regular expression I had set up for this in my tests.  The second is the change in Templating Systems API that I haven’t yet debugged.


submitted by gthank [link] [0 comments]...

Excerpt from programming: what's new online at

Keeping Up With Rails...

Excerpt from A Rubyist Railstastic Adventure at

Regarding making your book more durable... I’ve accepted that the printed book (or PDF) is a good starting point, and I have to use more dynamic (but less comprehensive) sources for deltas. Please don’t compromise on the value of the book as a starting point in the name of durability.

Posted by Victor Costan at

Heya

If you are interested in getting continuous integration for this, check out RunCodeRun - [link].  We do free CI for open source from GitHub.

You’ll need to add a Rakefile with a default task to your project, btw.

Posted by Rob Sanheim at

Documentation?

I have been told that my lack of documentation and clean packaging of things could be holding me back. Well, that and “horrible graphic design”. I think, as with most things, this situation is never as simple as people think. For instance, take Ruby...

Excerpt from Titivillus at

Rob: OK, I added a minimal rakefile.

I’m not sure what CI on this project would mean.  Ideally, this project would eventually be a part of the CI for Rails itself.

Posted by Sam Ruby at

I’d say there are other greater difficulties but this is in the top 3. I’d say >50% of the coding time (and >90% of the headaches) of Erector ([link]) have come from figuring out how to work within Rails... and then doing it again on every minor dot release.

Posted by Alex Chaffee at

Sam Ruby: Keeping Up With Rails

[link]...

Excerpt from Delicious/ttjk0115 at

Ticket 2667

Posted by Sam Ruby at

Down to a single failure with edge Rails 3.0...

Other failures were non-issues:

As I get this test closer to the point where it repeatably passes, by keeping on top of Rails edge, I should be able to use tools like git bisect to identify exactly where any regression is introduced.

Posted by Sam Ruby at

workaround to ticket 2667

Posted by Sam Ruby at

You need Gump4Ruby

Posted by Jon at

First failure: ticket 2731

Posted by Sam Ruby at

... and fixed.

Posted by Sam Ruby at

Second failure: ticket 2734.

Posted by Sam Ruby at

fixed and verified.

Posted by Sam Ruby at

Rails Edge - Very Stable Lately

Yehuda Katz: ...  I’ve been running automated tests on Rails, focusing on edge, for nearly a month now.  Four problems were found during the process:  ticket 2779 was probably found before I could even report it, in any case it... [more]

Trackback from Sam Ruby

at

On Rails Testing

One of the things that has both pleasantly surprised and frustrated me over the past six months is the state of Rails’ internal tests. While the tests can sometimes cover the most obscure, important bugs, they can sometimes be heavily mock-based or...

Excerpt from Katz Got Your Tongue? at

On Rails Testing

One of the things that has both pleasantly surprised and frustrated me over the past six months is the state of Rails’ internal tests. While the tests can sometimes cover the most obscure, important bugs, they can sometimes be heavily mock-based or...

Excerpt from Katz Got Your Tongue? at

Adding Routes for Tests

I like to be extremely judicious with use of routes. Fewer routes means less memory consumption and fewer confusing magical methods. I always delete the default route map.connect ‘:controller/:action/:id’ (you should too, otherwise all your pretty...

Excerpt from Rail Spikes - Home at

[from martinfsl] Sam Ruby: Keeping Up With Rails

Testing AWDwR examples with different versions of rails...

Excerpt from Delicious/network/tomafro at

6 Steps To Refactoring Rails (for Mere Mortals)

Since December, Rails has undergone a fairly significant internal refactoring in quite a number of areas. While it was quite tricky at first, we’ve started to hone a process for diving into a new area of the codebase and emerging some time later...

Excerpt from Union Station at

Adding Routes for Tests

I like to be extremely judicious with use of routes. Fewer routes means less memory consumption and fewer confusing magical methods. I always delete the default route map.connect ‘:controller/:action/:id’ (you should too, otherwise all your pretty...

Excerpt from Rail Spikes - Home at

6 Passos para Refatorar Rails (Para meros mortais)

Esse artigo é uma tradução do Post original do Yehuda Katz Desde dezembro, Rails sofreu uma importante refatoração interna em uma série de áreas, enquanto isso tava delicado no início, Nós meros mortais começamos a afiar o processo de mergulho numa...

Excerpt from Spreading Logic by Rodrigo at

Add your comment