For anyone who wants to write a custom SCM, please note that you need
to place this file within the gem directory at this path:
/path/to/gem/lib/capistrano/recipes/deploy/scm
Otherwise, the system will not find your SCM even if you have loaded
the classes elsewhere. The code in lib/capistrano/recipes/deploy/
scm.rb called upon instantiation of the SCM classes looks for files
in the above-mentioned directory.
module Capistrano
module Deploy
module SCM
def self.new(scm, config={})
scm_file = "capistrano/recipes/deploy/scm/#{scm}"
require(scm_file)
scm_const = scm.to_s.capitalize.gsub(/_(.)/) { $1.upcase }
if const_defined?(scm_const)
const_get(scm_const).new(config)
else
raise Capistrano::Error, "could not find `#{name}::#
{scm_const}' in `#{scm_file}'"
end
rescue LoadError
raise Capistrano::Error, "could not find any SCM named `#
{scm}'"
end
end
end
end
Perhaps in the future we can patch this so an alternate "plugin"
directory can be defined and searched too.
If I'm off base on how this is supposed to work (I've been wrong
before!) please feel free to correct me.
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---