class GitMaintain::RDMACoreCI

Constants

AZURE_MIN_VERSION

Public Class Methods

new(repo) click to toggle source
Calls superclass method
# File lib/addons/RDMACore.rb, line 126
def initialize(repo)
    super(repo)
    @travis = GitMaintain::TravisCI.new(repo)
    @azure = GitMaintain::AzureCI.new(repo, 'ucfconsort', 'ucfconsort')

    # Auto generate all CI required methods
    # Wicked ruby tricker to find all the public methods of CI but not of inherited classes
    # to dynamically define these method in the object being created
    (GitMaintain::CI.new(repo).public_methods() - Object.new.public_methods()).each(){|method|
        # Skip specific emptyCache method
        next if method == :emptyCache

        self.define_singleton_method(method) { |br, *args|
            if br.version =~ /([0-9]+)/
                major=$1.to_i
            elsif br.version == "master" 
                major=99999
            else
                raise("Unable to monitor branch #{br} on a CI")
            end
            if major < AZURE_MIN_VERSION
                @travis.send(method, br, *args)
            else
                @azure.send(method, br, *args)
            end
        }
    }
end

Public Instance Methods

emptyCache() click to toggle source
# File lib/addons/RDMACore.rb, line 154
def emptyCache()
    @travis.emptyCache()
    @azure.emptyCache()
end