files = Dir.glob(File.join(File.dirname(__FILE__), 'cap_deploy/**/*') ) files.each{|f| require f } configuration = Capistrano::Configuration.respond_to?(:instance) ? Capistrano::Configuration.instance(:must_exist) : Capistrano.configuration(:must_exist) configuration.load do # have to load this with 'load', not 'require' # because cap configuration has redefined 'load' to instance_eval the loaded file load File.join(File.dirname(__FILE__), 'cap_deploy/filesystem_utils.rb') end