kanrisuru 0.11.0 → 0.11.1

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: 71358a615946331ad5e1d4a0d6cd51523981ad046d788e5e189ba2c0f49c136e
4
- data.tar.gz: 7b6bec928fcd0b0dc05a77a83a8b5dc224d3f54f1ae162911dd742f90cf8ef81
3
+ metadata.gz: bb936ab5bcccbaa1d4f4b3d97b7bd810aba4e0a1915027e87d5e62fdb1bc8fbb
4
+ data.tar.gz: 5ea1754c5c23dbc4c1d3af3ee922e840b60ac4938573528e66773405d183f60d
5
5
  SHA512:
6
- metadata.gz: 26d0eff2b5548b07af887865f3b899e0e30d16ac4cfb1033eb761be282141156f3e24818d8257f432dfdd2a0687ceac4dee8abf2e7b6dfc9d5313950633ecf1a
7
- data.tar.gz: 63e244ee640721f7ad653e77d915f150420c9c97949d5f7f441818c13b2c5015fb9c7cb43b503ceff49076823455e3164c06de3e773e8b885f9bb1684e0c1672
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
- $ bundle install
31
+ ```bash
32
+ $ bundle install
33
+ ```
32
34
 
33
35
  Or install it yourself as:
34
36
 
35
- $ gem install kanrisuru
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) ? [paths] : paths
62
+ paths = [paths] if paths.instance_of?(String)
63
63
  command << paths.join(' ')
64
64
  end
65
65
 
@@ -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?(Array) ? types : [types]
514
+ types = [types] if types.instance_of?(String)
515
515
 
516
516
  types.each do |type|
517
517
  type = parse_dmi_type(type)
@@ -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) ? [source] : source
68
+ source = [source] if source.instance_of?(String)
69
69
  command << source.join(' ')
70
70
  else
71
- source = source.instance_of?(String) ? [source] : source
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) ? [files] : files
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) ? [repos] : repos
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?(Array) ? services : [services]
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) ? [services] : services
395
+ services = [services] if services.instance_of?(String)
396
396
  command << services.join(' ')
397
397
  end
398
398
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kanrisuru
4
- VERSION = '0.11.0'
4
+ VERSION = '0.11.1'
5
5
  end
@@ -11,7 +11,7 @@ RSpec.describe Kanrisuru::Remote::Cpu do
11
11
  StubNetwork.unstub!
12
12
  end
13
13
 
14
- context 'metal' do
14
+ context 'with metal' do
15
15
  let(:host) do
16
16
  Kanrisuru::Remote::Host.new(
17
17
  host: 'metal-host',
@@ -32,26 +32,26 @@ class StubNetwork
32
32
  end
33
33
  end
34
34
 
35
- unless Kanrisuru::Result.instance_methods(false).include?(:initialize_alias)
36
- Kanrisuru::Result.class_eval do
37
- alias_method :initialize_alias, :initialize
38
- def initialize(command, parse_result = false, &block)
39
- @command = command
40
- @data = nil
41
-
42
- @data = block.call(@command) if @command.success? && block_given? && parse_result
43
- @error = @command.to_a if @command.failure?
44
-
45
- ## Define getter methods on result that maps to
46
- ## the same methods of a data struct.
47
- return unless @command.success? && Kanrisuru::Util.present?(@data) && @data.class.ancestors.include?(Struct)
48
-
49
- method_names = @data.members
50
- self.class.class_eval do
51
- method_names.each do |method_name|
52
- define_method method_name do
53
- @data[method_name]
54
- end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanrisuru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mammina