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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7036e8cca753cf96292eb0c4dd7bb29524852e486265b5de0403089af3f7897d
4
- data.tar.gz: c9237796bc85552104a451801e202a0bd57e139f4c2bafc2cea9d2275ff92291
3
+ metadata.gz: 8d4906b3c8c203b722479456407cb2a14f1cc236e60e096bd819522d6bb5dbac
4
+ data.tar.gz: 0aed905391cc7877b3060d4d6f133980afac8e100a9c54be2bd1221160b50417
5
5
  SHA512:
6
- metadata.gz: 8336450885b5e4f51d1afe19c75a18f3c3eca1928cc1ce9967287933960f0e695c2f6d2908ad3820e0cfcd705ade94388c9aa9657a9a894a0a1ee8d59090df03
7
- data.tar.gz: f5b94c6be1aa9859735f0aa3eddeba09283c76664930127724ab628f29a82e917fbb1f63494ffa626514e82fd4e33891bbe607c7fa6222d506ec259d384a0e85
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
- name_part = name.to_s.ljust(longest_name_size, ' ') + ':'
20
+ spaces = (' ' * (longest_name_size - name.to_s.length + 1))
21
21
  status_part = status.to_s.colorize(service_colors[status.to_sym])
22
- " #{name_part} #{status_part}"
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
- unless valid_responses.include? cmd_result
34
- @errors << ComponentError.new(self, 'Unable to parse systemctl output')
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
- active: :green,
46
- inactive: :red
47
- }
48
- end
44
+ colors = Hash.new(:red)
45
+ colors[:active] = :green
46
+ colors[:inactive] = :yellow
47
+ colors[:failed] = :red
49
48
 
50
- def valid_responses
51
- ['active', 'inactive']
49
+ colors
52
50
  end
53
51
  end
@@ -1,4 +1,4 @@
1
1
  class PandaMOTD
2
2
  #:nodoc:
3
- VERSION ||= '0.0.10'.freeze
3
+ VERSION ||= '0.0.11'.freeze
4
4
  end
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.10
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-13 00:00:00.000000000 Z
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
- rubyforge_project:
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.