Return a new array of version information that is newer than "buildNumber".
Returns null if there is no new version information.
333949
function _stripOldVersionInfo(versionInfo, buildNumber) {
        // Do a simple linear search. Since we are going in reverse-chronological order, we
        // should get through the search quickly.
        var lastIndex = 0;
        var len = versionInfo.length;
        var versionEntry;
        var validBuildEntries;

        while (lastIndex < len) {
            versionEntry = versionInfo[lastIndex];
            if (versionEntry.buildNumber <= buildNumber) {
                break;
            }
            lastIndex++;
        }

        if (lastIndex > 0) {
            // Filter recent update entries based on applicability to current platform
            validBuildEntries = versionInfo.slice(0, lastIndex).filter(_checkBuildApplicability);
        }

        return validBuildEntries;
    }
261553
private String extractNumericVersion(Collection<String> versionStrings) {
        if (versionStrings == null) {
            return "";
        }
        for (String value : versionStrings) {
            String releaseValue = calculateReleaseVersion(value);
            if (!releaseValue.equals(value)) {
                return releaseValue;
            }
        }
        return "";
    }
992363
def post_versions_list(self, updater_name=None, updater_id=None,
                           post_id=None, start_id=None):
        
        params = {
            'search[updater_name]': updater_name,
            'search[updater_id]': updater_id,
            'search[post_id]': post_id,
            'search[start_id]': start_id
            }
        return self._get('post_versions.json', params)
737205
function getNewVersions() {
  return getTags()
    .then(tags => {
      var newVersions = []
      for(tag of tags) {
        if (semver.gt(tag.name, update.latest) || (
            semver.eq(tag.name, update.latest) && (semver(tag.name).build[0] || 0) > (semver(update.latest).build[0] || 0)
          )) {
          newVersions.push(tag)
        }
      }
      newVersions.reverse()
      // order versions from lower to greater
      console.log(chalk.blue('New versions available: ' + (newVersions.map(v => v.name).join(', ') || 'none') + '.'))
      return newVersions
    })
    .catch(e => console.log(e.stack))
}
870911
function (version) {
        //var pattern = VERSION_PATTERN;
        var match = version.match(VERSION_PATTERN);
        if (match) {
            return [
                parseInt(match[1]),
                parseInt(match[2] || "0"),
                parseInt(match[3] || "0"),
                versionStageToInt(match[4]),
                parseInt(match[5] || "0"),
            ];
        }
        return null;
    }
476257
def get_build_info(api_instance, build_id=None,
                   keys=DEFAULT_BUILD_KEYS, wait=False):
    
    build = (api_instance.get_build(build_id) if build_id
             else api_instance.get_last_build())
    output = ""

    if wait:
        build.block_until_complete()

    if 'timestamp' in keys:
        output += str(build.get_timestamp()) + '\n'

    if 'console' in keys:
        output += build.get_console() + '\n'

    if 'scm' in keys:
        # https://github.com/salimfadhley/jenkinsapi/pull/250
        # try/except while this is still occuring
        try:
            output += build.get_revision() + '\n'
        except IndexError:
            pass

    return output
702259
def get_version():
    ""
    assert len(VERSION) == 5
    assert VERSION[3] in ('alpha', 'beta', 'rc', 'final')

    # Now build the two parts of the version number:
    # main = X.Y[.Z]
    # sub = .devN - for pre-alpha releases
    #     | {a|b|c}N - for alpha, beta and rc releases

    parts = 2 if VERSION[2] == 0 else 3
    main = '.'.join(str(x) for x in VERSION[:parts])

    sub = ''
    if VERSION[3] != 'final':
        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
        sub = mapping[VERSION[3]] + str(VERSION[4])

    return str(main + sub)
133913
def _get_version(name, results):
    '''
    
    '''
    for line in salt.utils.itertools.split(results, '\n'):
        if not line:
            continue
        try:
            pkgname, pkgver = line.rsplit('-', 1)
        except ValueError:
            continue
        if pkgname == name:
            return pkgver
    return None
