linux_stat 0.2.0 → 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 +4 -4
- data/README.md +3 -3
- data/lib/linux_stat/kernel.rb +6 -6
- data/lib/linux_stat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f91092bf5de209efc7db3b316df5b25643af51e278cbdc72a53ad351e115e4c9
|
4
|
+
data.tar.gz: f559119540ba5ecf2c95e6d683b4d6b85e9de5034569c645c31b189fddd1a284
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e13f72c21481ef052b353cb6ec01b3ee2d2c639fbe1931511083aad40c0ed4e4a5c8dd1daf7f1fef8da51a530cd23b5d32bcc8c4c1cc7fe97204d6175d985a6
|
7
|
+
data.tar.gz: db61cd342c678907aa7071eb2f0b150fed825821c8c124b4a85309506cddcf2095f3526d2e27b78a1e46489f672b3e05021447e1a08c704287f59ef9d8a26dc0
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# LinuxStat
|
2
2
|

|
3
3
|
|
4
|
-
LinuxStat lets you read
|
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.
|
5
5
|
|
6
6
|
It only works for Linux, and detecting the OS is upto the user of this gem.
|
7
7
|
|
@@ -276,7 +276,7 @@ This is not a valid module and can't be run.
|
|
276
276
|
|
277
277
|
## Contributing
|
278
278
|
|
279
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
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).
|
280
280
|
|
281
281
|
## License
|
282
282
|
|
@@ -284,4 +284,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
284
284
|
|
285
285
|
## Code of Conduct
|
286
286
|
|
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/
|
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).
|
data/lib/linux_stat/kernel.rb
CHANGED
@@ -73,15 +73,15 @@ module LinuxStat
|
|
73
73
|
joined = x.each(&:strip!).join(?\s.freeze)
|
74
74
|
|
75
75
|
# Match 21 Oct 2020 01:11:20 +0000
|
76
|
-
if joined[/^\d{2}\s\w{3}\s\d{4}\s\d{2}:\d{2}:\d{2}\s\+\d*$/]
|
76
|
+
if joined[/^\d{1,2}\s\w{3}\s\d{4}\s\d{1,2}:\d{1,2}:\d{1,2}\s\+\d*$/]
|
77
77
|
Time.strptime(joined, '%d %b %Y %H:%M:%S %Z') rescue nil
|
78
78
|
|
79
79
|
# Match Aug 25 17:23:54 UTC 2020
|
80
|
-
elsif joined[/^\w{3}\s\d{2}\s\d{2}:\d{2}:\d{2}\s\w+\s\d*$/]
|
80
|
+
elsif joined[/^\w{3}\s\d{1,2}\s\d{1,2}:\d{1,2}:\d{2}\s\w+\s\d*$/]
|
81
81
|
Time.strptime(joined, '%b %d %H:%M:%S %z %Y') rescue nil
|
82
82
|
|
83
83
|
# Match 2017-09-19
|
84
|
-
elsif joined[/\d{4}-\d{2}-\d{2}/]
|
84
|
+
elsif joined[/\d{4}-\d{1,2}-\d{1,2}/]
|
85
85
|
Time.strptime(joined[/\d{4}-\d{2}-\d{2}/] + " +00:00", '%Y-%m-%d %z') rescue nil
|
86
86
|
|
87
87
|
else
|
@@ -118,13 +118,13 @@ module LinuxStat
|
|
118
118
|
joined = x.each(&:strip!).join(?\s.freeze)
|
119
119
|
|
120
120
|
# Match 21 Oct 2020 01:11:20 +0000
|
121
|
-
if (joined[/^\d{2}\s\w{3}\s\d{4}\s\d{2}:\d{2}:\d{2}\s\+\d*$/] && (Time.strptime(joined, '%d %b %Y %H:%M:%S %Z') rescue nil)) ||
|
121
|
+
if (joined[/^\d{1,2}\s\w{3}\s\d{4}\s\d{1,2}:\d{1,2}:\d{1,2}\s\+\d*$/] && (Time.strptime(joined, '%d %b %Y %H:%M:%S %Z') rescue nil)) ||
|
122
122
|
|
123
123
|
# Match Aug 25 17:23:54 UTC 2020
|
124
|
-
(joined[/^\w{3}\s\d{2}\s\d{2}:\d{2}:\d{2}\s\w+\s\d*$/] && (Time.strptime(joined, '%b %d %H:%M:%S %z %Y') rescue nil)) ||
|
124
|
+
(joined[/^\w{3}\s\d{1,2}\s\d{1,2}:\d{1,2}:\d{1,2}\s\w+\s\d*$/] && (Time.strptime(joined, '%b %d %H:%M:%S %z %Y') rescue nil)) ||
|
125
125
|
|
126
126
|
# Match 2017-09-19
|
127
|
-
(joined[/\d{4}-\d{2}-\d{2}/] && (Time.strptime(joined[/\d{4}-\d{2}-\d{2}/] + " +00:00", '%Y-%m-%d %z') rescue nil))
|
127
|
+
(joined[/\d{4}-\d{1,2}-\d{1,2}/] && (Time.strptime(joined[/\d{4}-\d{2}-\d{2}/] + " +00:00", '%Y-%m-%d %z') rescue nil))
|
128
128
|
joined
|
129
129
|
else
|
130
130
|
nil
|
data/lib/linux_stat/version.rb
CHANGED