Bump version following semantic versioning rules.
2073
def bump(self, level='patch', label=None):
        
        bump = self._bump_pre if level == 'pre' else self._bump
        bump(level, label)
921485
def validate_version(version)
      return if SemanticPuppet::Version.valid?(version)

      err = _("version string cannot be parsed as a valid Semantic Version")
      raise ArgumentError, _("Invalid 'version' field in metadata.json: %{err}") % { err: err }
    end
1088388
function generate_module_version_map (modules, host) {
  modules.forEach(function(mod) {
    var name = mod.split('@')[0];
    host[name] = mod;
  });
}
458897
def versions
      @versions ||=
        repo
        .tags
        .map(&:name)
        .select { |tag| tag =~ /(.*\..*\..*)/ }
        .map { |tag| Semverse::Version.try_new tag }
        .compact
    end
406846
function bumpVersion(files, bumpType) {
    status('Bump', bumpType, 'version to files:', files.join(' '));
    if (config.dryRun) return '[not available in dry run]';

    var newVersion;
    var originalVersion;
    files.forEach(function(fileName) {
        var filePath = path.join(projectRoot, fileName);

        var data = JSON.parse(fs.readFileSync(filePath));
        originalVersion = data.version;
        var currentVersion = data.version;
        if (!semver.valid(currentVersion)) {
            var msg = 'Invalid version ' + currentVersion +
                ' in file ' + fileName;;
            var err = new Error(msg);
            throw err;
        }

        if (S(currentVersion).endsWith(config.devSuffix)) {
            currentVersion = S(currentVersion).chompRight(config.devSuffix).s;
        }

        if (bumpType === 'dev') {
            newVersion = currentVersion + config.devSuffix;
        } else {
            newVersion = semver.inc(currentVersion, bumpType);
        }
        data.version = newVersion;

        var content = JSON.stringify(data, null, config.indentation);
        fs.writeFileSync(filePath, content);

        status('Bump', originalVersion, '->', newVersion, 'in',
            fileName);
    });

    return newVersion;
}
538673
function transformVersionInfo() {

		// get the transitive dependencies of the given libs from the sap.ui.versioninfo
		// only do this once if mKnownLibs is not created yet
		if (sap.ui.versioninfo && sap.ui.versioninfo.libraries && !mKnownLibs) {
			// flatten dependency lists for all libs
			mKnownLibs = {};
			sap.ui.versioninfo.libraries.forEach(function(oLib, i) {
				mKnownLibs[oLib.name] = {};

				var mDeps = oLib.manifestHints && oLib.manifestHints.dependencies &&
							oLib.manifestHints.dependencies.libs;
				for (var sDep in mDeps) {
					if (!mDeps[sDep].lazy) {
						mKnownLibs[oLib.name][sDep] = true;
					}
				}
			});
		}

		// get transitive dependencies for a component
		if (sap.ui.versioninfo && sap.ui.versioninfo.components && !mKnownComponents) {
			mKnownComponents = {};

			Object.keys(sap.ui.versioninfo.components).forEach(function(sComponentName) {
				var oComponentInfo = sap.ui.versioninfo.components[sComponentName];

				mKnownComponents[sComponentName] = {
					library: oComponentInfo.library,
					dependencies: []
				};

				var mDeps = oComponentInfo.manifestHints && oComponentInfo.manifestHints.dependencies &&
							oComponentInfo.manifestHints.dependencies.libs;
				for (var sDep in mDeps) {
					if (!mDeps[sDep].lazy) {
						mKnownComponents[sComponentName].dependencies.push(sDep);
					}
				}
			});
		}
	}
1257303
def bump_minor_version():
    """"""
    version = load_version_as_list()
    print('current version: {}'.format(format_version_string(version)))
    version[-1] += 1
    print('new version: {}'.format(format_version_string(version)))

    contents = "__version__ = '{}'\n".format(format_version_string(version))

    with open(VERSION_PATH, 'w') as wfile:
        wfile.write(contents)
767729
def bump_version(version, bump='patch'):
    """"""
    try:
        parts = map(int, version.split('.'))
    except ValueError:
        fail('Current version is not numeric')

    if bump == 'patch':
        parts[2] += 1
    elif bump == 'minor':
        parts[1] += 1
        parts[2] = 0
    elif bump == 'major':
        parts[0] +=1
        parts[1] = 0
        parts[2] = 0

    return '.'.join(map(str, parts))
1329288
function processVersioned (entity, version, versions) {
  quantum.select(entity)
    .selectAll('versioned', {recursive: true})
    .forEach(versioned => {
      const candidateVersionSelections = versioned.selectAll('version')
      const currentVersion = mostRecentVersion(version, candidateVersionSelections, versions)
      if (currentVersion) {
        versioned.addAfter(currentVersion.content())
      }
      versioned.remove()
    })
}
804369
def bump(oldversion, level)
      major = minor = patch = 0
      if oldversion =~ /^(\d+)\.(\d+)\.(\d+)$/
        major = Regexp.last_match(1).to_i
        minor = Regexp.last_match(2).to_i
        patch = Regexp.last_match(3).to_i
      end
      case level.to_sym
      when :major
        major += 1
        minor = 0
        patch = 0
      when :minor
        minor += 1
        patch = 0
      when :patch
        patch += 1
      end
      version = [major, minor, patch].compact.join('.')
      version
    end
56276
def versions(args = {}, &bl)
      local_args = Hash[args]
      recursive  = local_args[:recursive]
      dev_deps   = local_args[:dev_deps]
      versions   = local_args[:versions] || {}

      gem_versions = Polisher::VersionChecker.versions_for(name, &bl)
      versions.merge! name => gem_versions
      local_args[:versions] = versions

      if recursive
        versions.merge! dependency_versions local_args, &bl
        versions.merge! dependency_versions local_args.merge(:dev => true), &bl if dev_deps
      end

      versions
    end