507596
public static int getBuildVersion() {
		try {
			Properties props = new Properties();
			props.load(ResourceLoader.getResourceAsStream("version"));
			
			int build = Integer.parseInt(props.getProperty("build"));
			Log.info("Slick Build #"+build);
			
			return build;
		} catch (Exception e) {
			Log.error("Unable to determine Slick build number");
			return -1;
		}
	}
685748
def get_build_info_for_date(self, date, build_index=None):
        """"""
        url = urljoin(self.base_url, self.monthly_build_list_regex)
        has_time = date and date.time()

        self.logger.info('Retrieving list of builds from %s' % url)
        parser = self._create_directory_parser(url)
        regex = r'%(DATE)s-(\d+-)+%(BRANCH)s%(L10N)s%(PLATFORM)s$' % {
            'DATE': date.strftime('%Y-%m-%d'),
            'BRANCH': self.branch,
            # ensure to select the correct subfolder for localized builds
            'L10N': '(-l10n)?' if self.locale_build else '',
            'PLATFORM': '' if self.application not in (
                        'fennec') else '-' + self.platform
        }

        parser.entries = parser.filter(regex)
        parser.entries = parser.filter(self.is_build_dir)

        if has_time:
            # If a time is included in the date, use it to determine the
            # build's index
            regex = r'.*%s.*' % date.strftime('%H-%M-%S')
            parser.entries = parser.filter(regex)

        if not parser.entries:
            date_format = '%Y-%m-%d-%H-%M-%S' if has_time else '%Y-%m-%d'
            message = 'Folder for builds on %s has not been found' % \
                self.date.strftime(date_format)
            raise errors.NotFoundError(message, url)

        # If no index has been given, set it to the last build of the day.
        self.show_matching_builds(parser.entries)
        # If no index has been given, set it to the last build of the day.
        if build_index is None:
            # Find the most recent non-empty entry.
            build_index = len(parser.entries)
            for build in reversed(parser.entries):
                build_index -= 1
                if not build_index or self.is_build_dir(build):
                    break
        self.logger.info('Selected build: %s' % parser.entries[build_index])

        return (parser.entries, build_index)
