docker-cli 0.1.1 → 0.2.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: 772cf53882bfb45cf43be6d235ecca8ed718bbc8967cb9552b52fcdcc39ec4b7
4
- data.tar.gz: 6ab201e6b5b70d5d3b07e0b06d9b007139c98b4a65c0a31b5cd8f47f1f774c8d
3
+ metadata.gz: c3b534e3b0aa4cba19d8cce7c543f9af128e3186e3315cd2fc9efd4c44610e7e
4
+ data.tar.gz: 00ac6d7b9919d13b08d1dbf9fd460491abb35810f57bd032d1e18c41f1ab0b9e
5
5
  SHA512:
6
- metadata.gz: 3287974fed58b9d9ddc311f3ace54cc28ceb427ad9a9049efc8936374afec8866bbd393d1e61590c5ad7930873c0885e73042fd8f9d63f5ee122624f9fc293a4
7
- data.tar.gz: e7a40193271218b1bf5100acd1a1c606d30c5d327163f74c97aed420b7f82061b91b6af00ab669efeb723a6c766ee2463b1fd0156ca44d76d5509c1815f092d9
6
+ metadata.gz: 5f33fcfe8272f889b4d7c79921b562d969e0318ac76b0660085026ff09a784eabfa1b8cdff5929cffaa2bb771906ad8ca74d9d2996ffb9077bd0433563108249
7
+ data.tar.gz: 6342a7d84dc8bd713eac66c09823b41395adb9e1a4e82bad1c5f14c54f5c51762c77d0653c2a1bee9539dd526a6847b3d98613afc137188d99896cd31420f40b
data/.release_history.yml CHANGED
@@ -2,3 +2,5 @@
2
2
  docker-cli:
3
3
  - :version: 0.1.0
4
4
  :timestamp: 1670315972.6015687
5
+ - :version: 0.1.1
6
+ :timestamp: 1670648500.3751137
data/Gemfile CHANGED
@@ -8,3 +8,10 @@ gemspec
8
8
  gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rspec", "~> 3.0"
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"
17
+
data/Gemfile.lock CHANGED
@@ -1,35 +1,60 @@
1
- PATH
2
- remote: .
3
- specs:
4
- docker-cli (0.1.0)
5
- ptools
6
- teLogger
7
- toolrack
8
- tty-command
9
- tty-prompt
10
-
11
- GEM
12
- remote: https://rubygems.org/
1
+ GIT
2
+ remote: devops_assist
3
+ revision: 7d0ed10bc1964532be810c347447ec9ee4a61fca
4
+ branch: master
13
5
  specs:
14
- base58 (0.2.3)
15
- devops_assist (0.3.1)
6
+ devops_assist (0.3.3)
16
7
  git_cli
17
8
  git_cli_prompt
18
9
  gvcs
19
10
  teLogger
20
11
  toolrack
21
12
  tty-prompt
22
- diff-lcs (1.5.0)
23
- git_cli (0.10.0)
13
+
14
+ GIT
15
+ remote: git_cli
16
+ revision: 05d83d28f37f4023920b6bf91d975b818d0f13fe
17
+ branch: master
18
+ specs:
19
+ git_cli (0.11.2)
24
20
  gvcs
25
21
  ptools (~> 1.4.0)
26
22
  teLogger
27
23
  toolrack
24
+
25
+ GIT
26
+ remote: git_cli_prompt
27
+ revision: b9734eab851922936515f717093b1e2429a24d8a
28
+ branch: master
29
+ specs:
28
30
  git_cli_prompt (0.3.1)
29
31
  teLogger
30
32
  toolrack
31
33
  tty-prompt
32
- gvcs (0.1.0)
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
+ gvcs (0.1.1)
33
58
  pastel (0.8.0)
34
59
  tty-color (~> 0.5)
35
60
  ptools (1.4.3)
@@ -38,18 +63,16 @@ GEM
38
63
  rspec-core (~> 3.12.0)
39
64
  rspec-expectations (~> 3.12.0)
40
65
  rspec-mocks (~> 3.12.0)
41
- rspec-core (3.12.0)
66
+ rspec-core (3.12.1)
42
67
  rspec-support (~> 3.12.0)
43
- rspec-expectations (3.12.0)
68
+ rspec-expectations (3.12.2)
44
69
  diff-lcs (>= 1.2.0, < 2.0)
45
70
  rspec-support (~> 3.12.0)
46
- rspec-mocks (3.12.0)
71
+ rspec-mocks (3.12.4)
47
72
  diff-lcs (>= 1.2.0, < 2.0)
48
73
  rspec-support (~> 3.12.0)
49
74
  rspec-support (3.12.0)
50
- teLogger (0.2.0)
51
- toolrack (0.19.1)
52
- base58
75
+ teLogger (0.2.2)
53
76
  tty-color (0.6.0)
54
77
  tty-command (0.10.1)
55
78
  pastel (~> 0.8)
@@ -65,13 +88,16 @@ GEM
65
88
  wisper (2.0.1)
66
89
 
67
90
  PLATFORMS
68
- x86_64-linux
91
+ x86_64-darwin-21
69
92
 
70
93
  DEPENDENCIES
71
- devops_assist
94
+ devops_assist!
72
95
  docker-cli!
96
+ git_cli!
97
+ git_cli_prompt!
73
98
  rake (~> 13.0)
74
99
  rspec (~> 3.0)
100
+ toolrack!
75
101
 
76
102
  BUNDLED WITH
77
- 2.2.28
103
+ 2.4.6
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"
@@ -3,6 +3,8 @@ require 'tty/command'
3
3
  require 'tty/prompt'
4
4
  require 'ptools'
5
5
 
