Module: Capistrano::Patch::Strategy

Defined in:
lib/capistrano/patch/strategy.rb,
lib/capistrano/patch/strategy/git.rb,
lib/capistrano/patch/strategy/base.rb,
lib/capistrano/patch/strategy/git_server.rb

Defined Under Namespace

Classes: Base, Git, GitServer

Class Method Summary collapse

Class Method Details

.new(strategy, config = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/capistrano/patch/strategy.rb', line 5

def self.new(strategy, config = {})
  require "capistrano/patch/strategy/#{strategy}"

  strategy_const = strategy.to_s.capitalize.gsub(/_(.)/) { $1.upcase }

  const_get(strategy_const).new(config)

rescue LoadError
  raise Capistrano::Error, "could not find any strategy named `#{strategy}'"
end