Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Test Coverage and refactor of Template Runner

#1618

Hey Team

When wanting to add some additional features to Rails new Template Runner, I noticed it has 0 test coverage. (See #1613)

Attached is a patch to add a full test suite as well as some small refactoring for repetitive methods.

Its split into a couple of commits, I also forked and have branch of all the commits. See: http://github.com/quirkey/rails/...

I hope this helps and makes this feature easier to expand in the future.

Thanks! --AQ

Reported by Aaron Quint · December 23rd, 2008 @ 02:30 AM

State: resolved
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik

    I apply the patch and generate() stops working :)

    Also, could you please rebase this as a single patch ?

    Thanks.

    December 23rd, 2008 @ 03:16 AM

  2. Aaron Quint
    Aaron Quint

    Sorry about that - had to discover the wonders of git rebase --interactive.

    Attached is a consolidated patch with the generator issue fixed. I tried it with all of Jeremy's templates: http://github.com/jeremymcanally...

    Happy Holidays!

    December 23rd, 2008 @ 05:23 AM

  3. Jeremy McAnally
    Jeremy McAnally

    Looks great. Thanks for making the code as pretty as I wanted it to be originally. :P I'll probably pull your tests, etc. back into the rg gem so pre-2.3 people can use them.

    December 26th, 2008 @ 07:55 PM

  4. Aaron Quint
    Aaron Quint

    Sweet! High five for open source ;)

    December 26th, 2008 @ 08:00 PM

  5. Repository
    Repository
    • State changed from new to resolved

    (from [9fd35fc2d892393386ca9f522d25ba0bcb9c6764]) Adding test coverage and better logging to Rails::TemplateRunner [#1618 state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    December 27th, 2008 @ 09:05 PM

  6. Aaron Quint
    Aaron Quint

    Hey Pratik

    Sorry about that, but it looks like the new logging broke the rake rails:template task.

    Attached is a patch to fix it.

    Thanks! Let me know if you want me to put it in a new ticket. --AQ

    December 28th, 2008 @ 04:34 AM

  7. Repository
    Repository

    (from [c0c79f779c990f9e53c9b600291801fdf0bbe56b]) Use SimpleLogger for Rails::TemplateRunner outside of the Generator context [#1618 state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    December 28th, 2008 @ 04:49 PM