kanrisuru 0.16.17 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/kanrisuru/core/mount/commands/umount.rb +1 -1
- data/lib/kanrisuru/core/system/commands/nproc.rb +15 -0
- data/lib/kanrisuru/core/system/commands.rb +1 -0
- data/lib/kanrisuru/version.rb +1 -1
- data/spec/functional/core/system_spec.rb +5 -0
- data/spec/functional/core/transfer_spec.rb +4 -4
- data/spec/support/shared_examples/integration/core/system.rb +6 -0
- data/spec/unit/core/system_spec.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3f695ef2a1f50c24f7e2c8a06a107202c72e36a19b4952a4af9fbe3bdda93d3
|
4
|
+
data.tar.gz: e4ec5a94e1b24ff564fc46d909ddfd93bcb0d3e2baa916137c07740a896d8a6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a02f65e7d962e2e02594bee48b8a8662bf29a936a02e9e938332340d695618bd92a2a3b6fc26c7324ecb0af236d6d6dc11475fd8205ee6cc77d97ff57f39cbdf
|
7
|
+
data.tar.gz: 047b7235f156d77085a413d2af37ce09367d1eb68b33ae0b96b1e2a0ed8f79ba9b8111f3933e02dd37245393fd4c6333455407187fb62ba6ad524dfc42ec1f54
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Kanrisuru
|
4
|
+
module Core
|
5
|
+
module System
|
6
|
+
def nproc(opts = {})
|
7
|
+
command = Kanrisuru::Command.new('nproc')
|
8
|
+
command.append_flag('--all', opts[:all])
|
9
|
+
execute_shell(command)
|
10
|
+
|
11
|
+
Kanrisuru::Result.new(command, &:to_i)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -9,6 +9,7 @@ require_relative 'commands/load_average'
|
|
9
9
|
require_relative 'commands/load_env'
|
10
10
|
require_relative 'commands/lscpu'
|
11
11
|
require_relative 'commands/lsof'
|
12
|
+
require_relative 'commands/nproc'
|
12
13
|
require_relative 'commands/poweroff'
|
13
14
|
require_relative 'commands/ps'
|
14
15
|
require_relative 'commands/reboot'
|
data/lib/kanrisuru/version.rb
CHANGED
@@ -124,6 +124,11 @@ RSpec.describe Kanrisuru::Core::System do
|
|
124
124
|
end.to raise_error(ArgumentError)
|
125
125
|
end
|
126
126
|
|
127
|
+
it 'prepares nproc command' do
|
128
|
+
expect_command(host.nproc, 'nproc')
|
129
|
+
expect_command(host.nproc(all: true), 'nproc --all')
|
130
|
+
end
|
131
|
+
|
127
132
|
it 'prepares uptime command' do
|
128
133
|
expect_command(host.uptime, 'cat /proc/uptime')
|
129
134
|
end
|
@@ -127,7 +127,7 @@ RSpec.describe Kanrisuru::Core::Stat do
|
|
127
127
|
"wget --certificate ~/cert.pem --certificate-type PEM --private-key ~/key.pem --private-key-type PEM --ca-certificate ~/ca.pem --random-file ~/random --https-only #{url}")
|
128
128
|
|
129
129
|
## FTP
|
130
|
-
expect_command(host.wget(
|
130
|
+
expect_command(host.wget('ftp.example.com',
|
131
131
|
ftp_user: 'admin',
|
132
132
|
ftp_password: '12345678',
|
133
133
|
no_remove_listing: true,
|
@@ -135,15 +135,15 @@ RSpec.describe Kanrisuru::Core::Stat do
|
|
135
135
|
no_passive_ftp: true,
|
136
136
|
retr_symlinks: true,
|
137
137
|
preserve_permissions: true),
|
138
|
-
|
138
|
+
'wget --ftp-user admin --ftp-password 12345678 --no-remove-listing --no-glob --no-passive-ftp --retr-symlinks --preserve-permissions ftp.example.com')
|
139
139
|
|
140
|
-
expect_command(host.wget(
|
140
|
+
expect_command(host.wget('ftps.example.com',
|
141
141
|
ftp_user: 'admin',
|
142
142
|
ftp_password: '12345678',
|
143
143
|
ftps_implicit: true,
|
144
144
|
no_ftps_resume_ssl: true,
|
145
145
|
ftps_fallback_to_ftp: true,
|
146
|
-
ftps_clear_data_connection: true),
|
146
|
+
ftps_clear_data_connection: true), 'wget --ftp-user admin --ftp-password 12345678 --ftps-implicit --no-ftps-resume-ssl --ftps-clear-data-connection --ftps-fallback-to-ftp ftps.example.com')
|
147
147
|
|
148
148
|
## Recursive Retrieval
|
149
149
|
expect_command(host.wget(url,
|
@@ -108,6 +108,12 @@ RSpec.shared_examples 'system' do |os_name, host_json, _spec_dir|
|
|
108
108
|
expect(result).to be_success
|
109
109
|
end
|
110
110
|
|
111
|
+
it 'gets nproc count' do
|
112
|
+
result = host.nproc
|
113
|
+
expect(result).to be_success
|
114
|
+
expect(result.to_i).to be > 0
|
115
|
+
end
|
116
|
+
|
111
117
|
it 'gets process details' do
|
112
118
|
result = host.ps
|
113
119
|
|
@@ -30,6 +30,7 @@ RSpec.describe Kanrisuru::Core::System do
|
|
30
30
|
expect(host).to respond_to(:kernel_statistics)
|
31
31
|
expect(host).to respond_to(:kstat)
|
32
32
|
expect(host).to respond_to(:lsof)
|
33
|
+
expect(host).to respond_to(:nproc)
|
33
34
|
expect(host).to respond_to(:last)
|
34
35
|
expect(host).to respond_to(:uptime)
|
35
36
|
expect(host).to respond_to(:w)
|
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.17.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: 2022-01-
|
11
|
+
date: 2022-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel_tests
|
@@ -314,6 +314,7 @@ files:
|
|
314
314
|
- lib/kanrisuru/core/system/commands/load_env.rb
|
315
315
|
- lib/kanrisuru/core/system/commands/lscpu.rb
|
316
316
|
- lib/kanrisuru/core/system/commands/lsof.rb
|
317
|
+
- lib/kanrisuru/core/system/commands/nproc.rb
|
317
318
|
- lib/kanrisuru/core/system/commands/poweroff.rb
|
318
319
|
- lib/kanrisuru/core/system/commands/ps.rb
|
319
320
|
- lib/kanrisuru/core/system/commands/reboot.rb
|
@@ -706,7 +707,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
706
707
|
- !ruby/object:Gem::Version
|
707
708
|
version: '0'
|
708
709
|
requirements: []
|
709
|
-
rubygems_version: 3.
|
710
|
+
rubygems_version: 3.3.5
|
710
711
|
signing_key:
|
711
712
|
specification_version: 4
|
712
713
|
summary: Manage remote servers over ssh with ruby.
|