Defines a new version.
 @!visibility private
438976
def version(*list, inherit_from: nil, &block)
      superclass = self[inherit_from] || self
      subclass   = Class.new(superclass, &block)
      list.each { |v| versions[v] = subclass }
    end
755967
private function setNewVersionNumber()
  {
    $valid = false;
    while (!$valid)
    {
      echo "Enter new Semantic Version: ";

      $line               = fgets(STDIN);
      $this->myNewVersion = $this->validateSemanticVersion($line);
      $valid              = ($this->myNewVersion);

      if (!$valid)
      {
        $this->logInfo("%s is not a valid Semantic Version", trim($line, "\n"));
      }
    }
  }
1156950
function() {
    let detectedVersion;

    if (this._options.useAppVersion && this._appVersion) {
      detectedVersion = this._appVersion;
    }

    if (!detectedVersion) {
      detectedVersion = this.parent.pkg.version;
    }

    if (detectedVersion && this._options.enabled) {
      const fileName = this._options.fileName;

      this.ui.writeLine(`Created ${fileName} with ${detectedVersion}`);
      return writeFile(fileName, detectedVersion);
    }
  }
215154
function (version) {
    var vs = version.replace(/[^0-9\\.]/g, '');
    vs = vs.replace(/\./g, '_');
    return vs;
  }
529958
function AddrResult(hrp, version, hash) {
  this.hrp = hrp;
  this.version = version;
  this.hash = hash;
}
430289
def update_version_constant(version)
      if main_include && File.exist?(main_include)
        file_contents = File.read(main_include)
        if file_contents.sub!(/^(\s+VERSION\s*=\s*)[^\s].*$/) { $1 + version.to_s.inspect }
          File.open(main_include, 'w') { |f| f << file_contents }
          modified_files << main_include
        end
      end
    end
163122
def version
      logger.info "Determining Vagrant version for #{description}"
      output = execute!("--version").stdout
      Derelict::Parser::Version.new(output).version
    end
911766
function (version) {
        return __awaiter(this, void 0, void 0, function* () {
            let versions = yield ForestInternal.queryVersionCache();
            for (let ver of versions) {
                if (ver.expanded === version) {
                    return Promise.resolve(ver);
                }
            }
            throw new ForestError(Errors.VersionNoExactMatch, `Local cache does not contain ${version}`);
        });
    }
1062677
function generateVersionsTooltip(versions) {
    return versions.map(function(lib) {
      return lib.name + " " + lib.version;
    }).join("\n");
  }
344935
function() {
    this.versionMajor = undefined;
    this.versionMinor = undefined;
    this.dataCipherUuid = undefined;
    this.compression = undefined;
    this.masterSeed = undefined;
    this.transformSeed = undefined;
    this.keyEncryptionRounds = undefined;
    this.encryptionIV = undefined;
    this.protectedStreamKey = undefined;
    this.streamStartBytes = undefined;
    this.crsAlgorithm = undefined;
    this.endPos = undefined;
    this.kdfParameters = undefined;
    this.publicCustomData = undefined;
    Object.preventExtensions(this);
}
7198
function toDrupalMajorVersion(version) {
    var regex = /^(\d+)\.\d+\.[x\d+]/;
    var match = version.match(regex)
    if (match) {
      return match[1] + '.x';
    }

    return version;
  }
443179
function checkMinVersion() {
  const majorVersion = Number(process.version.replace(/v/, '').split('.')[0]);
  if (majorVersion < NODE_MIN_VERSION) {
    $$.util.log('Please run Web Activities with node.js version ' +
        `${NODE_MIN_VERSION} or newer.`);
    $$.util.log('Your version is', process.version);
    process.exit(1);
  }
}
516839
async function updateVersion(file) {
  const { default: config } = await import(`${CONFIGS_PATH}/${file}`);
  const { packageName } = config;

  const packageInfoFile = `${PACKAGES_PATH}/${packageName}/package.json`;
  const { default: packageInfo } = await import(packageInfoFile);

  if (info.version !== packageInfo.version) {
    const newPackageInfo = {
      ...packageInfo,
      version: info.version,
    };

    writeFileAsync(packageInfoFile, JSON.stringify(newPackageInfo, null, '  '))
      .then(
        () => console.log(`Updated ${packageName} to ${info.version}`),
        error => console.log(error),
      );
  }
}
307663
function changeVersion() {
  log.info('Updating version number...');

  const packageJsonPath = path.join(__dirname, '../../components/package.json');
  const appComponentPath = path.join(__dirname, '../site/_site/doc/app/app.component.ts');
  const codeBoxPath = path.join(__dirname, '../site/_site/doc/app/share/nz-codebox/stack-blitz.ts');
  const zorroVersionPath = path.join(__dirname, '../../components/version.ts');

  const packageJson = fs.readJsonSync(packageJsonPath);
  const currentVersion = packageJson.version;
  let versionNumberValid = false;
  let version;

  function parseVersion(version) {
    const matches = version.match(versionNameRegex);

    if (!matches) {
      return null;
    }

    return {
      major : Number(matches[1]),
      minor : Number(matches[2]),
      patch : Number(matches[3]),
      preTag: matches[4],
      pre   : Number(matches[5]),
    }
  }

  function checkVersionNumber(cur, next) {
    // Must be numbers and dots.
    if (!versionNameRegex.test(next)) {
      return false;
    }

    const curVersion = parseVersion(cur);
    const nextVersion = parseVersion(next);

    for (const k of ['major', 'minor', 'patch']) {
      if (curVersion[k] < nextVersion[k]) {
        return true;
      }

      if (curVersion[k] > nextVersion[k]) {
        return false;
      }
    }

    if (curVersion.preTag !== nextVersion.preTag) {
      return true;
    }

    return curVersion.pre < nextVersion.pre
  }

  while (!versionNumberValid) {
    version = read.question(chalk.bgYellow.black('Please input the new version:') + '  ');
    if (checkVersionNumber(currentVersion, version)) {
      versionNumberValid = true;
      nextVersion = version;
    } else {
      log.error(`Your input ${version} is not after the current version ${currentVersion} or is unvalid. Please check it.`);
    }
  }

  fs.writeJsonSync(packageJsonPath, {...packageJson, version: version}, {spaces: 2});
  fs.writeFileSync(appComponentPath,
    fs.readFileSync(appComponentPath, 'utf-8')
      .replace(/currentVersion = '.+';/g, `currentVersion = '${version}';`)
  );
  fs.writeFileSync(codeBoxPath,
    fs.readFileSync(codeBoxPath, 'utf-8').replace(/'ng-zorro-antd'\s*: '.+'/g, `'ng-zorro-antd': '^${version}'`)
  );
  fs.writeFileSync(zorroVersionPath,
    fs.readFileSync(zorroVersionPath, 'utf-8')
      .replace(/Version\('.+'\);/g, `Version('${version}');`)
  );
  log.success('Version updated!');
}
96950
protected function writeVersionInfo()
    {
        if (PHP_SAPI !== 'cli') {
            return;
        }

        try {
            $client = $this->config->getChecker();
            if (!$client->isLatest()) {
                $this->output->writeln(\sprintf('New version is available (current: %s, latest: %s)', self::VERSION, $client->getLatest()));
            }
        } catch (\InvalidArgumentException $e) {
            $this->output->writeln($e->getMessage());
        }
    }
927890
function updateNpmVersion(pluginConfig, config, callback) {
    const files = readFilePaths(FILES);
    const version = config.nextRelease.version;
    let git = "";

    for (let i = 0; i < files.length; i++) {
      // update
      const file = files[i];
      const content = readContent(file);
      const updated = updateVersion(file, content, version);

      // save
      git += `git add ${file} && `;
      saveContent(file, updated);
    }
    // publish
    isChange && commitChanges(git, version);
  }
708760
function functionPublishVersion(name, description, hash) {
    return new Promise((resolve, reject) => {
        lambda.publishVersion({
            FunctionName: name,
            Description: description,
            CodeSha256: hash
        }, function(err, data) {
            if (err) return reject(err);
            resolve(data);
        });
    });
}