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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34a295375b187db49db38cccaa4fdd155d706378b1615d58744aa62f9172cada
4
- data.tar.gz: ed2e0995c40b0fa3902100377bb275e1413d98caf13bbd60b04bceb122d81301
3
+ metadata.gz: 0be09a32fde3ad8b5856c2e4b215d20201a6de1d890f1ede3cf27e471dfd50fd
4
+ data.tar.gz: 3573e66a75ce2fc88939e72bda7b915a7469506da713f19f8b80522a35849f58
5
5
  SHA512:
6
- metadata.gz: df90e5eca434eb978f0396919571f08c976aed094f096b62988368fcc93b2a1177c46e947aceb732273f420cd28d7ebd8ccf4db532398ddbdd87e7d4ccf8afc6
7
- data.tar.gz: 8c0b99e559e4f50610532dc57ef5ff0bb544259deac214cf03edcab3463f904e5935bcc4e6cdf041a4b231a44476df51084d3ba7570d8d4978dae14c31ca31d8
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 = '>= 2.5.0'
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'
@@ -345,7 +345,7 @@ module Kanrisuru
345
345
  current_row.description = description.strip
346
346
  rows << current_row
347
347
  end
348
-
348
+
349
349
  rows
350
350
  end
351
351
  end
@@ -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
@@ -186,7 +186,7 @@ module Kanrisuru
186
186
  model: 'open_source',
187
187
  state: 'current',
188
188
  type: 'distribution'
189
- },
189
+ }
190
190
  }
191
191
 
192
192
  def self.family_include_distribution?(family, dist)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kanrisuru
4
- VERSION = '0.2.8'
4
+ VERSION = '0.2.9'
5
5
  end
@@ -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
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.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mammina