kontena-cli 1.0.3 → 1.0.4.rc1

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: 4a023e5663fee3664b1e85010553d4a9f6e935d6
4
- data.tar.gz: 2e62cfdaeab324bbce459111bcae53ff0ff64e25
3
+ metadata.gz: b86823a1df59b3b13acd56ca1ae891470c35f384
4
+ data.tar.gz: 5956eec0f4476e8a5ddace99870c92a9048bea94
5
5
  SHA512:
6
- metadata.gz: 22558ffc001211eb65633390214dce5d461233e5a4421682db1caaff25b614cd14c6fddad67a17524645573b67abf11a6aeea0a8090ee837470939088dbb1ec6
7
- data.tar.gz: d8a3771b05e6308aad6077a655f4265f42b673131980f95723484ebe35e084a16fe66a54d7c56bd3ee1931a7fe267a659b8afab454a0bfd77db8c21302a2d237
6
+ metadata.gz: c36b9050225ce8fe7be616fc749d46bacd082c0ff936339b5acd3e3241e4d60aa96cbc7dd79899007e0254ab13e3144fe04248cc0bac10589402a3cceb47700a
7
+ data.tar.gz: a63c7e9cd42fb42931aaddf1f10bdb18c38acf4a148d15ee0d3473ecdb47514a49f3456b3ac2f4ec3ab31722262034632bbe02c5c66150f3d13920b870527057
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4.rc1
@@ -11,6 +11,7 @@ module Kontena::Cli::Plugins
11
11
  option '--pre', :flag, 'Allow pre-release of a plugin to be installed', default: false
12
12
 
13
13
  def execute
14
+ require 'shellwords'
14
15
  install_plugin(name)
15
16
  end
16
17
 
@@ -20,16 +21,13 @@ module Kontena::Cli::Plugins
20
21
  install_options = ['--no-ri', '--no-doc']
21
22
  install_options << "--version #{version}" if version
22
23
  install_options << "--pre" if pre?
23
- install_command = "#{gem_bin} install #{install_options.join(' ')} #{plugin}"
24
- success = false
24
+ install_options << plugin
25
+ install_command = "#{gem_bin} install #{install_options.shelljoin}"
26
+ ENV["DEBUG"] && STDERR.puts("Running #{install_command}")
25
27
  spinner "Installing plugin #{name.colorize(:cyan)}" do
26
28
  stdout, stderr, status = Open3.capture3(install_command)
27
- unless stderr.empty?
28
- raise stderr
29
- end
29
+ raise(RuntimeError, stderr) unless status.success?
30
30
  end
31
- rescue => exc
32
- puts exc.message
33
31
  end
34
32
 
35
33
  def plugin_exists?(name)
@@ -41,13 +39,10 @@ module Kontena::Cli::Plugins
41
39
  end
42
40
 
43
41
  def uninstall_previous(name)
44
- uninstall_command = "#{gem_bin} uninstall -q #{name}"
45
- success = false
42
+ uninstall_command = "#{gem_bin} uninstall -q #{name.shellescape}"
46
43
  spinner "Uninstalling previous version of plugin" do
47
44
  stdout, stderr, status = Open3.capture3(uninstall_command)
48
- unless stderr.empty?
49
- raise stderr
50
- end
45
+ raise(RuntimeError, stderr) unless status.success?
51
46
  end
52
47
  end
53
48
  end
@@ -9,6 +9,7 @@ module Kontena::Cli::Plugins
9
9
  option "--force", :flag, "Force remove", default: false, attribute_name: :forced
10
10
 
11
11
  def execute
12
+ require 'shellwords'
12
13
  confirm unless forced?
13
14
  uninstall_plugin(name)
14
15
  end
@@ -16,16 +17,11 @@ module Kontena::Cli::Plugins
16
17
  def uninstall_plugin(name)
17
18
  plugin = "kontena-plugin-#{name}"
18
19
  gem_bin = which('gem')
19
- uninstall_command = "#{gem_bin} uninstall -q #{plugin}"
20
- success = false
21
- spinner "Uninstalling plugin #{name.colorize(:cyan)}" do
20
+ uninstall_command = "#{gem_bin} uninstall -q #{plugin.shellescape}"
21
+ stderr = spinner "Uninstalling plugin #{name.colorize(:cyan)}" do |spin|
22
22
  stdout, stderr, status = Open3.capture3(uninstall_command)
23
- unless stderr.empty?
24
- raise stderr
25
- end
23
+ raise(RuntimeError, stderr) unless status.success?
26
24
  end
27
- rescue => exc
28
- puts exc.message
29
25
  end
30
26
  end
31
27
  end
@@ -17,6 +17,7 @@ module Kontena::Cli::Services
17
17
  client(token).delete("services/#{parse_service_id(name)}")
18
18
  removed = false
19
19
  until removed == true
20
+ sleep 1
20
21
  begin
21
22
  client(token).get("services/#{parse_service_id(name)}")
22
23
  rescue Kontena::Errors::StandardError => exc
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.0.3
4
+ version: 1.0.4.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-21 00:00:00.000000000 Z
11
+ date: 2017-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -560,9 +560,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
560
560
  version: 2.0.0
561
561
  required_rubygems_version: !ruby/object:Gem::Requirement
562
562
  requirements:
563
- - - ">="
563
+ - - ">"
564
564
  - !ruby/object:Gem::Version
565
- version: '0'
565
+ version: 1.3.1
566
566
  requirements: []
567
567
  rubyforge_project:
568
568
  rubygems_version: 2.5.1