Module: Capistrano::Deploy::Strategy
- Defined in:
- lib/alpha_omega/deploy/strategy.rb,
lib/alpha_omega/deploy/strategy/base.rb,
lib/alpha_omega/deploy/strategy/remote.rb,
lib/alpha_omega/deploy/strategy/checkout.rb
Defined Under Namespace
Classes: Base, Checkout, Remote
Class Method Summary collapse
Class Method Details
.new(strategy, config = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/alpha_omega/deploy/strategy.rb', line 4 def self.new(strategy, config={}) strategy_file = "alpha_omega/deploy/strategy/#{strategy}" require(strategy_file) strategy_const = strategy.to_s.capitalize.gsub(/_(.)/) { $1.upcase } if const_defined?(strategy_const) const_get(strategy_const).new(config) else raise Capistrano::Error, "could not find `#{name}::#{strategy_const}' in `#{strategy_file}'" end rescue LoadError raise Capistrano::Error, "could not find any strategy named `#{strategy}'" end |