# File lib/capistrano/recipes/deploy/strategy.rb, line 4
4: def self.new(strategy, config={})
5: strategy_file = "capistrano/recipes/deploy/strategy/#{strategy}"
6: require(strategy_file)
7:
8: strategy_const = strategy.to_s.capitalize.gsub(/_(.)/) { $1.upcase }
9: if const_defined?(strategy_const)
10: const_get(strategy_const).new(config)
11: else
12: raise Capistrano::Error, "could not find `#{name}::#{strategy_const}' in `#{strategy_file}'"
13: end
14: rescue LoadError
15: raise Capistrano::Error, "could not find any strategy named `#{strategy}'"
16: end
# File lib/capistrano/recipes/deploy/strategy.rb, line 4
4: def self.new(strategy, config={})
5: strategy_file = "capistrano/recipes/deploy/strategy/#{strategy}"
6: require(strategy_file)
7:
8: strategy_const = strategy.to_s.capitalize.gsub(/_(.)/) { $1.upcase }
9: if const_defined?(strategy_const)
10: const_get(strategy_const).new(config)
11: else
12: raise Capistrano::Error, "could not find `#{name}::#{strategy_const}' in `#{strategy_file}'"
13: end
14: rescue LoadError
15: raise Capistrano::Error, "could not find any strategy named `#{strategy}'"
16: end