Module: Minestrone::Deploy::SCM
- Defined in:
- lib/minestrone/recipes/deploy/scm.rb,
lib/minestrone/recipes/deploy/scm/git.rb,
lib/minestrone/recipes/deploy/scm/base.rb,
lib/minestrone/recipes/deploy/scm/none.rb
Defined Under Namespace
Class Method Summary collapse
Class Method Details
.new(scm, config = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/minestrone/recipes/deploy/scm.rb', line 6 def self.new(scm, config = {}) scm_file = "minestrone/recipes/deploy/scm/#{scm}" require(scm_file) scm_const = scm.to_s.capitalize.gsub(/_(.)/) { $1.upcase } if const_defined?(scm_const) const_get(scm_const).new(config) else raise Minestrone::Error, "could not find `#{name}::#{scm_const}' in `#{scm_file}'" end rescue LoadError raise Minestrone::Error, "could not find any SCM named `#{scm}'" end |