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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd93c4105b08257a85c176b7898d5ae282b1d74bb33d99d2b11536fae6402eda
4
- data.tar.gz: a4a3a2032a1573c7f60ca09567fc9cb03ebea90cdc330f4652d7c7711d26adf6
3
+ metadata.gz: f91092bf5de209efc7db3b316df5b25643af51e278cbdc72a53ad351e115e4c9
4
+ data.tar.gz: f559119540ba5ecf2c95e6d683b4d6b85e9de5034569c645c31b189fddd1a284
5
5
  SHA512:
6
- metadata.gz: 24d055e84863433fa67cf3c5a59ddea66ad03346aaf469eb033dfa3dae362ee62117f4b07bcb251f26e73517a13dfde460132f3773e214ab34812c7838e7ccf9
7
- data.tar.gz: 0ac774300aab62af85094f9be2162449cbfa5be8bfba0f04fcf1801e11b9bbb730db8e51a765bbd53d9d0b887b769037ddc19fa5012018e1b5d8dfc3137adddb
6
+ metadata.gz: 4e13f72c21481ef052b353cb6ec01b3ee2d2c639fbe1931511083aad40c0ed4e4a5c8dd1daf7f1fef8da51a530cd23b5d32bcc8c4c1cc7fe97204d6175d985a6
7
+ data.tar.gz: db61cd342c678907aa7071eb2f0b150fed825821c8c124b4a85309506cddcf2095f3526d2e27b78a1e46489f672b3e05021447e1a08c704287f59ef9d8a26dc0
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # LinuxStat
2
2
  ![logo](https://raw.githubusercontent.com/Souravgoswami/linux_stat/master/logo/logo.jpg)
3
3
 
4
- 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.
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/[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).
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/[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).
@@ -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
@@ -1,3 +1,3 @@
1
1
  module LinuxStat
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linux_stat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sourav Goswami