Methods

Files

Class/Module Index [+]

Quicksearch

Capistrano::Configuration::Loading

Attributes

load_paths[R]

The load paths used for locating recipe files.

Public Instance Methods

load(*args, &block) click to toggle source

Load a configuration file or string into this configuration.

Usage:

load("recipe"):
  Look for and load the contents of 'recipe.rb' into this
  configuration.

load(:file => "recipe"):
  same as above

load(:string => "set :scm, :subversion"):
  Load the given string as a configuration specification.

load { ... }
  Load the block in the context of the configuration.
# File lib/capistrano/configuration/loading.rb, line 78
def load(*args, &block)
  options = args.last.is_a?(Hash) ? args.pop : {}

  if block
    raise ArgumentError, "loading a block requires 0 arguments" unless options.empty? && args.empty?
    load(:proc => block)

  elsif args.any?
    args.each { |arg| load options.merge(:file => arg) }

  elsif options[:file]
    load_from_file(options[:file], options[:name])

  elsif options[:string]
    remember_load(options) unless options[:reloading]
    instance_eval(options[:string], options[:name] || "<eval>")

  elsif options[:proc]
    remember_load(options) unless options[:reloading]
    instance_eval(&options[:proc])

  else
    raise ArgumentError, "don't know how to load #{options.inspect}"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.