Evaluates a condition

@param  \CaptainHook\App\Console\IO       $io
@param  \SebastianFeldmann\Git\Repository $repository
@return bool
335782
public function isTrue(IO $io, Repository $repository) : bool
    {
        $result = $this->processor->run($this->command);

        return $result->isSuccessful();
    }
435287
public function execute(Arguments $args, ConsoleIo $io)
    {
        $io->out(Configure::version());

        return static::CODE_SUCCESS;
    }
1024720
public function handle(Args $args, IO $io)
    {
        $path = Path::makeAbsolute($args->getArgument('path'), $this->currentPath);

        $resource = $this->repo->get($path);
        $total = 0;

        $io->writeLine('<c1>'.$resource->getPath().'</c1>');

        $this->printTree($io, $resource, $total);

        $io->writeLine('');
        $io->writeLine($total.' resources');

        return 0;
    }
687096
public static function pick(Repository $repository, $treeish = null)
    {
        $commit = new self($repository, $treeish);
        $commit->createFromCommand();

        return $commit;
    }
685546
public function run(RawArgs $args, IO $io)
    {
        return $this->handle($this->parseArgs($args), $io);
    }
814025
public function activate(Composer $composer, IOInterface $io)
    {
        $this->package = $composer->getPackage();
        $this->io = $io;

        // TODO: get the project root - must be a better way to do this
        $this->projectRoot = realpath(dirname($composer->getConfig()->get('vendor-dir')));
    }
187060
public function execute(Config $config, IO $io, Repository $repository, Config\Action $action) : void
    {
        $options = $action->getOptions();
        $oldMsg  = $repository->getCommitMsg();

        if (!$repository->isMerging()) {
            $repository->setCommitMsg(new CommitMessage($options->get('message', ''), $oldMsg->getCommentCharacter()));
        }
    }
751681
private function doSetAction(Repository $repository, $item)
    {
        if (!$this->hasArgument('value')) {
            $this->output->error('A value must be provided when using the "set" action.');
        }

        $value = $this->argument('value');
        $repository->save($item, $this->unserialize($value));
    }
858576
public function activate(Composer $composer, IOInterface $io)
    {
        $this->composer = $composer;
        $this->io = $io;

        $this->enabled = $this->composer->getPackage()->getExtra()['rikudou']['installer']['enabled'] ?? true;
        $this->excluded = $this->composer->getPackage()->getExtra()['rikudou']['installer']['exclude'] ?? [];

        $this->preload();
    }
826535
public function delete($repository, $keys)
    {
        $context = $this->getCommandContext();

        $context->repository = $repository;
        $context->keys = $keys;
        $context->query = AnDomainQuery::getInstance($repository, $keys)->delete();

        if ($this->getCommandChain()->run('before.delete', $context) !== false) {
            $context->result = $this->execute($context->query);
            $this->getCommandChain()->run('after.delete', $context);
        }

        return $context->result;
    }
606586
protected function validateRepositories($index, $repo)
    {
        if (!\is_array($repo)) {
            throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') should be an array, '.\gettype($repo).' given');
        }
        if (!isset($repo['type'])) {
            throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a type defined');
        }

        $this->validatePackageRepositories($index, $repo);
        $this->validateVcsRepositories($index, $repo);
    }
469776
public function insert(Repository $repository = null)
    {
        if (!$repository) {
            $repository = $this->getRepository();
        }

        $repository = $repository->aliased('write');

        $insert = $this->getQuery()->transformToInsert();

        $prepare = $repository->prepareQuery($insert);

        return $repository->executePrepared($prepare);
    }
102157
public function run(InputInterface $input, OutputInterface $output): ?int
    {
        $return = $this->execute($input, $output);
        if (null === $return) {
            $return = EdgarCronRepository::STATUS_OK;
        }

        return $return;
    }
533991
public boolean matches(GHRepository repo) throws IOException {
        return userName.equals(repo.getOwner().getLogin()) // TODO: use getOwnerName
                && repositoryName.equals(repo.getName())
                && host.equals(repo.getHtmlUrl().getHost());
    }
220343
public function show($username, $repository, $reference)
    {
        $reference = $this->encodeReference($reference);

        return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/'.$reference);
    }
442127
protected function runCommand(InputInterface $input, OutputInterface $output)
    {
        $appName = $input->getArgument('app-name');
        list($_, $indexUUID) = $this->getRepositoryAndIndex($input, $output);

        $this
            ->repositoryBucket
            ->findRepository($appName)
            ->resetIndex($indexUUID);
    }
257366
protected function validateVcsRepositories($index, $repo)
    {
        if ('package' === $repo['type']) {
            return;
        }

        if (false === strpos($repo['type'], '-')) {
            throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a type defined in this way: "%asset-type%-%type%"');
        }
        if (!isset($repo['url'])) {
            throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a url defined');
        }
    }