linux_stat 0.1.2 → 0.2.1

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: 835e9c5295067665b9d84eaa365e653c6134322b22cac05581dc2e1970d1879c
4
- data.tar.gz: 5c9dbda4caa34f4a608d13d4d9545b4c78c1e8fc4c2886cf199fa83679415dc6
3
+ metadata.gz: f91092bf5de209efc7db3b316df5b25643af51e278cbdc72a53ad351e115e4c9
4
+ data.tar.gz: f559119540ba5ecf2c95e6d683b4d6b85e9de5034569c645c31b189fddd1a284
5
5
  SHA512:
6
- metadata.gz: f63387f4748c8fe55ec7bd2713c1a477b3755049e1fae91cc25c7312f15b83febbf0bb872d0e1aa59fafd390a3c45f74d9977ea44a56cd5a82bea8a52f45a73e
7
- data.tar.gz: f1b582654c0ea8842187f13d9f4ca42e021a3daad14e95b08955ba1a046ef6bc7f7d05e7aa9443fb96453ccb2f40b021deaa50f53bf5ef872075f1c12d33a8d4
6
+ metadata.gz: 4e13f72c21481ef052b353cb6ec01b3ee2d2c639fbe1931511083aad40c0ed4e4a5c8dd1daf7f1fef8da51a530cd23b5d32bcc8c4c1cc7fe97204d6175d985a6
7
+ data.tar.gz: db61cd342c678907aa7071eb2f0b150fed825821c8c124b4a85309506cddcf2095f3526d2e27b78a1e46489f672b3e05021447e1a08c704287f59ef9d8a26dc0
data/Gemfile CHANGED
@@ -2,6 +2,4 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in linux_stat.gemspec
4
4
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
5
+ gem "rake", ">= 12.0"
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # LinuxStat
2
+ ![logo](https://raw.githubusercontent.com/Souravgoswami/linux_stat/master/logo/logo.jpg)
2
3
 
3
- LinuxStat lets you read statistics of a Linux system. It can show you cpu stats and usages, memory stats and usages, swap stats and usages, battery usage, bios info, kernel details, local ip, os details and parse os-release + lsb-release, etc.
4
+ LinuxStat lets you read status of a Linux system. It can show you cpu stats and usages, memory stats and usages, swap stats and usages, battery usage, bios info, kernel details, local ip, os details and parse os-release + lsb-release, etc.
4
5
 
5
6
  It only works for Linux, and detecting the OS is upto the user of this gem.
6
7
 
@@ -21,35 +22,24 @@ Or install it yourself as:
21
22
  $ gem install linux_stat
22
23
 
23
24
  ## Usage
24
-
25
+ ### LinuxStat::BIOS
25
26
  ```
26
27
  LinuxStat::BIOS.date
27
- => 04/10/2017
28
-
29
- LinuxStat::BIOS.version
30
- => 1.1.2
28
+ => "04/10/2017"
31
29
 
32
30
  LinuxStat::BIOS.model
33
- => Inspiron 5567
31
+ => "Inspiron 5567"
34
32
 
35
33
  LinuxStat::BIOS.vendor
36
- => Dell Inc.
37
-
38
- LinuxStat::Battery.present?
39
- => true
40
-
41
- LinuxStat::Battery.status
42
- => Full
34
+ => "Dell Inc."
43
35
 
44
- LinuxStat::Battery.model
45
- => DELL CYMGM77
46
-
47
- LinuxStat::Battery.manufacturer
48
- => Samsung SDI
36
+ LinuxStat::BIOS.version
37
+ => "1.1.2"
49
38
 
50
- LinuxStat::Battery.technology
51
- => Li-ion
39
+ ```
52
40
 
41
+ ### LinuxStat::Battery
42
+ ```
53
43
  LinuxStat::Battery.charge
54
44
  => 100.0
55
45
 
@@ -62,122 +52,231 @@ LinuxStat::Battery.discharging?
62
52
  LinuxStat::Battery.full?
63
53
  => true
64
54
 
55
+ LinuxStat::Battery.manufacturer
56
+ => "Samsung SDI"
57
+
58
+ LinuxStat::Battery.model
59
+ => "DELL CYMGM77"
60
+
61
+ LinuxStat::Battery.present?
62
+ => true
63
+
65
64
  LinuxStat::Battery.stat
66
65
  => {:model=>"DELL CYMGM77", :manufacturer=>"Samsung SDI", :technology=>"Li-ion", :status=>"Full", :charge=>100.0, :charging=>true, :discharging=>false, :full=>true}
67
66
 
67
+ LinuxStat::Battery.status
68
+ => "Full"
69
+
70
+ LinuxStat::Battery.technology
71
+ => "Li-ion"
72
+
73
+ ```
74
+
75
+ ### LinuxStat::CPU
76
+ ```
68
77
  LinuxStat::CPU.count
69
78
  => 4
70
79
 
80
+ LinuxStat::CPU.cur_freq
81
+ => [2000001, 1999996, 1999998, 1999997]
82
+
83
+ LinuxStat::CPU.max_freq
84
+ => [2000000, 2000000, 2000000, 2000000]
85
+
71
86
  LinuxStat::CPU.model
72
- => Intel(R) Core(TM) i3-6006U CPU @ 2.00GHz
87
+ => "Intel(R) Core(TM) i3-6006U CPU @ 2.00GHz"
73
88
 
74
89
  LinuxStat::CPU.stat
75
- => {0=>0.0, 1=>0.0, 2=>0.0, 3=>0.0, 4=>0.0}
90
+ => {0=>30.0, 1=>50.0, 2=>28.57, 3=>16.67, 4=>28.57}
76
91
 
77
- LinuxStat::CPU.cur_freq
78
- => [2000094, 2000072, 2000045, 2000119]
92
+ LinuxStat::CPU.total_usage
93
+ => 26.67
79
94
 
80
- LinuxStat::CPU.max_freq
81
- => [2000000, 2000000, 2000000, 2000000]
95
+ LinuxStat::CPU.usage
96
+ => 25.0
82
97
 
83
- LinuxStat::Kernel.version
84
- => 5.9.1-xanmod1-1
98
+ LinuxStat::CPU.usages
99
+ => {0=>33.33, 1=>50.0, 2=>28.57, 3=>28.57, 4=>16.67}
85
100
 
101
+ ```
102
+
103
+ ### LinuxStat::Kernel
104
+ ```
86
105
  LinuxStat::Kernel.build_date
87
106
  => 2020-10-21 01:11:20 +0000
88
107
 
89
- LinuxStat::Kernel.string
90
- => Linux version 5.9.1-xanmod1-1 (souravgoswami@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Wed, 21 Oct 2020 01:11:20 +0000
108
+ LinuxStat::Kernel.build_date_string
109
+ => "21 Oct 2020 01:11:20 +0000"
110
+
111
+ LinuxStat::Kernel.build_user
112
+ => "souravgoswami@archlinux"
91
113
 
92
114
  LinuxStat::Kernel.compiler
93
115
  => [:gcc, "10.2.0"]
94
116
 
95
- LinuxStat::Memory.total
96
- => 3836256
117
+ LinuxStat::Kernel.compiler_version
118
+ => "10.2.0"
97
119
 
98
- LinuxStat::Memory.stat
99
- => {:total=>3836256, :used=>3331632, :available=>504624, :percent_used=>86.85, :percent_available=>13.15}
120
+ LinuxStat::Kernel.string
121
+ => "Linux version 5.9.1-xanmod1-1 (souravgoswami@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Wed, 21 Oct 2020 01:11:20 +0000"
100
122
 
123
+ LinuxStat::Kernel.version
124
+ => "5.9.1-xanmod1-1"
125
+
126
+ ```
127
+
128
+ ### LinuxStat::Memory
129
+ ```
101
130
  LinuxStat::Memory.available
102
- => 504624
131
+ => 405020
103
132
 
104
- LinuxStat::Memory.used
105
- => 3331632
133
+ LinuxStat::Memory.percent_available
134
+ => 10.56
106
135
 
107
136
  LinuxStat::Memory.percent_used
108
- => 86.85
137
+ => 89.44
109
138
 
110
- LinuxStat::Memory.percent_available
111
- => 13.15
139
+ LinuxStat::Memory.stat
140
+ => {:total=>3836264, :used=>3431244, :available=>405020, :percent_used=>89.44, :percent_available=>10.56}
141
+
142
+ LinuxStat::Memory.total
143
+ => 3836264
144
+
145
+ LinuxStat::Memory.used
146
+ => 3431244
147
+
148
+ ```
112
149
 
150
+ ### LinuxStat::Net
151
+ ```
113
152
  LinuxStat::Net.ipv4_private
114
- => 192.168.0.106
153
+ => "192.168.0.106"
115
154
 
116
- LinuxStat::OS.os_release
117
- => {:NAME=>"Arch Linux", :PRETTY_NAME=>"Arch Linux", :ID=>"arch", :BUILD_ID=>"rolling", :ANSI_COLOR=>"38;2;23;147;209", :HOME_URL=>"https://www.archlinux.org/", :DOCUMENTATION_URL=>"https://wiki.archlinux.org/", :SUPPORT_URL=>"https://bbs.archlinux.org/"...
155
+ ```
156
+
157
+ ### LinuxStat::OS
158
+ ```
159
+ LinuxStat::OS.bits
160
+ => 64
161
+
162
+ LinuxStat::OS.distribution
163
+ => "Arch Linux"
164
+
165
+ LinuxStat::OS.hostname
166
+ => "archlinux"
118
167
 
119
168
  LinuxStat::OS.lsb_release
120
169
  => {:LSB_VERSION=>"1.4", :DISTRIB_ID=>"Arch", :DISTRIB_RELEASE=>"rolling", :DISTRIB_DESCRIPTION=>"Arch Linux"}
121
170
 
171
+ LinuxStat::OS.os_release
172
+ => {:NAME=>"Arch Linux", :PRETTY_NAME=>"Arch Linux", :ID=>"arch", :BUILD_ID=>"rolling", :ANSI_COLOR=>"38;2;23;147;209", :HOME_URL=>"https://www.archlinux.org/", :DOCUMENTATION_URL=>"https://wiki.archlinux.org/", :SUPPORT_URL=>"https://bbs.archlinux.org/"...
173
+
122
174
  LinuxStat::OS.uptime
123
- => {:hour=>6, :minute=>57, :second=>37.16}
175
+ => {:hour=>40, :minute=>46, :second=>19.75}
176
+
177
+ ```
124
178
 
179
+ ### LinuxStat::Process
180
+ ```
125
181
  LinuxStat::Process.count
126
- => 209
182
+ => 223
183
+
184
+ LinuxStat::Process.idle
185
+ => [3, 4, 6, 9, 12, 23, 30, 37, 39, 49, 102, 103, 104, 106, 107, 108, 109, 110, 117, 118, 120, 122, 131, 134, 140, 152, 153, 166, 168, 170, 171, 174, 180, 181, 182, 183, 184, 185, 187, 224, 272, 320, 327, 328, 2238, 2239, 2240, 2241, 2242, 2243, 89437, 9...
186
+
187
+ LinuxStat::Process.list
188
+ => [1, 2, 3, 4, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 46, 47, 48, 49, 50, 51, 52, 102, 103, 104, 106, 107, 108, 109, 110, 111, 114, 115, 117, 118, 120, 122, 131, 134,...
189
+
190
+ LinuxStat::Process.names
191
+ => {1=>"systemd", 2=>"kthreadd", 3=>"rcu_gp", 4=>"rcu_par_gp", 6=>"kworker/0:0H", 9=>"mm_percpu_wq", 10=>"ksoftirqd/0", 11=>"rcuc/0", 12=>"rcu_preempt", 13=>"rcub/0", 14=>"migration/0", 15=>"idle_inject/0", 16=>"cpuhp/0", 17=>"cpuhp/1", 18=>"idle_inject/...
192
+
193
+ LinuxStat::Process.running
194
+ => [525, 91940, 91971, 91993, 92020, 95119]
127
195
 
128
196
  LinuxStat::Process.sleeping
129
- => [1, 2, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 38, 40, 41, 42, 46, 47, 48, 50, 51, 52, 112, 114, 115, 167, 169, 187, 214, 229, 314, 316, 317, 318, 319, 324, 325, 327, 340, 361, 362, 363, 364, 372, 375, 378,...
197
+ => [1, 2, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 38, 40, 41, 42, 46, 47, 48, 50, 51, 52, 111, 114, 115, 165, 167, 186, 214, 227, 302, 313, 319, 321, 333, 334, 335, 352, 353, 354, 355, 362, 366, 367, 369, 382,...
198
+
199
+ LinuxStat::Process.types
200
+ => {1=>:sleeping, 2=>:sleeping, 3=>:idle, 4=>:idle, 6=>:idle, 9=>:idle, 10=>:sleeping, 11=>:sleeping, 12=>:idle, 13=>:sleeping, 14=>:sleeping, 15=>:sleeping, 16=>:sleeping, 17=>:sleeping, 18=>:sleeping, 19=>:sleeping, 20=>:sleeping, 21=>:sleeping, 23=>:i...
130
201
 
131
202
  LinuxStat::Process.zombie
132
203
  => []
133
204
 
134
- LinuxStat::Process.running
135
- => [21279]
205
+ ```
136
206
 
137
- LinuxStat::Process.idle
138
- => [3, 4, 6, 9, 12, 23, 30, 37, 39, 49, 102, 103, 104, 106, 107, 108, 109, 110, 117, 118, 119, 121, 131, 134, 140, 152, 153, 168, 170, 172, 173, 177, 181, 182, 183, 184, 185, 186, 220, 225, 271, 322, 326, 329, 333, 2914, 2915, 2916, 2917, 2918, 2919, 148...
207
+ ### LinuxStat::Swap
208
+ ```
209
+ LinuxStat::Swap.any?
210
+ => true
139
211
 
140
- LinuxStat::Process.names
141
- => {1=>"systemd", 2=>"kthreadd", 3=>"rcu_gp", 4=>"rcu_par_gp", 6=>"kworker/0:0H-kblockd", 9=>"mm_percpu_wq", 10=>"ksoftirqd/0", 11=>"rcuc/0", 12=>"rcu_preempt", 13=>"rcub/0", 14=>"migration/0", 15=>"idle_inject/0", 16=>"cpuhp/0", 17=>"cpuhp/1", 18=>"idle...
212
+ LinuxStat::Swap.available
213
+ => 2292252
142
214
 
143
- LinuxStat::Process.list
144
- => [1, 2, 3, 4, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 46, 47, 48, 49, 50, 51, 52, 102, 103, 104, 106, 107, 108, 109, 110, 112, 114, 115, 117, 118, 119, 121, 131, 134,...
215
+ LinuxStat::Swap.list
216
+ => {"/dev/zram0"=>[:partition, 4194300, 1902048, -2]}
145
217
 
146
- LinuxStat::Process.types
147
- => {1=>:sleeping, 2=>:sleeping, 3=>:idle, 4=>:idle, 6=>:idle, 9=>:idle, 10=>:sleeping, 11=>:sleeping, 12=>:idle, 13=>:sleeping, 14=>:sleeping, 15=>:sleeping, 16=>:sleeping, 17=>:sleeping, 18=>:sleeping, 19=>:sleeping, 20=>:sleeping, 21=>:sleeping, 23=>:i...
218
+ LinuxStat::Swap.percent_available
219
+ => 54.65
148
220
 
149
- LinuxStat::Swap.total
150
- => 4194300
221
+ LinuxStat::Swap.percent_used
222
+ => 45.35
151
223
 
152
224
  LinuxStat::Swap.stat
153
- => {:total=>4194300, :used=>1236572, :available=>2957728, :percent_used=>29.48, :percent_available=>70.52}
225
+ => {:total=>4194300, :used=>1902048, :available=>2292252, :percent_used=>45.35, :percent_available=>54.65}
154
226
 
155
- LinuxStat::Swap.available
156
- => 2957728
227
+ LinuxStat::Swap.total
228
+ => 4194300
157
229
 
158
230
  LinuxStat::Swap.used
159
- => 1236572
231
+ => 1902048
160
232
 
161
- LinuxStat::Swap.percent_used
162
- => 29.48
233
+ ```
163
234
 
164
- LinuxStat::Swap.list
165
- => {"/dev/zram0"=>[:partition, 4194300, 1236572, -2]}
235
+ ### Return Types:
236
+ In general, if a method returns either a Float or a Integer or a Time, it will return float. But if the status isn't available, it will return nil.
237
+ If the method returns a Hash / Array, it will return return Hash. If the status isn't available, it will return an empty Hash / Array.
238
+ If the method returns a String, it will return return Hash. If the status isn't available, it will return an empty *frozen* String.
166
239
 
167
- LinuxStat::Swap.percent_available
168
- => 70.52
169
- ```
240
+ It doesn't have implementation of any Error that gets raised in runtime for the ease of use.
241
+ If you need to check some stat that returns an integer or float, and you get nil, you know it's not available, so you can work accordingly.
242
+ But if you need the integer or float value in 0 to whatever format, you can use the .to_i or .to_f method on the object, nil will get converted to number then.
170
243
 
244
+ If some error is *raised* it should be reported as a bug.
171
245
 
172
246
  ## Development
173
247
 
174
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
248
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
175
249
 
176
250
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
177
251
 
252
+ ## Testing
253
+ Like other gems, this doesn't have a test like RSpec. We suggest using the bin/linuxstat.rb file on various systems.
254
+ If you need to test a specific module, say the CPU, just run it like this:
255
+
256
+ ```
257
+ ruby bin/linuxstat.rb CPU
258
+ ```
259
+
260
+ Or:
261
+ ```
262
+ ruby bin/linuxstat.rb cpu
263
+ ```
264
+
265
+ That is, the argument passed is not case-sensitive.
266
+ But if the method passed isn't available and outright wrong, it will run all the module methods. For example, you can't do:
267
+
268
+ ```
269
+ ruby bin/linuxstat.rb upc
270
+ ```
271
+
272
+ You can run `rake` to test all the modules.
273
+ You can also use `rake cpu` to test the CPU module or `rake memory` to test the memory module. But this is case-sensitive.
274
+
275
+ This is not a valid module and can't be run.
276
+
178
277
  ## Contributing
179
278
 
180
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/linux_stat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[Souravgoswami]/linux_stat/blob/master/CODE_OF_CONDUCT.md).
279
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Souravgoswami/linux_stat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Souravgoswami/linux_stat/blob/master/CODE_OF_CONDUCT.md).
181
280
 
182
281
  ## License
183
282
 
@@ -185,4 +284,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
185
284
 
186
285
  ## Code of Conduct
187
286
 
188
- Everyone interacting in the LinuxStat project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/linux_stat/blob/master/CODE_OF_CONDUCT.md).
287
+ Everyone interacting in the LinuxStat project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Souravgoswami/linux_stat/blob/master/CODE_OF_CONDUCT.md).
@@ -1,14 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "linux_stat"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
2
+ $-v = true
3
+ %w(bundler/setup linux_stat irb).each(&method(:require))
14
4
  IRB.start(__FILE__)
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ require 'linux_stat'
4
+ rescue LoadError
5
+ require 'bundler/setup'
6
+ require 'linux_stat'
7
+ end
8
+
9
+ $-v = true
10
+
11
+ # Print time each method takes unless --no-time or -nt option is passed
12
+ MARKDOWN = ARGV.any? { |x| x[/^\-\-markdown$/] || x[/^\-md$/] }
13
+ PRINT_TIME = MARKDOWN ? false : !ARGV.any? { |x| x[/^\-\-no-time$/] || x[/^\-nt$/] }
14
+
15
+ %w(--markdown -md --no-time -nt).each(&ARGV.method(:delete))
16
+
17
+ # Run only desired classes / modules
18
+ constants = LinuxStat.constants
19
+
20
+ execute = constants.map(&:downcase).map.with_index { |x, i|
21
+ constants[i] if ARGV.find { |y| y.downcase.to_sym == x }
22
+ }.compact
23
+
24
+ execute.replace(constants) if execute.empty?
25
+
26
+ execute.sort.each do |c|
27
+ e = eval("LinuxStat::#{c}")
28
+
29
+ next if e.class != Module && e.class != Class
30
+
31
+ meths = e.methods(false).sort
32
+
33
+ if meths.length > 0
34
+ if MARKDOWN
35
+ puts "### LinuxStat::#{c}\n```"
36
+ else
37
+ puts "\e[1;4;38;2;255;240;0mLinuxStat::#{c}\e[0m"
38
+ end
39
+ end
40
+
41
+ meths.each do |meth|
42
+ time = Time.now
43
+ v = e.send(meth)
44
+ time = Time.now.-(time).*(1_000_000).round(3)
45
+
46
+ v = v.inspect
47
+ dis = v.length > 253 ? v[0..250].strip + '...'.freeze : v
48
+
49
+ if MARKDOWN
50
+ puts "#{e}.#{meth}\n=> #{dis}"
51
+ else
52
+ puts "\e[1;38;2;80;80;255m#{e}.#{meth}\e[0m\n=> #{dis}"
53
+ end
54
+
55
+ puts( "(" +
56
+ if time > 10_000
57
+ "\e[1;38;2;255;50;50m"
58
+ elsif time > 5_000
59
+ "\e[1;38;2;255;170;0m"
60
+ else
61
+ "\e[1;38;2;0;170;0m"
62
+ end + "Time taken: #{time}\u03BCs\e[0m)"
63
+ ) if PRINT_TIME
64
+
65
+ puts
66
+ end
67
+
68
+ puts "```\n\n" if MARKDOWN && meths.length > 0
69
+ end
@@ -1,8 +1,6 @@
1
1
  require "linux_stat/version"
2
2
 
3
3
  module LinuxStat
4
- class StatUnavailable < StandardError
5
- end
6
4
  end
7
5
 
8
6
  require "linux_stat/battery"