Thanks Jamis. Disregarding a rails plugin for the moment, if I just
wanted to package  some recipes in a file (elastic_rails.rb) and send
to a friend, where would he place this extension file - where he could
call it by simply adding 'require elastic_rails' in deploy.rb? I ask
because what I've read of capistrano extensions, it seems like they
are placing the recipe file somewhere where it is easy enough to
require with the simple 'require 'my_cap_extension'.

Thanks,

Steve

On Mar 28, 12:48 pm, Jamis Buck <[EMAIL PROTECTED]> wrote:
> Running capistrano does not load rails plugins. If you have your code
> in vendor/plugins/elastic_rails/lib/elastic_rails.rb, you need to do,
> in your config/deploy.rb:
>
> $LOAD_PATH << "#{File.dirname(__FILE__)}/../vendor/plugins/
> elastic_rails/lib"
> require 'elastic_rails'
>
> - Jamis
>
> On Mar 28, 2007, at 6:35 AM, djsodom wrote:
>
>
>
> > Hi,
>
> > I'm trying to build a capistrano extension as a plugin. Capistrano
> > doesn't seem to be able to find my module. For simplicity, in
> > deploy.rb I have:
> > --------------------
> > require 'elastic_rails'
>
> > task :test do
> >   aws.test
> > end
>
> > -------------------
>
> > In my lib directory (for now), I have placed the following file
>
> > #elastic_rails.rb
>
> > require 'capistrano'
> > module ElasticRails
> >   def test
> >     run "pwd"
> >   end
>
> > end
>
> > Capistrano.plugin :aws, ElasticRails
>
> > -----------
> > When I try to run 'cap test', I get a "no such file to load --
> > elastic_rails (LoadError)"
>
> > My goal is to have this as a plugin. To do that, I created a folder
> > under vendor/plugins called 'elastic_rails'. In that folder I created
> > a file called init.rb that has 'require capistrano' and the above
> > module in it. That doesn't work either.
>
> > I must be missing something simple.
>
> > As a side question, I'll have some recipes I'll call in from the lib/
> > directory in my plugin. Is that the best way to structure a cap
> > plugin?
>
> > Thanks,
>
> > Steve


--~--~---------~--~----~------------~-------~--~----~
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