Class: Capistrano::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/plugems_deploy/capistrano.rb

Instance Method Summary collapse

Instance Method Details

#load(*args, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/plugems_deploy/capistrano.rb', line 4

def load(*args, &block)
  # we always call the original load
  standard_cap_load(*args, &block)
  
  # if this happens to be 'config.load "standard"' coming from the CLI, we hook in after
  # and load all our own recipes before system/dot preferences... if capistrano changes how
  # they load their "default" recipes, this will probably break
  if args == ["standard"]
    load_plugem_deploy_recipes(File.dirname(__FILE__) + '/../..')
    begin
      require 'plugems_deploy_ext'
      load_plugem_deploy_recipes(PLUGEMS_DEPLOY_EXT_DIR) # Overriding from extensions
    rescue Exception
      # No extension is loaded
    end
  end
end

#load_plugem_deploy_recipes(dir) ⇒ Object



22
23
24
# File 'lib/plugems_deploy/capistrano.rb', line 22

def load_plugem_deploy_recipes(dir)
  Dir[File.join(dir, 'recipes', '*')].each { |f| standard_cap_load(f) }
end

#standard_cap_loadObject



3
# File 'lib/plugems_deploy/capistrano.rb', line 3

alias :standard_cap_load :load