Wayne-

        Yeah I already thought about that and there is a decent workaround  
for when you have a command that doesn't conform to the method  
missing underscore to flag. So similar to RJS you can use << to push  
arbitrary commands onto the stack:

script = shell do |sh|

    sh.ln_nfs "foo", "bar"

    sh << "mongrel_rails start -C some/config.conf"

end

puts script


#!/bin/sh

ln -nfs foo bar
mongrel_rails start -C some/config.conf


        So for the majority of commands you will be able to use the  
method_missing approach but you will still be able to use arbitrary  
commands when you need to

-Ezra.


On Jan 22, 2007, at 8:20 AM, Wayne E. Seguin wrote:

>
> Ezra,
>
> I think this is a great idea and will prove very useful, I would
> definitely use it.
>
> I especially like your great use of method_missing.
>
> I do however forsee a problem with the current idea regarding calls
> like ln_nfs for ln -nfs.
>
> The issue I see here is with commands like:
>   mongrel_rails
>   mongrel_cluster
>   mysqld_safe
>   mysql_*
>   etc...
>
> As for how to fix this nicely... I'm not sure yet but I see three
> possibilities:
> 1. Use two underscores
> 2. Grab the last part of the underscore
> 3. Use ! at the end to indicate that parameters are intended
>
> Problem with 1 is, well, it's ugly! It is however functional and it
> would be clear what was meant by it
> Problem with 2 is better except for if you call a command with no
> arguments
> Not sure there is much of an issue with 3 unless you intend on using !
> in other places
>
> I'll be monitoring this thread, I'd love to help out here.
>
> Thanks for the great work!
>
>   ~Wayne
>
> Ezra Zygmuntowicz wrote:
>> Hey Folks-
>>
>>      I spent the weekend working on a shell script builder DSL for
>> writing your capistrano tasks in ruby instead of putting shell script
>> snippets in strings to the run method.
>>
>>      I wrote about this on my blog with a call for some input on look and
>> feel and whatnot.
>> ...
>>      I would love some feedback and thoughts from folks as to whether
>> they would use this or not.
>>
>
>
> >

-- Ezra Zygmuntowicz 
-- Lead Rails Evangelist
-- [EMAIL PROTECTED]
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)



--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to