dockerkit 0.2.7 → 0.2.8

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
  SHA1:
3
- metadata.gz: 3b94964a03ee3803c4dc02662433988442da938c
4
- data.tar.gz: 13601633d71d63f59e34371e9653d5a10faa8817
3
+ metadata.gz: 6dcd2fb82a188ffdf1ed8210c65f47840996f634
4
+ data.tar.gz: 87d043af753bbbe561083cfba8798f12b3437850
5
5
  SHA512:
6
- metadata.gz: ef72736657d6fd207d32b614d9a58329701d5f4d9dbd3878738e0ed8496bf9ecfeb7be18d73d7b68dd7cbd81011db4fbfc71ee1d118ffc8b231f4a2cb0187381
7
- data.tar.gz: 0d48891b7f8d20cf78820f6b9544770488768ab8307509a54c6aeea9d221f486647879492d3b5e8d5a55e1ce1071db4dc7909c126cdf060da1e529fac08fceed
6
+ metadata.gz: dc639a2cdbbaffa71a63ba3e08f43c8a9b68f1949eced4cf9c7ecaf01980c2ba430a2b978e6697a39021523a3e19d1f3ae586e851a1c4f21d335dde0c913c4cd
7
+ data.tar.gz: 68e9b94a77e8976613619a100aab868be2818c2370f1ef91647d9f6b7ea92d849eb47a9db2a9e3fd0e2a0ad050ece1c003a530196e16581d36ff5a892e8d6a98
@@ -50,9 +50,7 @@ module ContainerTasks
50
50
  map rm: :del
51
51
  map rmc: :del
52
52
 
53
-
54
-
55
- desc 'exec [KEYWORD] [-n nk] [-i ik] [--opts] [--cmd] [-s]', <<-LONG
53
+ desc 'exec [KEYWORD] [-n nk] [-i ik] [--opts] [--cmd] [-s]', <<-LONG
56
54
  select container which container_name match the patten and select some to run
57
55
  example:
58
56
  dk exec\
@@ -87,7 +85,6 @@ module ContainerTasks
87
85
 
88
86
  def exec(keyword = nil)
89
87
  ret = Container.find(keyword: keyword, name: options['name'], image: options['image'])
90
-
91
88
  if ret.count > 1
92
89
  Container.print_table(ret) { |item, index| "[#{index + 1}]#{item}" }
93
90
  question = ['please select one container to run:'].unshift(' ').unshift(' ').join("\n")
@@ -98,12 +95,10 @@ module ContainerTasks
98
95
 
99
96
  command = options['cmd'] || ask_with_default('Any command you want to run?', 'echo hello')
100
97
  opts = options['opts'] || ask_with_default('Any option you want to set?', '-it')
101
- index=(answer&.to_i||1)-1
102
- xcommand=ret[index].exec(opts, command)
103
- run(["dk","alias",options['alias'],xcommand].join(" ")) if options['alias']
104
- run(xcommand.join(" "))
98
+ index = (answer ? answer.to_i : 1) - 1
99
+ xcommand = ret[index].exec(opts, command)
100
+ run(['dk', 'alias', options['alias'], xcommand].join(' ')) if options['alias']
101
+ run(xcommand.join(' '))
105
102
  end
106
-
107
-
108
103
  end
109
104
  end
@@ -1,7 +1,7 @@
1
1
  require 'dockerkit/version'
2
2
  require 'thor'
3
3
  require 'colorize'
4
- #require 'pry-byebug'
4
+ # require 'pry-byebug'
5
5
  require 'active_support'
6
6
  require 'active_support/core_ext'
7
7
  require 'yaml'
@@ -1,3 +1,3 @@
1
1
  module Dockerkit
2
- VERSION = '0.2.7'.freeze
2
+ VERSION = '0.2.8'.freeze
3
3
  end
@@ -28,6 +28,7 @@ class Container
28
28
 
29
29
  def self.create(line)
30
30
  id, image_str, command, created, status, ports, name = line.chomp.split(' ' * 2).reject(&:empty?).map(&:strip)
31
+ name, ports = ports, name if name.nil?
31
32
  ret = new(
32
33
  id: id,
33
34
  image_str: image_str,
@@ -60,7 +61,7 @@ class Container
60
61
  [
61
62
  'docker exec',
62
63
  exec_opts,
63
- name,
64
+ id,
64
65
  command
65
66
  ]
66
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - shaoyang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-04 00:00:00.000000000 Z
11
+ date: 2017-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler