'use strict'

module.exports = class Version {

    constructor(version) {

        const split = version.split('.')

        this.majorVersion = parseInt(split[0])
        this.minorVersion = parseInt(split[1] || 0)
        this.patchVersion = parseInt(split[2] || 0)
    }

    patch(increment) {

        if (arguments.length === 0 || increment) {

            this.patchVersion += 1
        }

        return this
    }

    minor(increment) {

        if (arguments.length === 0 || increment) {

            this.minorVersion += 1
            this.patchVersion = 0
        }

        return this
    }

    major(increment) {

        if (arguments.length === 0 || increment) {

            this.majorVersion += 1
            this.minorVersion = 0
            this.patchVersion = 0
        }

        return this
    }

    toString() {

        return [this.majorVersion, this.minorVersion, this.patchVersion].join('.')
    }
}

@@ -57,17 +57,25 @@
 tructor(
-v
+semanticV
 ersion) 
@@ -103,26 +103,109 @@
 t = 
-version.split('.')
+semanticVersion.split('+')%0A%0A        const version = split%5B0%5D.split('.')%0A        const meta = split%5B1%5D
 %0A%0A  
@@ -239,21 +239,23 @@
 arseInt(
-split
+version
 %5B0%5D)%0A   
@@ -288,21 +288,23 @@
 arseInt(
-split
+version
 %5B1%5D %7C%7C 0
@@ -342,21 +342,23 @@
 arseInt(
-split
+version
 %5B2%5D %7C%7C 0
@@ -354,24 +354,75 @@
 ion%5B2%5D %7C%7C 0)
+%0A%0A        this.previousBuildMetaData = meta %7C%7C null
 %0A    %7D%0A%0A    
@@ -457,34 +457,8 @@
 if (
-arguments.length === 0 %7C%7C 
 incr
@@ -580,34 +580,8 @@
 if (
-arguments.length === 0 %7C%7C 
 incr
@@ -737,34 +737,8 @@
 if (
-arguments.length === 0 %7C%7C 
 incr
@@ -884,24 +884,415 @@
 this%0A    %7D%0A%0A
+    meta(fn) %7B%0A%0A        if (typeof fn === 'function') %7B%0A%0A            this.buildMetaData = fn.call(null, %7B%0A                major: this.majorVersion,%0A                minor: this.minorVersion,%0A                patch: this.patchVersion,%0A                meta: this.previousBuildMetaData%0A            %7D)%0A%0A        %7D else %7B%0A%0A            this.buildMetaData = null%0A        %7D%0A%0A        return this%0A    %7D%0A%0A
     toString
@@ -1305,22 +1305,32 @@
         
-return
+let semVersion =
  %5Bthis.m
@@ -1385,21 +1385,145 @@
 n%5D.join('.')
+%0A%0A        if (this.buildMetaData) %7B%0A%0A            semVersion += '+' + this.buildMetaData%0A        %7D%0A%0A        return semVersion
 %0A    %7D%0A%7D%0A

add build meta data support