docker-cli 0.2.0 → 0.3.0

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
  SHA256:
3
- metadata.gz: c3b534e3b0aa4cba19d8cce7c543f9af128e3186e3315cd2fc9efd4c44610e7e
4
- data.tar.gz: 00ac6d7b9919d13b08d1dbf9fd460491abb35810f57bd032d1e18c41f1ab0b9e
3
+ metadata.gz: a7205a4fd4da05244963a59b557b73f7390c33e6eccf7d8ceb151212aa55d341
4
+ data.tar.gz: 2dc373bbff72ffe31ad1f6e06b93acb5c89895d2f73cc72512b840ac6011f04a
5
5
  SHA512:
6
- metadata.gz: 5f33fcfe8272f889b4d7c79921b562d969e0318ac76b0660085026ff09a784eabfa1b8cdff5929cffaa2bb771906ad8ca74d9d2996ffb9077bd0433563108249
7
- data.tar.gz: 6342a7d84dc8bd713eac66c09823b41395adb9e1a4e82bad1c5f14c54f5c51762c77d0653c2a1bee9539dd526a6847b3d98613afc137188d99896cd31420f40b
6
+ metadata.gz: fdfe1f3ef79d0fc43cf62edde5ed4a25005b6f4c3a55d8c4386162699a23334b513d8c31f4b6ca94fa06f915a0c620e0f0d871026ef27be30fce4f1b5036ca80
7
+ data.tar.gz: ffc7eb6b0865efa24cf32cecfb7ae5804c691982d7e35ad63749ff7e13b07e9f5b391e8893d7da17eac0df2e3019dea952595a64bc33138f8cc8ab9e7e07597e
data/.release_history.yml CHANGED
@@ -4,3 +4,7 @@ docker-cli:
4
4
  :timestamp: 1670315972.6015687
5
5
  - :version: 0.1.1
6
6
  :timestamp: 1670648500.3751137
7
+ - :version: 0.2.0
8
+ :timestamp: 1679547303.774784
9
+ - :version: 0.2.1
10
+ :timestamp: 1679551516.275535
data/Gemfile CHANGED
@@ -9,9 +9,9 @@ gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
11
11
 
12
- gem 'toolrack', git: 'toolrack', branch: 'master'
13
-
14
- gem 'git_cli', git: "git_cli", branch: "master"
15
- gem 'git_cli_prompt', git: "git_cli_prompt", branch: 'master'
16
- gem 'devops_assist', git: "devops_assist", branch: "master"
12
+ #gem 'toolrack', git: 'toolrack', branch: 'master'
13
+ #
14
+ #gem 'git_cli', git: "git_cli", branch: "master"
15
+ #gem 'git_cli_prompt', git: "git_cli_prompt", branch: 'master'
16
+ #gem 'devops_assist', git: "devops_assist", branch: "master"
17
17
 
data/Gemfile.lock CHANGED
@@ -1,59 +1,33 @@
1
- GIT
2
- remote: devops_assist
3
- revision: 7d0ed10bc1964532be810c347447ec9ee4a61fca
4
- branch: master
1
+ PATH
2
+ remote: .
5
3
  specs:
6
- devops_assist (0.3.3)
7
- git_cli
8
- git_cli_prompt
9
- gvcs
4
+ docker-cli (0.3.0)
5
+ ptools
10
6
  teLogger
11
7
  toolrack
8
+ tty-command
12
9
  tty-prompt
13
10
 
14
- GIT
15
- remote: git_cli
16
- revision: 05d83d28f37f4023920b6bf91d975b818d0f13fe
17
- branch: master
11
+ GEM
12
+ remote: https://rubygems.org/
18
13
  specs:
14
+ devops_assist (0.3.11)
15
+ git_cli
16
+ git_cli_prompt (~> 0.3.3)
17
+ gvcs
18
+ teLogger
19
+ toolrack
20
+ tty-prompt
21
+ diff-lcs (1.5.0)
19
22
  git_cli (0.11.2)
20
23
  gvcs
21
24
  ptools (~> 1.4.0)
22
25
  teLogger
23
26
  toolrack
24
-
25
- GIT
26
- remote: git_cli_prompt
27
- revision: b9734eab851922936515f717093b1e2429a24d8a
28
- branch: master
29
- specs:
30
- git_cli_prompt (0.3.1)
27
+ git_cli_prompt (0.3.4)
31
28
  teLogger
32
29
  toolrack
33
30
  tty-prompt
34
-
35
- PATH
36
- remote: .
37
- specs:
38
- docker-cli (0.2.0)
39
- ptools
40
- teLogger
41
- tty-command
42
- tty-prompt
43
-
44
- GIT
45
- remote: toolrack
46
- revision: be0bda340f7f6047e5ceace77b5d0a928bbcdecf
47
- branch: master
48
- specs:
49
- toolrack (0.20.1)
50
- base58
51
-
52
- GEM
53
- remote: https://rubygems.org/
54
- specs:
55
- base58 (0.2.3)
56
- diff-lcs (1.5.0)
57
31
  gvcs (0.1.1)
58
32
  pastel (0.8.0)
59
33
  tty-color (~> 0.5)
@@ -68,11 +42,12 @@ GEM
68
42
  rspec-expectations (3.12.2)
69
43
  diff-lcs (>= 1.2.0, < 2.0)
70
44
  rspec-support (~> 3.12.0)
71
- rspec-mocks (3.12.4)
45
+ rspec-mocks (3.12.5)
72
46
  diff-lcs (>= 1.2.0, < 2.0)
