civo_cli 0.3.17 → 0.3.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f28db3afa45bde614833b595a4eb92bc274755f6a7440532e9ed159bb67773b9
4
- data.tar.gz: 5139b7f529bdbcdaf2b6e87541a7e05421b9393b83e5fb26af2d1ef4e3cd9bc8
3
+ metadata.gz: f93f73f2a2afbc365839db9f52da82fdd3f292a6e159d4d5e3f22f1cda88ae62
4
+ data.tar.gz: 97bc0335f30dc807700f7bda9b4e60d72686debc39f5db2894d7997012f545a2
5
5
  SHA512:
6
- metadata.gz: 6bc62ba338c5fdc4d090b5f06ce317f22a37c13267e9d975eb30da57346de800033eec53829bc3108aae22ed3edf7bd7aaff316a390aff24449f8454ac5906da
7
- data.tar.gz: 200b594a80530e5fe294ee77127fd4d3d00cbc93161f4b7e724496ed87502480eda6c4e0b7baa37e622c218b3bf30dacefb47bdf84be45444b35a1167eaaff89
6
+ metadata.gz: 68ef9d04db721b0b9ec8717b2e0bebf5279ab948b37dbf66727bef2340c700fbfacae546bd01b0eaeabbd003dc88e6f11b7687f73ce252cedf345d8d7eba620f
7
+ data.tar.gz: 444d5ece596ff7d0bf6acf3e45c5c0956431e1f654ae69d250a5d49d4e6be342f817e242bd6c0ef420eeba5cf5ead66dc6996c67b463084a13155aeb6797bbee
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@ All notable changes to the Civo CLI will be documented in this file.
3
3
 
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [0.3.17] - 2019-09-11
7
+ ### Changed
8
+ - If there is one exact match for a cluster, return that, only try partial matches if there are no exact matches
9
+
6
10
  ## [0.3.17] - 2019-09-11
7
11
  ### Changed
8
12
  - Edited help text for cluster creation to clarify application name discovery
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- civo_cli (0.3.17)
4
+ civo_cli (0.3.18)
5
5
  bundler (~> 1.17)
6
6
  civo (>= 1.2.8)
7
7
  colorize
@@ -35,7 +35,7 @@ GEM
35
35
  faraday (0.15.4)
36
36
  multipart-post (>= 1.2, < 3)
37
37
  ffi (1.11.1)
38
- flexirest (1.7.9)
38
+ flexirest (1.8.0)
39
39
  activesupport
40
40
  crack
41
41
  faraday
@@ -112,7 +112,7 @@ GEM
112
112
  addressable (>= 2.3.6)
113
113
  crack (>= 0.3.2)
114
114
  hashdiff (>= 0.4.0, < 2.0.0)
115
- zeitwerk (2.1.9)
115
+ zeitwerk (2.1.10)
116
116
 
117
117
  PLATFORMS
118
118
  ruby
@@ -1,3 +1,3 @@
1
1
  module CivoCLI
2
- VERSION = "0.3.17"
2
+ VERSION = "0.3.18"
3
3
  end
data/lib/finder.rb CHANGED
@@ -4,6 +4,10 @@ class Finder
4
4
  Civo::Kubernetes.all.items.each do |cluster|
5
5
  result << cluster
6
6
  end
7
+
8
+ matched = result.detect { |cluster| cluster.name == id || cluster.id == id }
9
+ return matched if matched
10
+
7
11
  result.select! { |cluster| cluster.name.include?(id) || cluster.id.include?(id) }
8
12
 
9
13
  if result.count.zero?
@@ -19,10 +23,14 @@ class Finder
19
23
 
20
24
  def self.detect_app(name)
21
25
  result = []
22
- Civo::Kubernetes.applications.items.each do |app|
26
+ apps = Civo::Kubernetes.applications.items
27
+ apps.each do |app|
23
28
  result << app if app.name.downcase.include?(name.downcase)
24
29
  end
25
30
 
31
+ matched = apps.detect { |app| app.name.downcase == name.downcase }
32
+ return matched if matched
33
+
26
34
  if result.count.zero?
27
35
  puts "No Kubernetes marketplace applications found for '#{name}'. Please check your query."
28
36
  exit 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: civo_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.17
4
+ version: 0.3.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
252
  - !ruby/object:Gem::Version
253
253
  version: '0'
254
254
  requirements: []
255
- rubygems_version: 3.0.3
255
+ rubygems_version: 3.0.6
256
256
  signing_key:
257
257
  specification_version: 4
258
258
  summary: CLI for interacting with Civo.com