kontena-cli 1.2.0.rc1 → 1.2.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1303357caabb58711e52c64fef54b12a9afc989
4
- data.tar.gz: 8ce9069dcf068450f990cb23fddac6792a7956c6
3
+ metadata.gz: 916851395849968592a3880129bc0a0b0bbfc364
4
+ data.tar.gz: 0f69d57751a082bd8749a81c71a035725ab88287
5
5
  SHA512:
6
- metadata.gz: 7df9880f68b96488d865427015884e99af34a56c9b4b0c52df1c4614e15e5e3686f386fa672ea1310c42801cb6e8b6d82a2387dca9439800f3b2e980e06ae01a
7
- data.tar.gz: d1447a0ac64a834660c7b4857e50e533757247af83664d875644c812075b6622bdd53397e18c2fb1bb12cc4924319e17c9b9c788d46b6dbb6de1288d034e1399
6
+ metadata.gz: d880cca2f0f153718ec34096d9c4586753b90bf25c78b3b4e72cb07637234aee9afdb318d978585bebeefe86af6478f6dd5c900530b433ebce3aa4c9065d743e
7
+ data.tar.gz: fe3b778aa2fc733953c6b6e43bd5050e6aa2512bc11233df5be747af261e4d55ea55653b8b5f9150491cf9a0320c220d4da156eed3db5e6b00a7168b6ef3b63e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0.rc1
1
+ 1.2.0.rc2
data/kontena-cli.gemspec CHANGED
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_runtime_dependency "semantic", "~> 1.5"
34
34
  spec.add_runtime_dependency "safe_yaml", "~> 1.0"
35
35
  spec.add_runtime_dependency "liquid", "~> 4.0.0"
36
+ spec.add_runtime_dependency "tty-table", "~> 0.8.0"
36
37
  end
@@ -48,6 +48,7 @@ module Kontena::Cli::Cloud
48
48
  reset_cloud_client
49
49
  display_logo
50
50
  display_login_info(only: :account)
51
+ true
51
52
  end
52
53
 
53
54
  def web_flow
@@ -3,8 +3,8 @@ require 'pastel'
3
3
  require 'uri'
4
4
  require 'io/console'
5
5
 
6
- require_relative 'config'
7
- require_relative 'spinner'
6
+ require 'kontena/cli/config'
7
+ require 'kontena/cli/spinner'
8
8
 
9
9
  module Kontena
10
10
  module Cli
@@ -1,5 +1,3 @@
1
- require_relative '../grid_options'
2
-
3
1
  module Kontena::Cli::Containers
4
2
  class ExecCommand < Kontena::Command
5
3
  include Kontena::Cli::Common
@@ -1,5 +1,3 @@
1
- require_relative '../grid_options'
2
-
3
1
  module Kontena::Cli::Containers
4
2
  class ListCommand < Kontena::Command
5
3
  include Kontena::Util
@@ -1,4 +1,3 @@
1
- require_relative '../grid_options'
2
1
  require_relative '../helpers/log_helper'
3
2
 
4
3
  module Kontena::Cli::Containers
@@ -1,4 +1,3 @@
1
- require_relative '../grid_options'
2
1
  require_relative 'services_helper'
3
2
 
4
3
  module Kontena::Cli::Services
@@ -1,4 +1,3 @@
1
- require_relative '../grid_options'
2
1
  require_relative 'services_helper'
3
2
 
4
3
  module Kontena::Cli::Services
@@ -1,3 +1,4 @@
1
+ require 'kontena_cli'
1
2
  module Kontena::Cli
2
3
  class SubcommandLoader
3
4
  attr_reader :path
@@ -1,4 +1,4 @@
1
- require_relative 'version'
1
+ require 'kontena/cli/version'
2
2
 
3
3
  class Kontena::Cli::VersionCommand < Kontena::Command
4
4
  include Kontena::Cli::Common
@@ -9,12 +9,13 @@ module Kontena::Cli::Volumes
9
9
  requires_current_master_token
10
10
 
11
11
  def execute
12
+ require 'tty-table'
13
+
12
14
  volumes = client.get("volumes/#{current_grid}")['volumes']
13
- columns = '%-25.25s %-25.25s %-25.25s %-25.25s'
14
- puts columns % ['NAME', 'SCOPE', 'DRIVER', 'CREATED AT']
15
- volumes.each do |volume|
16
- puts columns % [volume['name'], volume['scope'], volume['driver'], volume['created_at']]
17
- end
15
+ table = TTY::Table.new ['NAME', 'SCOPE', 'DRIVER', 'CREATED AT'], volumes.map { |volume|
16
+ [volume['name'], volume['scope'], volume['driver'], volume['created_at']]
17
+ }
18
+ puts table.render(:basic)
18
19
  end
19
20
 
20
21
  end
@@ -6,12 +6,9 @@ require 'socket'
6
6
  require 'openssl'
7
7
  require 'uri'
8
8
  require 'time'
9
- require_relative 'errors'
10
- require_relative 'cli/version'
11
- begin
12
- require_relative 'cli/config'
13
- rescue LoadError
14
- end
9
+ require 'kontena/errors'
10
+ require 'kontena/cli/version'
11
+ require 'kontena/cli/config'
15
12
 
16
13
  module Kontena
17
14
  class Client
@@ -61,7 +58,7 @@ module Kontena
61
58
  ssl_verify_peer: ignore_ssl_errors? ? false : true
62
59
  }
63
60
  if ENV["DEBUG"]
64
- require_relative 'debug_instrumentor'
61
+ require 'kontena/debug_instrumentor'
65
62
  excon_opts[:instrumentor] = Kontena::DebugInstrumentor
66
63
  end
67
64
 
@@ -1,5 +1,9 @@
1
1
  require 'clamp'
2
- require_relative 'cli/subcommand_loader'
2
+ require 'kontena/cli/subcommand_loader'
3
+ require 'kontena/cli/common'
4
+ require 'kontena/util'
5
+ require 'kontena/cli/bytes_helper'
6
+ require 'kontena/cli/grid_options'
3
7
 
4
8
  class Kontena::Command < Clamp::Command
5
9
 
@@ -225,4 +229,4 @@ class Kontena::Command < Clamp::Command
225
229
  end
226
230
  end
227
231
 
228
- require_relative 'callback'
232
+ require 'kontena/callback'
@@ -1,10 +1,4 @@
1
- require 'clamp'
2
- require_relative 'cli/common'
3
- require_relative 'util'
4
- require_relative 'command'
5
- require_relative 'callback'
6
- require_relative 'cli/bytes_helper'
7
- require_relative 'cli/grid_options'
1
+ require 'kontena/command'
8
2
 
9
3
  class Kontena::MainCommand < Kontena::Command
10
4
  include Kontena::Util
@@ -86,11 +86,26 @@ class Helper
86
86
  []
87
87
  end
88
88
 
89
+ def subcommand_tree(cmd = nil, base = nil)
90
+ puts "#{cmd} ".strip
91
+ if base.has_subcommands?
92
+ base.recognised_subcommands.each do |sc|
93
+ subcommand_tree("#{cmd} #{sc.names.first}", sc.subcommand_class)
94
+ end
95
+ end
96
+ end
89
97
  end
90
98
 
91
99
  helper = Helper.new
92
100
 
93
101
  words = ARGV
102
+
103
+ if words.first == '--subcommand-tree'
104
+ require 'kontena/main_command'
105
+ helper.subcommand_tree("kontena", Kontena::MainCommand)
106
+ exit 0
107
+ end
108
+
94
109
  words.delete_at(0)
95
110
 
96
111
  completion = []
@@ -1,4 +1,4 @@
1
- require_relative 'client'
1
+ require 'kontena/client'
2
2
 
3
3
  module Kontena
4
4
  class StacksClient < Client
data/lib/kontena_cli.rb CHANGED
@@ -108,11 +108,11 @@ require 'ruby_dig'
108
108
  require 'shellwords'
109
109
  require "safe_yaml"
110
110
  SafeYAML::OPTIONS[:default_mode] = :safe
111
- require_relative 'kontena/cli/version'
112
- require_relative 'kontena/cli/common'
113
- require_relative 'kontena/command'
114
- require_relative 'kontena/client'
115
- require_relative 'kontena/stacks_cache'
116
- require_relative 'kontena/plugin_manager'
117
- require_relative 'kontena/main_command'
118
- require_relative 'kontena/cli/spinner'
111
+ require 'kontena/cli/version'
112
+ require 'kontena/cli/common'
113
+ require 'kontena/command'
114
+ require 'kontena/client'
115
+ require 'kontena/stacks_cache'
116
+ require 'kontena/plugin_manager'
117
+ require 'kontena/main_command'
118
+ require 'kontena/cli/spinner'
@@ -1,4 +1,3 @@
1
- require 'kontena/cli/grid_options'
2
1
  require "kontena/cli/apps/deploy_command"
3
2
 
4
3
  describe Kontena::Cli::Apps::DeployCommand do
@@ -1,4 +1,3 @@
1
- require 'kontena/cli/grid_options'
2
1
  require "kontena/cli/apps/logs_command"
3
2
 
4
3
  describe Kontena::Cli::Apps::LogsCommand do
@@ -1,4 +1,3 @@
1
- require 'kontena/cli/grid_options'
2
1
  require "kontena/cli/containers/list_command"
3
2
 
4
3
  describe Kontena::Cli::Containers::ListCommand do
@@ -1,4 +1,3 @@
1
- require 'kontena/cli/grid_options'
2
1
  require "kontena/cli/containers/logs_command"
3
2
 
4
3
  describe Kontena::Cli::Containers::LogsCommand do
@@ -1,4 +1,3 @@
1
- require "kontena/cli/grid_options"
2
1
  require "kontena/cli/services/secrets/link_command"
3
2
 
4
3
  describe Kontena::Cli::Services::Secrets::LinkCommand do
@@ -1,4 +1,3 @@
1
- require "kontena/cli/grid_options"
2
1
  require "kontena/cli/services/secrets/unlink_command"
3
2
 
4
3
  describe Kontena::Cli::Services::Secrets::UnlinkCommand do
@@ -1,4 +1,3 @@
1
- require "kontena/cli/grid_options"
2
1
  require "kontena/cli/services/update_command"
3
2
 
4
3
  describe Kontena::Cli::Services::UpdateCommand do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontena-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.rc1
4
+ version: 1.2.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-07 00:00:00.000000000 Z
11
+ date: 2017-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -192,6 +192,20 @@ dependencies:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
194
  version: 4.0.0
195
+ - !ruby/object:Gem::Dependency
196
+ name: tty-table
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: 0.8.0
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: 0.8.0
195
209
  description: Command-line client for the Kontena container and microservices platform
196
210
  email:
197
211
  - info@kontena.io