Sha256: 9b995c3dd7e83bcc1a6d76073fbee97a306a199bfd1c1cf89e0bb0665842d3c9
Contents?: true
Size: 1.27 KB
Versions: 16
Compression:
Stored size: 1.27 KB
Contents
require 'json' module CiCd module Builder # noinspection RubySuperCallWithoutSuperclassInspection module Manifest module Repo require 'cicd/builder/mixlib/repo/base' require 'cicd/builder/mixlib/repo/S3' # noinspection RubyResolve if ENV.has_key?('REPO_TYPE') and (not ENV['REPO_TYPE'].capitalize.eql?('S3')) require "cicd/builder/manifest/mixlib/repo/#{ENV['REPO_TYPE'].downcase}" end # --------------------------------------------------------------------------------------------------------------- def getRepoClass(type = nil) @logger.info __method__.to_s if type.nil? type ||= 'S3' if ENV.has_key?('REPO_TYPE') type = ENV['REPO_TYPE'] end end @logger.info "#{type} repo interface" clazz = begin Object.const_get("#{self.class.name.gsub(%r'::\w+$', '')}::Repo::#{type}") rescue NameError #=> e Object.const_get("CiCd::Builder::Repo::#{type}") end if block_given? if clazz.is_a?(Class) and not clazz.nil? yield end end clazz end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems