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.

ask not working in TemplateRunner through rake rails:template

#1655

Added fix for ask - making sure gets is called on STDIN as it was breaking when running as rake task

Reported by Andrew · December 28th, 2008 @ 05:08 PM

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

Activity

  1. Pratik
    Pratik
    • Assigned user set to Pratik

    December 29th, 2008 @ 01:15 PM

  2. Pratik
    Pratik

    Hey Andrew,

    I tested it and it worked well for me. Not sure what I'm missing :-s

    January 16th, 2009 @ 05:34 PM

  3. Pratik
    Pratik
    • State changed from new to invalid

    Putting in 'invalid' till we have steps to reproduce.

    Thanks!

    January 16th, 2009 @ 05:39 PM

  4. Matt Lightner
    Matt Lightner

    +1

    I get the same error (template not found). Adding STDIN in front of gets (as is done in the attached patch) fixes the problem.

    
    root [/home/radiant/haha5]# rake rails:template LOCATION="~radiant/rails_app_templates/deluxe.rb"                           (in /home/radiant/haha5)
        applying  template: ~radiant/rails_app_templates/deluxe.rb
    rake aborted!
    The template [~radiant/rails_app_templates/deluxe.rb] could not be loaded. Error: No such file or directory - ~radiant/rails_app_templates/deluxe.rb
    

    When STDIN is added as the explicit receiver for the gets call in the ask() method, the question is asked as expected.

    February 16th, 2009 @ 09:45 AM

  5. Trent Ogren
    Trent Ogren

    +1

    I get the same error when trying to apply templates to existing 2.3.1 projects. The templates work fine when generating an app. Andrew's patch fixed the problem for me.

    March 9th, 2009 @ 02:50 PM

  6. Pratik
    Pratik
    • State changed from invalid to open

    Oops. My bad.

    March 9th, 2009 @ 02:59 PM

  7. Repository
    Repository
    • State changed from open to resolved

    (from [1d88a111b596c046e67fd290de0a40161350332b]) Ensure TemplateRunner#ask? works with the rake task to apply a template [#1655 state:resolved]

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

    March 9th, 2009 @ 02:59 PM