kanrisuru 0.3.2 → 0.4.0
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 +4 -4
- data/lib/kanrisuru/command.rb +8 -3
- data/lib/kanrisuru/core/path.rb +0 -1
- data/lib/kanrisuru/remote/cpu.rb +4 -0
- data/lib/kanrisuru/remote/host.rb +2 -2
- data/lib/kanrisuru/util/os_family.rb +1 -1
- data/lib/kanrisuru/version.rb +1 -1
- data/spec/functional/remote/os_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d0fc79a97a3eebddc661982ea4a728af94aded3dbcf5bd5d7d8b0c03e9f5aaf
|
4
|
+
data.tar.gz: a37a3d8a00941a4842f3ce0502a1e88fe9ff50343c095f55094dc528f4bddfa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34521c6c7ed22da194e55037a4c9653717176e1b6526e79c272107fe57c711e5ffbd8a377c48df8008492910297bbe102d21713c41e5c33635264f32c3c5c231
|
7
|
+
data.tar.gz: f620bb3a94944cee7c08f0634d43c7b00a4bf00e9c3b64ac13a0934cf8afe01af3439b67dd2d563cecb5134084b2eb9b8845835e22959d00a3639251ffb15f1e
|
data/lib/kanrisuru/command.rb
CHANGED
@@ -6,12 +6,13 @@ module Kanrisuru
|
|
6
6
|
attr_writer :remote_user, :remote_shell, :remote_path, :remote_env
|
7
7
|
|
8
8
|
def initialize(command)
|
9
|
+
@valid_exit_codes = [0]
|
9
10
|
@raw_command = command
|
10
11
|
@raw_result = []
|
11
12
|
end
|
12
13
|
|
13
14
|
def success?
|
14
|
-
@exit_status
|
15
|
+
@valid_exit_codes.include?(@exit_status)
|
15
16
|
end
|
16
17
|
|
17
18
|
def failure?
|
@@ -45,8 +46,7 @@ module Kanrisuru
|
|
45
46
|
end
|
46
47
|
|
47
48
|
env = @remote_env && !@remote_env.empty? ? "#{@remote_env} " : ''
|
48
|
-
|
49
|
-
"#{env}sudo -u #{@remote_user} #{@remote_shell} -c -l \"#{evaluate}\""
|
49
|
+
"#{env}sudo -u #{@remote_user} #{@remote_shell} -c \"#{evaluate}\""
|
50
50
|
else
|
51
51
|
@raw_command
|
52
52
|
end
|
@@ -95,5 +95,10 @@ module Kanrisuru
|
|
95
95
|
def append_flag(arg, boolean = 'true')
|
96
96
|
@raw_command = Kanrisuru::Util.present?(boolean) ? "#{@raw_command} #{arg}" : @raw_command
|
97
97
|
end
|
98
|
+
|
99
|
+
def append_valid_exit_code(code)
|
100
|
+
@valid_exit_codes << code if code.instance_of?(Integer)
|
101
|
+
@valid_exit_codes.concat(code) if code.instance_of?(Array)
|
102
|
+
end
|
98
103
|
end
|
99
104
|
end
|
data/lib/kanrisuru/core/path.rb
CHANGED
data/lib/kanrisuru/remote/cpu.rb
CHANGED
@@ -16,7 +16,7 @@ module Kanrisuru
|
|
16
16
|
@username = opts[:username]
|
17
17
|
@login_user = @username
|
18
18
|
|
19
|
-
@port = opts[:port]
|
19
|
+
@port = opts[:port] || 22
|
20
20
|
@password = opts[:password] if opts[:password]
|
21
21
|
@keys = opts[:keys] if opts[:keys]
|
22
22
|
@shell = opts[:shell] || '/bin/bash'
|
@@ -84,7 +84,7 @@ module Kanrisuru
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def ssh
|
87
|
-
@ssh ||= Net::SSH.start(@host, @username, keys: @keys, password: @password)
|
87
|
+
@ssh ||= Net::SSH.start(@host, @username, keys: @keys, password: @password, port: @port)
|
88
88
|
end
|
89
89
|
|
90
90
|
def ping?
|
data/lib/kanrisuru/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kanrisuru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Mammina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|