Skip to content

Commit

Permalink
Merge pull request #109 from rodrigobdz/patch-1
Browse files Browse the repository at this point in the history
Add gem version to alfred's subtext
  • Loading branch information
willfarrell authored Sep 5, 2017
2 parents c296e23 + a07f31c commit 8a9cd26
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Gems.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ class Gems extends Repo
public function search($query)
{
if (!$this->hasMinQueryLength($query)) {
return $this->xml();
return $this->xml();
}

$this->pkgs = $this->cache->get_query_json(
$this->id,
$query,
$this->id,
$query,
"{$this->url}/api/v1/search?query={$query}"
);

foreach($this->pkgs as $pkg) {
if ($this->check($pkg, $query, 'name', 'info')) {
$title = $pkg->name;

$version = $pkg->version;
$this->cache->w->result(
$title,
$this->makeArg($title, $pkg->project_uri),
$title,
$pkg->info,
"{$version} - $pkg->info",
"icon-cache/{$this->id}.png"
);
}

// only search till max return reached
if ( count ( $this->cache->w->results() ) == $this->max_return ) {
break;
Expand Down

0 comments on commit 8a9cd26

Please sign in to comment.