linux_stat 2.2.1 → 2.2.2

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: 7a2257dd9d025a05cf31fbfdf06d67933abd1d355678fe23c0ab1d5797fce9e9
4
- data.tar.gz: 3898fa563cda7716321f689a64448afb0b46bb7ba1c9bac297c9f3ba0e9e4f38
3
+ metadata.gz: d99cfc873aefbafccebb72accbc5d70e519ea76b2bc258a15f9a94195a83601b
4
+ data.tar.gz: 70c42c719c4f4392ffdd2bc247f5b9ed8a79d064eb8e6daf6c72d35d26f8f1df
5
5
  SHA512:
6
- metadata.gz: 5b6fede8da5d7a14322253c8c108b56069f0d3089349f23a9b7c207500c240b8a855a847dc9de649797da81466e449911609f3308473a4d8f5c32c1d0622cf46
7
- data.tar.gz: 0f61a61920ca364cba0b3e664ff67bab7fcbf45d3d47eaea622b71b2fde7585cb761025f1b02d8f7e80ea0105b66541432cdb7ca12594938a6d5f04c0d648b05
6
+ metadata.gz: 0422e7abf9f8c860702d61cdb13e5b6f8506b5a4109fe523d351c62a55c777e4d9e7c506f689bae37aef68ea5afef66f0a7264e7a6cf03cf1c2322413387631f
7
+ data.tar.gz: b5b13a08a59c327406bc917040349ef857c39bef27fe5e79a033865f9b9443b2385abb68d7e8e6c0d5bbfda418787d591456e81c392535254c0ae3eaee98cdde
@@ -521,7 +521,9 @@ module LinuxStat
521
521
  def start_time(pid = $$)
522
522
  # Getting two Time objects and dealing with floating point numbers
523
523
  # Just to make sure the time goes monotonically
524
- Time.at(start_time_epoch(pid))
524
+ _ste = start_time_epoch(pid)
525
+ return nil unless _ste
526
+ Time.at(_ste)
525
527
  end
526
528
 
527
529
  ##
@@ -22,6 +22,7 @@ module LinuxStat
22
22
  #
23
23
  # If the info isn't available, it will return an empty Hash.
24
24
  def any?
25
+ return nil unless File.readable?('/proc/swaps'.freeze)
25
26
  !!IO.foreach('/proc/swaps'.freeze).first(2)[1]
26
27
  end
27
28
 
@@ -1,3 +1,3 @@
1
1
  module LinuxStat
2
- VERSION ||= "2.2.1"
2
+ VERSION ||= "2.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linux_stat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sourav Goswami
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-12 00:00:00.000000000 Z
11
+ date: 2021-03-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Linux only, efficient linux system utilization reporting and system monitoring
14
14
  gem
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements: []
88
- rubygems_version: 3.2.7
88
+ rubygems_version: 3.2.13
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: Efficient linux system reporting gem