6
+ require 'toolrack'
7
+
6
8
  require_relative 'command_result'
7
9
 
8
10
  module Docker
@@ -41,6 +43,30 @@ module Docker
41
43
  `#{terminal} -x "#{@command_buffer.join(" ")}"`
42
44
  when "gnome-terminal"
43
45
  `#{terminal} -- bash -c "#{@command_buffer.join(" ")}; exec bash"`
46
+ when "iTerm2"
47
+ `osascript <<EOL
48
+ tell application "iTerm"
49
+ activate
50
+
51
+ create window with default profile
52
+ delay 0.5
53
+
54
+ set currentWindow to current window
55
+
56
+ tell current session of currentWindow
57
+ write text "#{@command_buffer.join(" ")}"
58
+ end tell
59
+
60
+ end tell
61
+ EOL
62
+ `
63
+ when "Terminal"
64
+ `osascript -e \
65
+ 'tell application "Terminal"
66
+ activate
67
+ do script "#{@command_buffer.join(" ")}"
68
+ end tell'
69
+ `
44
70
  else
45
71
  raise Error, "Unfinished supporting terminal : #{terminal}"
46
72
  end
@@ -70,10 +96,17 @@ module Docker
70
96
 
71
97
  private
72
98
  def detect_terminal
73
- possible = [ "gnome-terminal","konsole","cmd.exe", "tilix", "terminator" ]
74
99
  avail = []
75
- possible.each do |app|
76
- avail << app if not File.which(app).nil?
100
+ if TR::RTUtils.on_linux?
101
+ possible = [ "gnome-terminal","konsole","cmd.exe", "tilix", "terminator" ]
102
+ possible.each do |app|
103
+ avail << app if not File.which(app).nil?
104
+ end
105
+ elsif TR::RTUtils.on_windows?
106
+ avail << "cmd.exe"
107
+ elsif TR::RTUtils.on_mac?
108
+ avail << "Terminal"
109
+ avail << "iTerm2"
77
110
  end
78
111
  avail
79
112
  end
@@ -192,15 +192,13 @@ module Docker
192
192
 
193
193
  isTty = false
194
194
  isInteractive = false
195
- if is_empty?(opts[:command])
196
- if not_empty?(opts[:tty]) and opts[:tty] == true
197
- cmd << "-t"
198
- isTty = true
199
- end
200
- if not_empty?(opts[:interactive]) and opts[:interactive] == true
201
- cmd << "-i"
202
- isInteractive = true
203
- end
195
+ if not_empty?(opts[:tty]) and opts[:tty] == true
196
+ cmd << "-t"
197
+ isTty = true
198
+ end
199
+ if not_empty?(opts[:interactive]) and opts[:interactive] == true
200
+ cmd << "-i"
201
+ isInteractive = true
204
202
  end
205
203
 
206
204
  cmd << container
@@ -1,4 +1,5 @@
1
1
 
2
+ require 'toolrack'
2
3
 
3
4
  module Docker
4
5
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Docker
4
4
  module Cli
5
- VERSION = "0.1.1"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
data/ruby-iterm2.sh ADDED
@@ -0,0 +1,46 @@
1
+ #!/bin/sh
2
+ PATH_AND_FILE=$1
3
+
4
+ THE_PATH="${PATH_AND_FILE%/*}"
5
+ FILENAME="${PATH_AND_FILE##*/}"
6
+ echo "Script called"
7
+ echo "PATH_AND_FILE=$PATH_AND_FILE"
8
+ echo "THE_PATH=$THE_PATH"
9
+ echo "FILENAME=$FILENAME"
10
+
11
+ osascript <<EOF
12
+
13
+ tell application "iTerm"
14
+ activate
15
+
16
+ # Check to see if we have an open window. If not, open one.
17
+ if (count windows) is 0 then # no window is open.
18
+ create window with default profile
19
+ delay 0.5
20
+ end if
21
+
22
+ set currentWindow to current window # get a reference to current window
23
+
24
+ # We have an open window.
25
+ tell current session of currentWindow
26
+ if (is processing) or (name is not "bash") then # the current session is busy
27
+ tell currentWindow
28
+ create tab with default profile #- create a new tab
29
+ delay 0.5
30
+ end tell
31
+ end if
32
+ end tell
33
+
34
+ tell current session of currentWindow
35
+ # make sure we're in the right directory
36
+ write text "cd '$THE_PATH'"
37
+ delay 0.5
38
+
39
+ # run the script
40
+ set script_string to "$2" & " " & quoted form of "$FILENAME"
41
+ write text script_string
42
+
43
+ end tell
44
+
45
+ end tell
46
+ EOF
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.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: 2022-12-10 00:00:00.000000000 Z
11
+ date: 2023-03-23 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'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: teLogger
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -80,20 +66,6 @@ dependencies:
80
66
  - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  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'
97
69
  description: ''
98
70
  email:
99
71
  - cameronian0@protonmail.com
@@ -116,10 +88,11 @@ files:
116
88
  - lib/docker/cli/command_factory.rb
117
89
  - lib/docker/cli/command_result.rb
118
90
  - lib/docker/cli/version.rb
91
+ - ruby-iterm2.sh
119
92
  homepage: ''
120
93
  licenses: []
121
94
  metadata: {}
122
- post_install_message:
95
+ post_install_message:
123
96
  rdoc_options: []
124
97
  require_paths:
125
98
  - lib
@@ -134,8 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
107
  - !ruby/object:Gem::Version
135
108
  version: '0'
136
109
  requirements: []
137
- rubygems_version: 3.2.22
138
- signing_key:
110
+ rubygems_version: 3.4.6
111
+ signing_key:
139
112
  specification_version: 4
140
113
  summary: ''
141
114
  test_files: []