fedux_org-stdlib 0.7.17 → 0.7.18
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e61674d3165d7c29ddbfb16ff957f435e945e67f
|
4
|
+
data.tar.gz: 2b53ee529f9b9eac666c1624c0cc6d88876c88be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e6a1038779d52203f2e352f616531edbdcfbb2fa255c5defe7fc6e9de04201b938a88c68b5b722d3be890172e0463e331070fb3e3b8216ec207cc82adec89b1
|
7
|
+
data.tar.gz: a2d3f1d00fc557bff6221f7f2eb8d4f7f5eb6641a0f3a35f1441854a5e6adb691d74678d2b4ba4ee59b7a2694700889d2e5c8ec77cdfd66a2cd508e1f55526cd
|
data/Gemfile.lock
CHANGED
@@ -1,17 +1,20 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'fedux_org_stdlib/require_files'
|
3
|
+
require 'fedux_org_stdlib/core_ext/string/underline'
|
3
4
|
require_library %w{ facter }
|
4
5
|
|
5
6
|
module FeduxOrgStdlib
|
6
7
|
class SupportInformation
|
7
8
|
private
|
8
9
|
|
9
|
-
attr_reader :logger
|
10
|
+
attr_reader :logger, :headlines, :underline_character
|
10
11
|
|
11
12
|
public
|
12
13
|
|
13
|
-
def initialize(logger: FeduxOrgStdlib::Logging::Logger.new)
|
14
|
-
@logger
|
14
|
+
def initialize(logger: FeduxOrgStdlib::Logging::Logger.new, headlines: {}, underline_character: '-')
|
15
|
+
@logger = logger
|
16
|
+
@headlines = headlines
|
17
|
+
@underline_character = underline_character
|
15
18
|
end
|
16
19
|
|
17
20
|
# Output support information as string
|
@@ -23,6 +26,7 @@ module FeduxOrgStdlib
|
|
23
26
|
|
24
27
|
max_field_length = determine_max_field_length(facter_fields)
|
25
28
|
|
29
|
+
result << headlines.fetch(:system_information, 'System Information').underline(character: underline_character)
|
26
30
|
result << format("%#{max_field_length}s | %s", 'Information', 'Value')
|
27
31
|
result << format("%s + %s", '-' * max_field_length, '-' * 40)
|
28
32
|
result.concat system_information.sort_by { |key, value| key }.map { |key, value| format("%#{max_field_length}s | %s", key, value) }
|
@@ -33,6 +37,7 @@ module FeduxOrgStdlib
|
|
33
37
|
|
34
38
|
max_field_length = determine_max_field_length(rubygems_information.keys)
|
35
39
|
|
40
|
+
result << headlines.fetch(:rubygems_information, 'Rubygems Information').underline(character: underline_character)
|
36
41
|
result << format("%#{max_field_length}s | %s", 'Information', 'Value')
|
37
42
|
result << format("%s + %s", '-' * max_field_length, '-' * 40)
|
38
43
|
result.concat rubygems_information.sort_by { |key, value| key }.map { |key, value| format("%#{max_field_length}s | %s", key, value) }
|
@@ -43,6 +48,7 @@ module FeduxOrgStdlib
|
|
43
48
|
|
44
49
|
max_field_length = determine_max_field_length(installed_rubygems.keys)
|
45
50
|
|
51
|
+
result << headlines.fetch(:installed_rubygems, 'Installed Rubygems').underline(character: underline_character)
|
46
52
|
result << format("%#{max_field_length}s | %s", 'Name', 'version')
|
47
53
|
result << format("%s + %s", '-' * max_field_length, '-' * 40)
|
48
54
|
result.concat installed_rubygems.sort_by { |key, value| key }.map { |key, value| format("%#{max_field_length}s | %s", key, value) }
|