Well, in case you're wondering, this is apparently where you put the strategy definition.
This file: vendor/plugins/cap_archive_and_copy/recipes/archive_and_copy.rb Has this line: $:.unshift File.join(File.dirname(__FILE__), 'archive_and_copy') And this file: vendor/plugins/cap_archive_and_copy/recipes/archive_and_copy/capistrano/recipes/deploy/strategy/archive_and_copy.rb Has the class definition ArchiveAndCopy. Thanks, again, Patrick, for your help. Aaron On Thu, Sep 2, 2010 at 3:45 PM, Aaron Starr <[email protected]> wrote: > Again, thanks. You'd think that would work. But: > > ./config/deploy.rb:114:in `load': uninitialized constant > #<Class:0x101757b80>::Capistrano::Deploy::Strategy::Copy (NameError) > > Line 114 is: > > module Capistrano > module Deploy > module Strategy > > class ArchiveAndCopy < Copy > > I think I've read somewhere that Capistrano redefines require and load. > I'll keep fussing with it. > > Aaron > > > On Thu, Sep 2, 2010 at 2:17 PM, Patrick Reagan <[email protected]> wrote: > >> Not sure if this helps, but in the custom strategy I referenced, I have >> this at the top of the file: >> >> require 'capistrano/recipes/deploy/strategy/remote' >> >> You might be able to get away with including this in deploy.rb: >> >> require 'capistrano/recipes/deploy/strategy/copy' >> >> p. >> >> On Sep 2, 2010, at 3:09 PM, Aaron Starr wrote: >> >> > >> > Patrick, >> > >> > Thanks for your help, and point taken. >> > >> > My problem, probably stupid, is that I'm not sure where to put the >> AaronsCopyStrategy definition. Not in the deploy.rb file, because that gives >> the error about not knowing what a Capistrano::Deploy::Strategy::Copy is. >> > >> > Aaron >> > >> > >> > On Thu, Sep 2, 2010 at 1:33 PM, Patrick Reagan <[email protected]> >> wrote: >> > Hi Aaron - >> > >> > You may want to use a different approach rather than patching the >> existing implementation. You could create your own strategy that inherits >> from the Copy strategy and then implement your own command method. For >> example: >> > >> > module Capistrano >> > module Deploy >> > module Strategy >> > class AaronsCopyStrategy < Copy >> > >> > def command >> > ... >> > end >> > >> > end >> > end >> > end >> > end >> > >> > And in your deploy file you can set the strategy to user your custom >> strategy: >> > >> > set :deploy_via, :aarons_copy_strategy >> > >> > Check out this custom strategy that we developed for ideas: >> > >> > http://github.com/vigetlabs/capistrano_rsync_with_remote_cache >> > >> > I don't think (hope) the multiple nested directory structure is >> necessary if you're just doing a one-off implementation for your project. >> > >> > p. >> > >> > On Sep 2, 2010, at 2:06 PM, Aaron Starr wrote: >> > >> > > Hey, all, >> > > >> > > I need to use the copy strategy for deployment, but I need to change >> how we >> > > get the latest copy of the code. I'm trying to >> > > override Capistrano::Deploy::Strategy::Copy.command by putting this in >> the >> > > deploy.rb file: >> > > >> > > module Capistrano >> > > module Deploy >> > > module Strategy >> > > class Copy < Base >> > > private >> > > def command >> > > @command ||= [...] >> > > end >> > > [...] >> > > >> > > Clearly, that's not very clever. The error I'm getting is this: >> > > >> > > ./config/deploy.rb:115:in `load': uninitialized constant >> > > #<Class:0x101757b80>::Capistrano::Deploy::Strategy::Base (NameError) >> > > >> > > So, is there some way to override that method? Or, some other way that >> I >> > > can't see to write my own repository-retrieval, but otherwise keep all >> the >> > > functionality of the copy strategy? >> > > >> > > Thanks, >> > > >> > > Aaron >> > > >> > > -- >> > > * You received this message because you are subscribed to the Google >> Groups "Capistrano" group. >> > > * To post to this group, send email to [email protected] >> > > * To unsubscribe from this group, send email to >> [email protected]<capistrano%[email protected]>For >> more options, visit this group at >> http://groups.google.com/group/capistrano?hl=en >> > >> > -- >> > Patrick Reagan <[email protected]> >> > >> > >> > >> > >> > >> > -- >> > * You received this message because you are subscribed to the Google >> Groups "Capistrano" group. >> > * To post to this group, send email to [email protected] >> > * To unsubscribe from this group, send email to >> [email protected]<capistrano%[email protected]>For >> more options, visit this group at >> http://groups.google.com/group/capistrano?hl=en >> > >> > >> > -- >> > * You received this message because you are subscribed to the Google >> Groups "Capistrano" group. >> > * To post to this group, send email to [email protected] >> > * To unsubscribe from this group, send email to >> [email protected]<capistrano%[email protected]>For >> more options, visit this group at >> http://groups.google.com/group/capistrano?hl=en >> >> -- >> Patrick Reagan <[email protected]> >> >> >> >> >> >> -- >> * You received this message because you are subscribed to the Google >> Groups "Capistrano" group. >> * To post to this group, send email to [email protected] >> * To unsubscribe from this group, send email to >> [email protected]<capistrano%[email protected]>For >> more options, visit this group at >> http://groups.google.com/group/capistrano?hl=en >> > > -- * You received this message because you are subscribed to the Google Groups "Capistrano" group. * To post to this group, send email to [email protected] * To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano?hl=en
