Sha256: c5b6dc5f5afc434fc3ac2642ef13ac574ae6f49b8af76a9b501b4a6370458832
Contents?: true
Size: 1.34 KB
Versions: 7
Compression:
Stored size: 1.34 KB
Contents
module Rudy; module Routines; module SCMHelper include Rudy::Routines::HelperBase extend self # Does the routine config contain SCM routines? # Raises Rudy::Error if there is malformed configuration. def scm?(routine) scmnames = SUPPORTED_SCM_NAMES & routine.keys # Find intersections. return false if scmnames.empty? # Nothing to do. scmnames.each do |scm| routine[scm].values.each do |p| # Each SCM should have a raise "Bad #{scm} config" if !p.kind_of?(Hash) # Hash config. Otherwise end # it's misconfigured. end true end def create_scm_objects(routine) return nil unless routine scmnames = SUPPORTED_SCM_NAMES & routine.keys vlist = [] # Look for scm config in the routine by checking all known scm types. # For each one we'll create an instance of the appropriate SCM class. scmnames.each do |scm| routine[scm].each_pair do |user,params| klass = eval "Rudy::SCM::#{scm.to_s.upcase}" params[:user] = user scm = klass.new(params) scm.raise_early_exceptions # Raises exceptions for obvious problems. vlist << scm end end vlist end end end; end
Version data entries
7 entries across 7 versions & 2 rubygems