1183299
private static Version[] buildVersions() {
    return new Version[]{
        new Version(1, new int[]{},
            new ECBlocks(7, new ECB(1, 19)),
            new ECBlocks(10, new ECB(1, 16)),
            new ECBlocks(13, new ECB(1, 13)),
            new ECBlocks(17, new ECB(1, 9))),
        new Version(2, new int[]{6, 18},
            new ECBlocks(10, new ECB(1, 34)),
            new ECBlocks(16, new ECB(1, 28)),
            new ECBlocks(22, new ECB(1, 22)),
            new ECBlocks(28, new ECB(1, 16))),
        new Version(3, new int[]{6, 22},
            new ECBlocks(15, new ECB(1, 55)),
            new ECBlocks(26, new ECB(1, 44)),
            new ECBlocks(18, new ECB(2, 17)),
            new ECBlocks(22, new ECB(2, 13))),
        new Version(4, new int[]{6, 26},
            new ECBlocks(20, new ECB(1, 80)),
            new ECBlocks(18, new ECB(2, 32)),
            new ECBlocks(26, new ECB(2, 24)),
            new ECBlocks(16, new ECB(4, 9))),
        new Version(5, new int[]{6, 30},
            new ECBlocks(26, new ECB(1, 108)),
            new ECBlocks(24, new ECB(2, 43)),
            new ECBlocks(18, new ECB(2, 15),
                new ECB(2, 16)),
            new ECBlocks(22, new ECB(2, 11),
                new ECB(2, 12))),
        new Version(6, new int[]{6, 34},
            new ECBlocks(18, new ECB(2, 68)),
            new ECBlocks(16, new ECB(4, 27)),
            new ECBlocks(24, new ECB(4, 19)),
            new ECBlocks(28, new ECB(4, 15))),
        new Version(7, new int[]{6, 22, 38},
            new ECBlocks(20, new ECB(2, 78)),
            new ECBlocks(18, new ECB(4, 31)),
            new ECBlocks(18, new ECB(2, 14),
                new ECB(4, 15)),
            new ECBlocks(26, new ECB(4, 13),
                new ECB(1, 14))),
        new Version(8, new int[]{6, 24, 42},
            new ECBlocks(24, new ECB(2, 97)),
            new ECBlocks(22, new ECB(2, 38),
                new ECB(2, 39)),
            new ECBlocks(22, new ECB(4, 18),
                new ECB(2, 19)),
            new ECBlocks(26, new ECB(4, 14),
                new ECB(2, 15))),
        new Version(9, new int[]{6, 26, 46},
            new ECBlocks(30, new ECB(2, 116)),
            new ECBlocks(22, new ECB(3, 36),
                new ECB(2, 37)),
            new ECBlocks(20, new ECB(4, 16),
                new ECB(4, 17)),
            new ECBlocks(24, new ECB(4, 12),
                new ECB(4, 13))),
        new Version(10, new int[]{6, 28, 50},
            new ECBlocks(18, new ECB(2, 68),
                new ECB(2, 69)),
            new ECBlocks(26, new ECB(4, 43),
                new ECB(1, 44)),
            new ECBlocks(24, new ECB(6, 19),
                new ECB(2, 20)),
            new ECBlocks(28, new ECB(6, 15),
                new ECB(2, 16))),
        new Version(11, new int[]{6, 30, 54},
            new ECBlocks(20, new ECB(4, 81)),
            new ECBlocks(30, new ECB(1, 50),
                new ECB(4, 51)),
            new ECBlocks(28, new ECB(4, 22),
                new ECB(4, 23)),
            new ECBlocks(24, new ECB(3, 12),
                new ECB(8, 13))),
        new Version(12, new int[]{6, 32, 58},
            new ECBlocks(24, new ECB(2, 92),
                new ECB(2, 93)),
            new ECBlocks(22, new ECB(6, 36),
                new ECB(2, 37)),
            new ECBlocks(26, new ECB(4, 20),
                new ECB(6, 21)),
            new ECBlocks(28, new ECB(7, 14),
                new ECB(4, 15))),
        new Version(13, new int[]{6, 34, 62},
            new ECBlocks(26, new ECB(4, 107)),
            new ECBlocks(22, new ECB(8, 37),
                new ECB(1, 38)),
            new ECBlocks(24, new ECB(8, 20),
                new ECB(4, 21)),
            new ECBlocks(22, new ECB(12, 11),
                new ECB(4, 12))),
        new Version(14, new int[]{6, 26, 46, 66},
            new ECBlocks(30, new ECB(3, 115),
                new ECB(1, 116)),
            new ECBlocks(24, new ECB(4, 40),
                new ECB(5, 41)),
            new ECBlocks(20, new ECB(11, 16),
                new ECB(5, 17)),
            new ECBlocks(24, new ECB(11, 12),
                new ECB(5, 13))),
        new Version(15, new int[]{6, 26, 48, 70},
            new ECBlocks(22, new ECB(5, 87),
                new ECB(1, 88)),
            new ECBlocks(24, new ECB(5, 41),
                new ECB(5, 42)),
            new ECBlocks(30, new ECB(5, 24),
                new ECB(7, 25)),
            new ECBlocks(24, new ECB(11, 12),
                new ECB(7, 13))),
        new Version(16, new int[]{6, 26, 50, 74},
            new ECBlocks(24, new ECB(5, 98),
                new ECB(1, 99)),
            new ECBlocks(28, new ECB(7, 45),
                new ECB(3, 46)),
            new ECBlocks(24, new ECB(15, 19),
                new ECB(2, 20)),
            new ECBlocks(30, new ECB(3, 15),
                new ECB(13, 16))),
        new Version(17, new int[]{6, 30, 54, 78},
            new ECBlocks(28, new ECB(1, 107),
                new ECB(5, 108)),
            new ECBlocks(28, new ECB(10, 46),
                new ECB(1, 47)),
            new ECBlocks(28, new ECB(1, 22),
                new ECB(15, 23)),
            new ECBlocks(28, new ECB(2, 14),
                new ECB(17, 15))),
        new Version(18, new int[]{6, 30, 56, 82},
            new ECBlocks(30, new ECB(5, 120),
                new ECB(1, 121)),
            new ECBlocks(26, new ECB(9, 43),
                new ECB(4, 44)),
            new ECBlocks(28, new ECB(17, 22),
                new ECB(1, 23)),
            new ECBlocks(28, new ECB(2, 14),
                new ECB(19, 15))),
        new Version(19, new int[]{6, 30, 58, 86},
            new ECBlocks(28, new ECB(3, 113),
                new ECB(4, 114)),
            new ECBlocks(26, new ECB(3, 44),
                new ECB(11, 45)),
            new ECBlocks(26, new ECB(17, 21),
                new ECB(4, 22)),
            new ECBlocks(26, new ECB(9, 13),
                new ECB(16, 14))),
        new Version(20, new int[]{6, 34, 62, 90},
            new ECBlocks(28, new ECB(3, 107),
                new ECB(5, 108)),
            new ECBlocks(26, new ECB(3, 41),
                new ECB(13, 42)),
            new ECBlocks(30, new ECB(15, 24),
                new ECB(5, 25)),
            new ECBlocks(28, new ECB(15, 15),
                new ECB(10, 16))),
        new Version(21, new int[]{6, 28, 50, 72, 94},
            new ECBlocks(28, new ECB(4, 116),
                new ECB(4, 117)),
            new ECBlocks(26, new ECB(17, 42)),
            new ECBlocks(28, new ECB(17, 22),
                new ECB(6, 23)),
            new ECBlocks(30, new ECB(19, 16),
                new ECB(6, 17))),
        new Version(22, new int[]{6, 26, 50, 74, 98},
            new ECBlocks(28, new ECB(2, 111),
                new ECB(7, 112)),
            new ECBlocks(28, new ECB(17, 46)),
            new ECBlocks(30, new ECB(7, 24),
                new ECB(16, 25)),
            new ECBlocks(24, new ECB(34, 13))),
        new Version(23, new int[]{6, 30, 54, 78, 102},
            new ECBlocks(30, new ECB(4, 121),
                new ECB(5, 122)),
            new ECBlocks(28, new ECB(4, 47),
                new ECB(14, 48)),
            new ECBlocks(30, new ECB(11, 24),
                new ECB(14, 25)),
            new ECBlocks(30, new ECB(16, 15),
                new ECB(14, 16))),
        new Version(24, new int[]{6, 28, 54, 80, 106},
            new ECBlocks(30, new ECB(6, 117),
                new ECB(4, 118)),
            new ECBlocks(28, new ECB(6, 45),
                new ECB(14, 46)),
            new ECBlocks(30, new ECB(11, 24),
                new ECB(16, 25)),
            new ECBlocks(30, new ECB(30, 16),
                new ECB(2, 17))),
        new Version(25, new int[]{6, 32, 58, 84, 110},
            new ECBlocks(26, new ECB(8, 106),
                new ECB(4, 107)),
            new ECBlocks(28, new ECB(8, 47),
                new ECB(13, 48)),
            new ECBlocks(30, new ECB(7, 24),
                new ECB(22, 25)),
            new ECBlocks(30, new ECB(22, 15),
                new ECB(13, 16))),
        new Version(26, new int[]{6, 30, 58, 86, 114},
            new ECBlocks(28, new ECB(10, 114),
                new ECB(2, 115)),
            new ECBlocks(28, new ECB(19, 46),
                new ECB(4, 47)),
            new ECBlocks(28, new ECB(28, 22),
                new ECB(6, 23)),
            new ECBlocks(30, new ECB(33, 16),
                new ECB(4, 17))),
        new Version(27, new int[]{6, 34, 62, 90, 118},
            new ECBlocks(30, new ECB(8, 122),
                new ECB(4, 123)),
            new ECBlocks(28, new ECB(22, 45),
                new ECB(3, 46)),
            new ECBlocks(30, new ECB(8, 23),
                new ECB(26, 24)),
            new ECBlocks(30, new ECB(12, 15),
                new ECB(28, 16))),
        new Version(28, new int[]{6, 26, 50, 74, 98, 122},
            new ECBlocks(30, new ECB(3, 117),
                new ECB(10, 118)),
            new ECBlocks(28, new ECB(3, 45),
                new ECB(23, 46)),
            new ECBlocks(30, new ECB(4, 24),
                new ECB(31, 25)),
            new ECBlocks(30, new ECB(11, 15),
                new ECB(31, 16))),
        new Version(29, new int[]{6, 30, 54, 78, 102, 126},
            new ECBlocks(30, new ECB(7, 116),
                new ECB(7, 117)),
            new ECBlocks(28, new ECB(21, 45),
                new ECB(7, 46)),
            new ECBlocks(30, new ECB(1, 23),
                new ECB(37, 24)),
            new ECBlocks(30, new ECB(19, 15),
                new ECB(26, 16))),
        new Version(30, new int[]{6, 26, 52, 78, 104, 130},
            new ECBlocks(30, new ECB(5, 115),
                new ECB(10, 116)),
            new ECBlocks(28, new ECB(19, 47),
                new ECB(10, 48)),
            new ECBlocks(30, new ECB(15, 24),
                new ECB(25, 25)),
            new ECBlocks(30, new ECB(23, 15),
                new ECB(25, 16))),
        new Version(31, new int[]{6, 30, 56, 82, 108, 134},
            new ECBlocks(30, new ECB(13, 115),
                new ECB(3, 116)),
            new ECBlocks(28, new ECB(2, 46),
                new ECB(29, 47)),
            new ECBlocks(30, new ECB(42, 24),
                new ECB(1, 25)),
            new ECBlocks(30, new ECB(23, 15),
                new ECB(28, 16))),
        new Version(32, new int[]{6, 34, 60, 86, 112, 138},
            new ECBlocks(30, new ECB(17, 115)),
            new ECBlocks(28, new ECB(10, 46),
                new ECB(23, 47)),
            new ECBlocks(30, new ECB(10, 24),
                new ECB(35, 25)),
            new ECBlocks(30, new ECB(19, 15),
                new ECB(35, 16))),
        new Version(33, new int[]{6, 30, 58, 86, 114, 142},
            new ECBlocks(30, new ECB(17, 115),
                new ECB(1, 116)),
            new ECBlocks(28, new ECB(14, 46),
                new ECB(21, 47)),
            new ECBlocks(30, new ECB(29, 24),
                new ECB(19, 25)),
            new ECBlocks(30, new ECB(11, 15),
                new ECB(46, 16))),
        new Version(34, new int[]{6, 34, 62, 90, 118, 146},
            new ECBlocks(30, new ECB(13, 115),
                new ECB(6, 116)),
            new ECBlocks(28, new ECB(14, 46),
                new ECB(23, 47)),
            new ECBlocks(30, new ECB(44, 24),
                new ECB(7, 25)),
            new ECBlocks(30, new ECB(59, 16),
                new ECB(1, 17))),
        new Version(35, new int[]{6, 30, 54, 78, 102, 126, 150},
            new ECBlocks(30, new ECB(12, 121),
                new ECB(7, 122)),
            new ECBlocks(28, new ECB(12, 47),
                new ECB(26, 48)),
            new ECBlocks(30, new ECB(39, 24),
                new ECB(14, 25)),
            new ECBlocks(30, new ECB(22, 15),
                new ECB(41, 16))),
        new Version(36, new int[]{6, 24, 50, 76, 102, 128, 154},
            new ECBlocks(30, new ECB(6, 121),
                new ECB(14, 122)),
            new ECBlocks(28, new ECB(6, 47),
                new ECB(34, 48)),
            new ECBlocks(30, new ECB(46, 24),
                new ECB(10, 25)),
            new ECBlocks(30, new ECB(2, 15),
                new ECB(64, 16))),
        new Version(37, new int[]{6, 28, 54, 80, 106, 132, 158},
            new ECBlocks(30, new ECB(17, 122),
                new ECB(4, 123)),
            new ECBlocks(28, new ECB(29, 46),
                new ECB(14, 47)),
            new ECBlocks(30, new ECB(49, 24),
                new ECB(10, 25)),
            new ECBlocks(30, new ECB(24, 15),
                new ECB(46, 16))),
        new Version(38, new int[]{6, 32, 58, 84, 110, 136, 162},
            new ECBlocks(30, new ECB(4, 122),
                new ECB(18, 123)),
            new ECBlocks(28, new ECB(13, 46),
                new ECB(32, 47)),
            new ECBlocks(30, new ECB(48, 24),
                new ECB(14, 25)),
            new ECBlocks(30, new ECB(42, 15),
                new ECB(32, 16))),
        new Version(39, new int[]{6, 26, 54, 82, 110, 138, 166},
            new ECBlocks(30, new ECB(20, 117),
                new ECB(4, 118)),
            new ECBlocks(28, new ECB(40, 47),
                new ECB(7, 48)),
            new ECBlocks(30, new ECB(43, 24),
                new ECB(22, 25)),
            new ECBlocks(30, new ECB(10, 15),
                new ECB(67, 16))),
        new Version(40, new int[]{6, 30, 58, 86, 114, 142, 170},
            new ECBlocks(30, new ECB(19, 118),
                new ECB(6, 119)),
            new ECBlocks(28, new ECB(18, 47),
                new ECB(31, 48)),
            new ECBlocks(30, new ECB(34, 24),
                new ECB(34, 25)),
            new ECBlocks(30, new ECB(20, 15),
                new ECB(61, 16)))
    };
  }
