Branch.groovy 637 Bytes
Newer Older
Andrew Nicols's avatar
wip  
Andrew Nicols committed
1
2
3
4
5
package org.moodle.ci.branches;

class Branch {
    protected String defaultBranch

Andrew Nicols's avatar
Andrew Nicols committed
6
    protected String[] supportedPHPVersions
Andrew Nicols's avatar
wip  
Andrew Nicols committed
7

Andrew Nicols's avatar
Andrew Nicols committed
8
    protected String[] supportedDatabases
Andrew Nicols's avatar
wip  
Andrew Nicols committed
9
10

    def getDefaultBranch() {
Andrew Nicols's avatar
Andrew Nicols committed
11
        return defaultBranch
Andrew Nicols's avatar
wip  
Andrew Nicols committed
12
13
14
    }

    def getPhpVersions() {
Andrew Nicols's avatar
Andrew Nicols committed
15
        return supportedPHPVersions
Andrew Nicols's avatar
wip  
Andrew Nicols committed
16
17
18
    }

    def getDatabases() {
Andrew Nicols's avatar
Andrew Nicols committed
19
        return supportedPHPVersions
Andrew Nicols's avatar
wip  
Andrew Nicols committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33
    }

    def getHighestSupportedVersion() {
        def versions = self.getPhpVersions()

        return versions[versions.size() - 1]
    }

    def getLowestSupportedVersion(branch) {
        def versions = self.getPhpVersions()

        return versions[0]
    }
}