108320
async function commitVersionBump (version) {
  const gitDir = path.resolve(__dirname, '..')
  const gitArgs = ['commit', '-a', '-m', `Bump v${version}`, '-n']
  await GitProcess.exec(gitArgs, gitDir)
}
1062677
function generateVersionsTooltip(versions) {
    return versions.map(function(lib) {
      return lib.name + " " + lib.version;
    }).join("\n");
  }
444716
function Version(major, minor, micro, build) {

    if (typeof major === "number" && major % 1 === 0)
        this._major = major;
    else
        throw new Error("Invalid major version number '" + major + "'");

    if (typeof minor === "number" && minor % 1 === 0)
        this._minor = minor;
    else
        throw new Error("Invalid minor version number '" + minor + "'");

    if (typeof micro === "number" && micro % 1 === 0)
        this._micro = micro;
    else
        throw new Error("Invalid micro version number '" + micro + "'");

    if (typeof build === "number" && build % 1 === 0)
        this._build = build;
    else
        throw new Error("Invalid build version number '" + build + "'");
}
614660
def bump(match):
	""""""
	before, old_version, after = match.groups()
	major, minor, patch = map(int, old_version.split('.'))
	patch += 1
	if patch == 10:
		patch = 0
		minor += 1
		if minor == 10:
			minor = 0
			major += 1
	new_version = '{0}.{1}.{2}'.format(major, minor, patch)

	print('{0} => {1}'.format(old_version, new_version))

	return before + new_version + after
583797
function mergeForVersions(versions, opts) {
    opts = _.defaults(opts || {}, {
        includeTag: true
    });

    return _.chain(versions)
        .reduce(function(prev, version) {
            if (!version.notes) return prev;

            // Include tag as title
            if (opts.includeTag) {
                prev = prev + '## ' + version.tag + '\n';
            }

            // Include notes
            prev = prev + version.notes + '\n';

            // New lines
            if (opts.includeTag) {
                prev = prev + '\n';
            }

            return prev;
        }, '')
        .value();
}
240311
private void merge(Versioning versioning, ArtifactRepository from, List<VersionInfo> found) {
        if ( StringUtils.isNotEmpty( versioning.getRelease() ) )
            found.add(new VersionInfo(versioning.getRelease(),from));

        if ( StringUtils.isNotEmpty( versioning.getLatest() ) )
            found.add(new VersionInfo(versioning.getLatest(),from));

        for ( String v : versioning.getVersions() )
            found.add(new VersionInfo(v,from));
    }

    VersionInfo findLatest(List<VersionInfo> infos) {
        Collections.sort(infos);
        if (infos.isEmpty())    return null;
        return infos.get(infos.size()-1);
    }

    private static class VersionInfo implements Comparable<VersionInfo> {
        final VersionNumber version;
        final ArtifactRepository repository;

        public VersionInfo(String version, ArtifactRepository repository) {
            this.version = new VersionNumber(version);
            this.repository = repository;
        }

        public int compareTo(VersionInfo that) {
            return this.version.compareTo(that.version);
        }
    }
    
    private Versioning readVersions( RepositorySystemSession session, RequestTrace trace, Metadata metadata,
                                     ArtifactRepository repository, VersionResult result )
    {
        Versioning versioning = null;

        FileInputStream fis = null;
        try
        {
            if ( metadata != null )
            {
                SyncContext syncContext = syncContextFactory.newInstance( session, true );

                try
                {
                    syncContext.acquire( null, Collections.singleton( metadata ) );

                    if ( metadata.getFile() != null && metadata.getFile().exists() )
                    {
                        fis = new FileInputStream( metadata.getFile() );
                        org.apache.maven.artifact.repository.metadata.Metadata m =
                            new MetadataXpp3Reader().read( fis, false );
                        versioning = m.getVersioning();

                        /*
                         * NOTE: Users occasionally misuse the id "local" for remote repos which screws up the metadata
                         * of the local repository. This is especially troublesome during snapshot resolution so we try
                         * to handle that gracefully.
                         */
                        if ( versioning != null && repository instanceof LocalRepository)
                        {
                            if ( versioning.getSnapshot() != null && versioning.getSnapshot().getBuildNumber() > 0 )
                            {
                                Versioning repaired = new Versioning();
                                repaired.setLastUpdated( versioning.getLastUpdated() );
                                Snapshot snapshot = new Snapshot();
                                snapshot.setLocalCopy( true );
                                repaired.setSnapshot( snapshot );
                                versioning = repaired;

                                throw new IOException( "Snapshot information corrupted with remote repository data"
                                    + ", please verify that no remote repository uses the id '" + repository.getId()
                                    + "'" );
                            }
                        }
                    }
                }
                finally
                {
                    syncContext.release();
                }
            }
        }
        catch ( Exception e )
        {
            invalidMetadata( session, trace, metadata, repository, e );
            result.addException( e );
        }
        finally
        {
            IOUtil.close(fis);
        }

        return ( versioning != null ) ? versioning : new Versioning();
    }

    private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, Metadata metadata,
                                  ArtifactRepository repository, Exception exception )
    {
        RepositoryListener listener = session.getRepositoryListener();
        if ( listener != null )
        {
            DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace );
            event.setMetadata( metadata );
            event.setException( exception );
            event.setRepository( repository );
            listener.metadataInvalid( event );
        }
    }

    private static final String MAVEN_METADATA_XML = "maven-metadata.xml";

    private static final String LATEST = "LATEST";

    private static final String SNAPSHOT = "SNAPSHOT";
}