panda-motd 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 83d9afcd650c9756e2d67f1b943636e1f36fd82f2bf980efdbdc5ecaa15de0d4
4
+ data.tar.gz: b63abe376f04963ef5c4a6d5609ddcaef7a6f5070e27e762ffa8dc1b61a91fb3
5
+ SHA512:
6
+ metadata.gz: e53ec2f4ebd333e722d6c5954ffecd243af8edb3c84d791e8117e02ce23509866b1eedc09557f282553794f469082f29d79b714903ce0dd0b28979ebc246dd11
7
+ data.tar.gz: 272253a011490cdef506dff3fe273a1819795a9fcac8f25a16ad4b3f7a445e2373718d8a2d07ed525d99e13a46b98fb4de3c2ffb373330f74a1fd37e7d73a757
data/bin/panda-motd ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'panda_motd'
4
+
5
+ motd = MOTD.new
6
+ puts motd
data/lib/panda_motd.rb ADDED
@@ -0,0 +1,4 @@
1
+ Dir['lib/panda_motd/**/*.rb'].each { |r| require r.gsub(%r{lib\/|\.rb}, '') }
2
+
3
+ class PandaMOTD
4
+ end
@@ -0,0 +1,12 @@
1
+ require 'artii'
2
+
3
+ class AsciiTextArt
4
+ def initialize(text, font)
5
+ @text = text
6
+ @art = Artii::Base.new font: font
7
+ end
8
+
9
+ def to_s
10
+ return "\n#{@art.asciify(@text)}\n"
11
+ end
12
+ end
@@ -0,0 +1,22 @@
1
+ require 'sysinfo'
2
+
3
+ class Uptime
4
+ attr_reader :days, :hours, :minutes
5
+
6
+ def initialize
7
+ sysinfo = SysInfo.new
8
+ uptime = sysinfo.uptime
9
+
10
+ @days = (uptime / 24).floor
11
+ @hours = (uptime - @days * 24).floor
12
+ @minutes = ((uptime - @days * 24 - hours) * 60).floor
13
+ end
14
+
15
+ def to_s
16
+ result = ''
17
+ result += "#{@days} day#{'s' if @days != 1}, " unless @days.zero?
18
+ result += "#{@hours} hour#{'s' if @hours != 1}, " unless @hours.zero? && @days.zero?
19
+ result += "#{@minutes} minute#{'s' if @minutes != 1}"
20
+ return "uptime: #{result}"
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ class MOTD
2
+ attr_reader :components
3
+
4
+ def initialize
5
+ @components = [
6
+ AsciiTextArt.new('pandaMOTD', 'slant'),
7
+ Uptime.new
8
+ ]
9
+ end
10
+
11
+ def to_s
12
+ return @components.map(&:to_s).join("\n")
13
+ end
14
+ end
@@ -0,0 +1,4 @@
1
+ class PandaMOTD
2
+ #:nodoc:
3
+ VERSION = '0.0.2'.freeze
4
+ end
metadata ADDED
@@ -0,0 +1,176 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: panda-motd
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Taylor Thurlow
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-05-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: artii
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sysinfo
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.8'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: tty-markdown
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: byebug
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.14'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.14'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard-rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '4.7'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '4.7'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.7'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.7'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.51'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.51'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.25'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.25'
139
+ description: Enhance your MOTD with useful at-a-glance information.
140
+ email: taylorthurlow8@gmail.com
141
+ executables:
142
+ - panda-motd
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - bin/panda-motd
147
+ - lib/panda_motd.rb
148
+ - lib/panda_motd/components/ascii_text_art.rb
149
+ - lib/panda_motd/components/uptime.rb
150
+ - lib/panda_motd/motd.rb
151
+ - lib/panda_motd/version.rb
152
+ homepage: https://github.com/taylorthurlow/panda-motd
153
+ licenses:
154
+ - MIT
155
+ metadata: {}
156
+ post_install_message:
157
+ rdoc_options: []
158
+ require_paths:
159
+ - lib
160
+ required_ruby_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '2.2'
165
+ required_rubygems_version: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ requirements: []
171
+ rubyforge_project:
172
+ rubygems_version: 2.7.6
173
+ signing_key:
174
+ specification_version: 4
175
+ summary: Make your MOTD prettier, and more useful.
176
+ test_files: []