panda-motd 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/panda_motd/components/service_status.rb +9 -11
- data/lib/panda_motd/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d4906b3c8c203b722479456407cb2a14f1cc236e60e096bd819522d6bb5dbac
|
4
|
+
data.tar.gz: 0aed905391cc7877b3060d4d6f133980afac8e100a9c54be2bd1221160b50417
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ae257444243189b4c6000b1151e7f9c3deb0a4a9fa8ce58766ac6c8bfef618d1df747cbe3f913972575116730bf9ceabad49fb1e0226b3c80b361617a943da1
|
7
|
+
data.tar.gz: bca4470e8c9e2513a794f99af9502b2c5e3dbc4171787bde6f2c66ca3cd4b8ed3fa9478cfdaedbc828b9af6f0025e818b14f2b2823703454aa67efbbb241496e
|
@@ -17,9 +17,9 @@ class ServiceStatus < Component
|
|
17
17
|
result = <<~HEREDOC
|
18
18
|
Services:
|
19
19
|
#{@results.map do |(name, status)|
|
20
|
-
|
20
|
+
spaces = (' ' * (longest_name_size - name.to_s.length + 1))
|
21
21
|
status_part = status.to_s.colorize(service_colors[status.to_sym])
|
22
|
-
" #{
|
22
|
+
" #{name}#{spaces}#{status_part}"
|
23
23
|
end.join("\n")}
|
24
24
|
HEREDOC
|
25
25
|
|
@@ -30,8 +30,8 @@ class ServiceStatus < Component
|
|
30
30
|
|
31
31
|
def parse_service(service)
|
32
32
|
cmd_result = `systemctl is-active #{service[0]}`.strip
|
33
|
-
|
34
|
-
@errors << ComponentError.new(self, '
|
33
|
+
if cmd_result.empty?
|
34
|
+
@errors << ComponentError.new(self, 'systemctl output was blank.')
|
35
35
|
end
|
36
36
|
cmd_result
|
37
37
|
end
|
@@ -41,13 +41,11 @@ class ServiceStatus < Component
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def service_colors
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
44
|
+
colors = Hash.new(:red)
|
45
|
+
colors[:active] = :green
|
46
|
+
colors[:inactive] = :yellow
|
47
|
+
colors[:failed] = :red
|
49
48
|
|
50
|
-
|
51
|
-
['active', 'inactive']
|
49
|
+
colors
|
52
50
|
end
|
53
51
|
end
|
data/lib/panda_motd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panda-motd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Thurlow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: artii
|
@@ -247,8 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
247
|
- !ruby/object:Gem::Version
|
248
248
|
version: '0'
|
249
249
|
requirements: []
|
250
|
-
|
251
|
-
rubygems_version: 2.7.8
|
250
|
+
rubygems_version: 3.0.1
|
252
251
|
signing_key:
|
253
252
|
specification_version: 4
|
254
253
|
summary: Make your MOTD prettier, and more useful.
|