884469
def get_current_version(self, increment=None):
		
		ver = (
			self.get_tagged_version()
			or str(self.get_next_version(increment)) + '.dev0'
		)
		return str(ver)
706888
protected function askBuildVersion()
    {
        $last_version = $this->gitLatestVersionTag();
        $next_version = $this->incrementVersion($last_version);

        $question = (new Question("Set build version [{$next_version}]: ", $next_version))
            ->setValidator(function ($input_version) use ($last_version) {
                $input_version = trim($input_version);

                if (version_compare($input_version, $last_version, '==')) {
                    throw new \RuntimeException(
                        'Build version has already been used.'
                    );
                }

                if (!$this->isVersionNumeric($input_version)) {
                    throw new \RuntimeException(
                        'Build version is not numeric.'
                    );
                }

                return $input_version;
            });

        return $this->doAsk($question);
    }
1153971
def generate_git_version_info():
    
    info = GitInfo()
    git_path = call(('which', 'git'))

    # get build info
    info.builder = get_build_name()
    info.build_date = get_build_date()

    # parse git ID
    info.hash, info.date, info.author, info.committer = (
        get_last_commit(git_path))

    # determine branch
    info.branch = get_git_branch(git_path)

    # determine tag
    info.tag = get_git_tag(info.hash, git_path)

    # determine version
    if info.tag:
        info.version = info.tag.strip('v')
        info.release = not re.search('[a-z]', info.version.lower())
    else:
        info.version = info.hash[:6]
        info.release = False

    # Determine *last* stable release
    info.last_release = determine_latest_release_version()

    # refresh index
    call((git_path, 'update-index', '-q', '--refresh'))

    # check working copy for changes
    info.status = get_git_status(git_path)

    return info
134862
def get_version(self, service_id, version_number):
		""""""
		content = self._fetch("/service/%s/version/%d" % (service_id, version_number))
		return FastlyVersion(self, content)
648615
function( version ) {

    version = version || '4.0'

    var keys = Object.keys( this.data )
    var data = [ [ 'version', {}, 'text', version ] ]
    var prop = null

    for( var i = 0; i < keys.length; i++ ) {
      if( keys[i] === 'version' ) continue;
      prop = this.data[ keys[i] ]
      if( Array.isArray( prop ) ) {
        for( var k = 0; k < prop.length; k++ ) {
          data.push( prop[k].toJSON() )
        }
      } else {
        data.push( prop.toJSON() )
      }
    }

    return [ 'vcard', data ]

  }
745610
def get_version_info():
    """"""
    version_info = {}
    with open(os.path.join("refcycle", "version.py"), 'r') as f:
        version_code = compile(f.read(), "version.py", 'exec')
        exec(version_code, version_info)
    return version_info