From a07f31c3c059da2c6fc0be4dcecb983770f8ec2f Mon Sep 17 00:00:00 2001 From: Rodrigo Bermudez Schettino Date: Tue, 5 Sep 2017 13:15:33 +0200 Subject: [PATCH] Gems: Add gem version in alfred's subtext The subtext shown in Alfred for each gem has now the format: "{version} - {info}". Also removed trailing whitespaces in file. --- src/Gems.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Gems.php b/src/Gems.php index 151328a..e5e1f3b 100644 --- a/src/Gems.php +++ b/src/Gems.php @@ -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;