kanrisuru 0.11.0 → 0.11.1
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/CHANGELOG.md +9 -6
- data/README.md +6 -3
- data/lib/kanrisuru/core/archive.rb +1 -1
- data/lib/kanrisuru/core/dmi.rb +1 -1
- data/lib/kanrisuru/core/file.rb +2 -2
- data/lib/kanrisuru/core/stream.rb +1 -1
- data/lib/kanrisuru/core/zypper.rb +3 -3
- data/lib/kanrisuru/version.rb +1 -1
- data/spec/functional/remote/cpu_spec.rb +1 -1
- data/spec/helper/stub_network.rb +20 -20
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb936ab5bcccbaa1d4f4b3d97b7bd810aba4e0a1915027e87d5e62fdb1bc8fbb
|
4
|
+
data.tar.gz: 5ea1754c5c23dbc4c1d3af3ee922e840b60ac4938573528e66773405d183f60d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2af6ba4a5774c8f78fe051aaa0cb57ddcb4914d3c633e5b47febfa84d9291ae421f317d800faca714c8442574d77150e6a2b5d3c4dfc308a93dc538e666a83c5
|
7
|
+
data.tar.gz: 3b8316665eba3a34c3f961c890df1be79f1cb3772a7dbd1838cda6dfe1b2b5db983476122ef8e0f1f3262fba5e8d0580821006f8f39181112a3b03f0fe0ad7b5
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
+
## Kanrisuru 0.11.1 (December 04, 2021) ##
|
2
|
+
* Cleanup self-assignment branches
|
3
|
+
* Fix linting issues.
|
4
|
+
|
1
5
|
## Kanrisuru 0.11.0 (December 04, 2021) ##
|
2
6
|
* Add codequality badge, cleanup code linting issues.
|
3
7
|
* Fix `fstab` issue with blkid device return type.
|
4
|
-
* Fix `find` spec with sudo permissions.
|
8
|
+
* Fix `find` spec with sudo permissions.
|
5
9
|
* Change `stub_network` result override to use `block.call` with a conditional check for indvidual command stubs.
|
6
10
|
* Add `architecture` method to `cpu`.
|
7
11
|
* Add functional test cases for `cpu` class.
|
8
|
-
* Add more unit test cases.
|
12
|
+
* Add more unit test cases.
|
9
13
|
|
10
14
|
## Kanrisuru 0.10.0 (December 03, 2021) ##
|
11
15
|
* Add `stub_command` and `unstub_command` to mock indvidual command results from a remote server.
|
@@ -199,10 +203,9 @@ cache key to avoid any namespace collisions with the same method name, namely:
|
|
199
203
|
* Force "-" to "\_" from `os-release` release name in `host.os` module.
|
200
204
|
|
201
205
|
## Kanrisuru 0.2.5 (July 16, 2021) ##
|
202
|
-
* Update gem depedencies to non-zero values
|
203
|
-
* Change summary and description fields for `apt
|
204
|
-
* Move `normalize_size` from `apt` core module, to
|
205
|
-
`Kanrisuru::Util::Bits` class.
|
206
|
+
* Update gem depedencies to non-zero values.
|
207
|
+
* Change summary and description fields for `apt`.
|
208
|
+
* Move `normalize_size` from `apt` core module, to `Kanrisuru::Util::Bits` class.
|
206
209
|
* Add additional test cases for `apt` core module.
|
207
210
|
* Add `-hi` to `who` command to explicility print out ip address for user.
|
208
211
|
* Update `inode?` command to execute without shell user.
|
data/README.md
CHANGED
@@ -28,14 +28,17 @@ gem 'kanrisuru'
|
|
28
28
|
|
29
29
|
And then execute:
|
30
30
|
|
31
|
-
|
31
|
+
```bash
|
32
|
+
$ bundle install
|
33
|
+
```
|
32
34
|
|
33
35
|
Or install it yourself as:
|
34
36
|
|
35
|
-
|
37
|
+
```bash
|
38
|
+
$ gem install kanrisuru
|
39
|
+
```
|
36
40
|
|
37
41
|
## Usage
|
38
|
-
|
39
42
|
Run basic commands you would have access to while running on a remote host or on a cluster of hosts.
|
40
43
|
|
41
44
|
### Host
|
@@ -59,7 +59,7 @@ module Kanrisuru
|
|
59
59
|
command.append_flag('--recursive-unlink', opts[:recursive_unlink])
|
60
60
|
|
61
61
|
if Kanrisuru::Util.present?(paths)
|
62
|
-
paths = paths.instance_of?(String)
|
62
|
+
paths = [paths] if paths.instance_of?(String)
|
63
63
|
command << paths.join(' ')
|
64
64
|
end
|
65
65
|
|
data/lib/kanrisuru/core/dmi.rb
CHANGED
@@ -511,7 +511,7 @@ module Kanrisuru
|
|
511
511
|
return unless Kanrisuru::Util.present?(opts[:types])
|
512
512
|
|
513
513
|
types = opts[:types]
|
514
|
-
types = types.instance_of?(
|
514
|
+
types = [types] if types.instance_of?(String)
|
515
515
|
|
516
516
|
types.each do |type|
|
517
517
|
type = parse_dmi_type(type)
|
data/lib/kanrisuru/core/file.rb
CHANGED
@@ -65,10 +65,10 @@ module Kanrisuru
|
|
65
65
|
elsif opts[:target_directory]
|
66
66
|
command.append_arg('-t', dest)
|
67
67
|
|
68
|
-
source = source.instance_of?(String)
|
68
|
+
source = [source] if source.instance_of?(String)
|
69
69
|
command << source.join(' ')
|
70
70
|
else
|
71
|
-
source = source.instance_of?(String)
|
71
|
+
source = [source] if source.instance_of?(String)
|
72
72
|
command << source.join(' ')
|
73
73
|
command << dest
|
74
74
|
end
|
@@ -95,7 +95,7 @@ module Kanrisuru
|
|
95
95
|
command.append_flag('-b', opts[:number_nonblank])
|
96
96
|
command.append_flag('-A', opts[:show_all])
|
97
97
|
|
98
|
-
files = files.instance_of?(String)
|
98
|
+
files = [files] if files.instance_of?(String)
|
99
99
|
command << files.join(' ')
|
100
100
|
|
101
101
|
append_file(command, opts)
|
@@ -278,7 +278,7 @@ module Kanrisuru
|
|
278
278
|
|
279
279
|
repos = opts[:repos]
|
280
280
|
if Kanrisuru::Util.present?(repos)
|
281
|
-
repos = repos.instance_of?(String)
|
281
|
+
repos = [repos] if repos.instance_of?(String)
|
282
282
|
command << repos.join(' ')
|
283
283
|
end
|
284
284
|
|
@@ -374,7 +374,7 @@ module Kanrisuru
|
|
374
374
|
|
375
375
|
services = opts[:services]
|
376
376
|
if Kanrisuru::Util.present?(services)
|
377
|
-
services = services.instance_of?(
|
377
|
+
services = [services] if services.instance_of?(String)
|
378
378
|
command << services.join(' ')
|
379
379
|
end
|
380
380
|
|
@@ -392,7 +392,7 @@ module Kanrisuru
|
|
392
392
|
|
393
393
|
services = opts[:services]
|
394
394
|
if Kanrisuru::Util.present?(services)
|
395
|
-
services = services.instance_of?(String)
|
395
|
+
services = [services] if services.instance_of?(String)
|
396
396
|
command << services.join(' ')
|
397
397
|
end
|
398
398
|
|
data/lib/kanrisuru/version.rb
CHANGED
data/spec/helper/stub_network.rb
CHANGED
@@ -32,26 +32,26 @@ class StubNetwork
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
35
|
+
return if Kanrisuru::Result.instance_methods(false).include?(:initialize_alias)
|
36
|
+
|
37
|
+
Kanrisuru::Result.class_eval do
|
38
|
+
alias_method :initialize_alias, :initialize
|
39
|
+
def initialize(command, parse_result = false, &block)
|
40
|
+
@command = command
|
41
|
+
@data = nil
|
42
|
+
|
43
|
+
@data = block.call(@command) if @command.success? && block_given? && parse_result
|
44
|
+
@error = @command.to_a if @command.failure?
|
45
|
+
|
46
|
+
## Define getter methods on result that maps to
|
47
|
+
## the same methods of a data struct.
|
48
|
+
return unless @command.success? && Kanrisuru::Util.present?(@data) && @data.class.ancestors.include?(Struct)
|
49
|
+
|
50
|
+
method_names = @data.members
|
51
|
+
self.class.class_eval do
|
52
|
+
method_names.each do |method_name|
|
53
|
+
define_method method_name do
|
54
|
+
@data[method_name]
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|