コード例 #1
0
ファイル: ThrowLiferaft.php プロジェクト: cpass78/liferaft
 /**
  * Send the pull request to the Laravel repository.
  *
  * @param  string  $username
  * @param  string  $liferaftFile
  * @return string
  */
 protected function sendPullRequest($username, $branch, $toBranch, $liferaftFile)
 {
     try {
         return $this->github->sendPullRequest($username, $branch, $toBranch, $this->getLiferaftFile());
     } catch (\Exception $e) {
         $this->failed();
         $this->kill('Unable to send pull request. Do you already have one open?');
     }
 }
コード例 #2
0
ファイル: DestroyLiferaft.php プロジェクト: cpass78/liferaft
 /**
  * Execute the action.
  *
  * @return void
  */
 public function execute()
 {
     $this->task('Deleting Liferaft Repository...', function () {
         try {
             $this->github->deleteRepository($this->github->getUsername(), 'liferaft');
         } catch (\Exception $e) {
             $this->failAndKill('Unable to delete repository. Does your GitHub token have enough permissions?');
         }
         @unlink(getcwd() . '/liferaft.md');
     });
     $this->info('Done! This directory may be deleted.');
 }
コード例 #3
0
ファイル: CreateLiferaft.php プロジェクト: cpass78/liferaft
 /**
  * Rename the given repository.
  *
  * @param  string  $username
  * @param  string  $repository
  * @param  string  $name
  * @return void
  */
 protected function renameRepository($username, $repository, $name)
 {
     try {
         $this->github->rename($username, $repository, $name);
     } catch (\Exception $e) {
         sleep(3);
         $this->renameRepository($username, $repository, $name);
     }
 }
コード例 #4
0
ファイル: GrabLiferaft.php プロジェクト: danharper/liferaft
 /**
  * Get the pull request at the given ID.
  *
  * @return array
  */
 protected function getPullRequest($id)
 {
     if ($id == 'random') {
         $id = $this->github->getRandomPullRequestId();
     }
     try {
         return $this->github->getPullRequest($id);
     } catch (\Exception $e) {
         $this->failAndKill('Invalid pull request ID.');
     }
 }