kanrisuru 0.2.8 → 0.2.9
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/kanrisuru.gemspec +1 -1
- data/lib/kanrisuru/core/yum.rb +1 -1
- data/lib/kanrisuru/remote/fstab.rb +11 -2
- data/lib/kanrisuru/util/os_family.rb +1 -1
- data/lib/kanrisuru/version.rb +1 -1
- data/spec/functional/remote/fstab_spec.rb +16 -0
- 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: 0be09a32fde3ad8b5856c2e4b215d20201a6de1d890f1ede3cf27e471dfd50fd
|
4
|
+
data.tar.gz: 3573e66a75ce2fc88939e72bda7b915a7469506da713f19f8b80522a35849f58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08780b59675a42aeea9f523e253c23d393fa745bc66e73a5c79c6c3d6d6fa0462fa3e4ddf388b56668c32f80708671a1d2b9dbd6a9b918d4cecdfae37404a0f9'
|
7
|
+
data.tar.gz: 07fd46b83cf7b0391ba4729ad16cdcc88e73b2aacc1c7457855833c60ac4b55defd22914fba9f9cbe48bf5df42cad1bf34d2ddefc6db0918d651710cbbe549d2
|
data/kanrisuru.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.description = 'Manage remote servers over ssh with ruby.'
|
13
13
|
gem.homepage = 'https://github.com/avamia/kanrisuru'
|
14
14
|
|
15
|
-
gem.required_ruby_version
|
15
|
+
gem.required_ruby_version = '>= 2.5.0'
|
16
16
|
|
17
17
|
gem.add_development_dependency 'rspec', '~> 3.10'
|
18
18
|
gem.add_development_dependency 'rubocop', '~> 1.12'
|
data/lib/kanrisuru/core/yum.rb
CHANGED
@@ -67,7 +67,7 @@ module Kanrisuru
|
|
67
67
|
def append_file!
|
68
68
|
@file.append do |f|
|
69
69
|
@entries.each do |_, entry|
|
70
|
-
f << entry.to_s if entry[:new]
|
70
|
+
f << entry[:entry].to_s if entry[:new]
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -78,13 +78,22 @@ module Kanrisuru
|
|
78
78
|
def write_file!
|
79
79
|
@file.write do |f|
|
80
80
|
@entries.each do |_, entry|
|
81
|
-
f << entry.to_s
|
81
|
+
f << entry[:entry].to_s
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
85
|
reload!
|
86
86
|
end
|
87
87
|
|
88
|
+
def to_s
|
89
|
+
lines = []
|
90
|
+
@entries.each do |_, entry|
|
91
|
+
lines << entry[:entry].to_s
|
92
|
+
end
|
93
|
+
|
94
|
+
lines.join("\n")
|
95
|
+
end
|
96
|
+
|
88
97
|
def reload!
|
89
98
|
init_from_os
|
90
99
|
end
|
data/lib/kanrisuru/version.rb
CHANGED
@@ -16,6 +16,22 @@ RSpec.describe Kanrisuru::Remote::Fstab do
|
|
16
16
|
host.disconnect
|
17
17
|
end
|
18
18
|
|
19
|
+
it 'outputs string version of fstab' do
|
20
|
+
host.su('root')
|
21
|
+
|
22
|
+
result = host.cat('/etc/fstab')
|
23
|
+
expect(result).to be_success
|
24
|
+
raw_file_lines = []
|
25
|
+
result.each do |line|
|
26
|
+
next if line.match(/^#/) || line == ''
|
27
|
+
|
28
|
+
raw_file_lines << line.split.join(' ')
|
29
|
+
end
|
30
|
+
|
31
|
+
raw_file_output = raw_file_lines.join("\n")
|
32
|
+
expect(raw_file_output).to eq(host.fstab.to_s)
|
33
|
+
end
|
34
|
+
|
19
35
|
it 'parses fstab' do
|
20
36
|
host.su('root')
|
21
37
|
fstab = host.fstab
|