73
47
  rspec-support (~> 3.12.0)
74
48
  rspec-support (3.12.0)
75
49
  teLogger (0.2.2)
50
+ toolrack (0.21.0)
76
51
  tty-color (0.6.0)
77
52
  tty-command (0.10.1)
78
53
  pastel (~> 0.8)
@@ -88,16 +63,14 @@ GEM
88
63
  wisper (2.0.1)
89
64
 
90
65
  PLATFORMS
91
- x86_64-darwin-21
66
+ ruby
67
+ x86_64-linux
92
68
 
93
69
  DEPENDENCIES
94
- devops_assist!
70
+ devops_assist
95
71
  docker-cli!
96
- git_cli!
97
- git_cli_prompt!
98
72
  rake (~> 13.0)
99
73
  rspec (~> 3.0)
100
- toolrack!
101
74
 
102
75
  BUNDLED WITH
103
- 2.4.6
76
+ 2.2.28
data/docker-cli.gemspec CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- #spec.add_dependency 'toolrack'
33
+ spec.add_dependency 'toolrack'
34
34
  spec.add_dependency 'teLogger'
35
35
 
36
36
  spec.add_dependency 'ptools'
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_dependency 'tty-command'
39
39
  spec.add_dependency 'tty-prompt'
40
40
 
41
- #spec.add_development_dependency 'devops_assist'
41
+ spec.add_development_dependency 'devops_assist'
42
42
 
43
43
  # Uncomment to register a new dependency of your gem
44
44
  # spec.add_dependency "example-gem", "~> 1.0"
@@ -44,8 +44,8 @@ module Docker
44
44
  when "gnome-terminal"
45
45
  `#{terminal} -- bash -c "#{@command_buffer.join(" ")}; exec bash"`
46
46
  when "iTerm2"
47
- `osascript <<EOL
48
- tell application "iTerm"
47
+ `osascript -e \
48
+ 'tell application "iTerm"
49
49
  activate
50
50
 
51
51
  create window with default profile
@@ -57,8 +57,7 @@ module Docker
57
57
  write text "#{@command_buffer.join(" ")}"
58
58
  end tell
59
59
 
60
- end tell
61
- EOL
60
+ end tell'
62
61
  `
63
62
  when "Terminal"
64
63
  `osascript -e \
@@ -70,12 +69,14 @@ module Docker
70
69
  else
71
70
  raise Error, "Unfinished supporting terminal : #{terminal}"
72
71
  end
72
+
73
+ pmt.puts "\n Prompt running inside the Docker shall be opened in a new window\n\n"
73
74
  end
74
75
 
75
76
  else
76
77
  @outStream = []
77
78
  @errStream = []
78
- @result = @runner.run!(@command_buffer.join(" ")) do |out, err|
79
+ result = @runner.run!(@command_buffer.join(" ")) do |out, err|
79
80
  if block
80
81
  block.call(:outstream, out)
81
82
  block.call(:errstream, err)
@@ -85,7 +86,7 @@ module Docker
85
86
  end
86
87
  end
87
88
 
88
- CommandResult.new(@result, @outStream, @errStream)
89
+ CommandResult.new(result, @outStream, @errStream)
89
90
  #{ outStream: @outStream, errStream: @errStream, result: @result }
90
91
  end
91
92
  end
@@ -98,7 +99,7 @@ module Docker
98
99
  def detect_terminal
99
100
  avail = []
100
101
  if TR::RTUtils.on_linux?
101
- possible = [ "gnome-terminal","konsole","cmd.exe", "tilix", "terminator" ]
102
+ possible = [ "gnome-terminal","konsole","tilix", "terminator" ]
102
103
  possible.each do |app|
103
104
  avail << app if not File.which(app).nil?
104
105
  end
@@ -93,9 +93,14 @@ module Docker
93
93
  cmd = []
94
94
  cmd << Cli.docker_exe
95
95
  cmd << "ps"
96
+ # return all info instead of only the container ID
97
+ #cmd << "-a"
96
98
  cmd << "-aq"
97
99
  cmd << "-f"
98
- cmd << "name=#{name}"
100
+ # From little testing seems the command by default already support regex formatting
101
+ # So can use the regex marker to get exact match
102
+ # e.g. if want exact match, pass in ^#{name}\z
103
+ cmd << "name=\"#{name}\""
99
104
 
100
105
  logger.debug "Find from all container: #{cmd.join(" ")}"
101
106
  Command.new(cmd)
@@ -255,6 +260,10 @@ module Docker
255
260
  @logger
256
261
  end
257
262
 
263
+ def parse_container_list(out, &block)
264
+
265
+ end
266
+
258
267
  end
259
268
  end
260
269
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Docker
4
4
  module Cli
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-23 00:00:00.000000000 Z
11
+ date: 2023-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: toolrack
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: teLogger
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: devops_assist
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  description: ''
70
98
  email:
71
99
  - cameronian0@protonmail.com
@@ -92,7 +120,7 @@ files:
92
120
  homepage: ''
93
121
  licenses: []
94
122
  metadata: {}
95
- post_install_message:
123
+ post_install_message:
96
124
  rdoc_options: []
97
125
  require_paths:
98
126
  - lib
@@ -107,8 +135,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
135
  - !ruby/object:Gem::Version
108
136
  version: '0'
109
137
  requirements: []
110
- rubygems_version: 3.4.6
111
- signing_key:
138
+ rubygems_version: 3.4.10
139
+ signing_key:
112
140
  specification_version: 4
113
141
  summary: ''
114
142
  test_files: []