Ejemplo n.º 1
0
 /**
  * Returns the highest valid version tag.
  * 
  * @return Version
  */
 public function getCurrentVersion()
 {
     $tags = $this->getValidVersionTags();
     if (count($tags) === 0) {
         return Version::createInitialVersion();
     }
     usort($tags, array("vierbergenlars\\SemVer\\version", "compare"));
     return new Version(array_pop($tags));
 }
Ejemplo n.º 2
0
 protected function initialize(InputInterface $input, OutputInterface $output)
 {
     $this->getContext()->setService('output', $this->output);
     $this->getContext()->getInformationCollector()->handleCommandInput($input);
     // Get the current version or generate a new one if the user has confirm that this is required
     try {
         $currentVersion = $this->getContext()->getVersionPersister()->getCurrentVersion();
     } catch (\Liip\RMT\Exception\NoReleaseFoundException $e) {
         if ($this->getContext()->getInformationCollector()->getValueFor('confirm-first') == false) {
             throw $e;
         }
         $currentVersion = \Liip\RMT\Version::createInitialVersion();
     }
     $this->getContext()->setParameter('current-version', $currentVersion);
     $this->writeBigTitle('New release (current is ' . $currentVersion . ')');
     $this->executeActionListIfExist('prerequisites');
 }
Ejemplo n.º 3
0
 public function testCreateInitialVersion()
 {
     $version = Version::createInitialVersion();
     $this->assertInstanceOf("Liip\\RMT\\Version", $version);
 }
Ejemplo n.º 4
0
 /**
  * Returns 0.0.0
  * 
  * @return vierbergenlars\SemVer\version
  */
 public function getInitialVersion()
 {
     return Version::createInitialVersion();
 }