linux-kstat 0.2.7-universal-linux → 0.2.8-universal-linux
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
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +4 -0
- data/README.md +1 -1
- data/Rakefile +5 -0
- data/lib/linux/kstat.rb +8 -4
- data/linux-kstat.gemspec +8 -3
- data/spec/linux_kstat_spec.rb +7 -1
- data.tar.gz.sig +0 -0
- metadata +5 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e193e5bb9555bf697c749f74f73d5cc9d0ead99072235e027f97d9f1fed4645d
|
4
|
+
data.tar.gz: 1377fdf553ee873d8acbd40c849e55205467e443c3e41ebf697a3dcf62f9b6ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2c0c13badaaaeac7de87d4c60df7d653bb739705c3a7289b709dd7f99001c8c49172429693c32a1d2983a3b793cc6efbe13917056fa9b5a25ae4fb4fe79d5d0
|
7
|
+
data.tar.gz: cadfd737b379423f7f05d7a0509b7fbfd7a7d77053bda59bd732f74d50d4b3f35652bbd867653fd0a3c2b8be2ec93b6ab994fbc9ba4d7d007ddca9e1e09ef958
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
data/lib/linux/kstat.rb
CHANGED
@@ -9,13 +9,14 @@ module Linux
|
|
9
9
|
extend Forwardable
|
10
10
|
|
11
11
|
# The version of the linux-kstat library
|
12
|
-
VERSION = '0.2.
|
12
|
+
VERSION = '0.2.8'
|
13
13
|
|
14
14
|
# :stopdoc:
|
15
15
|
|
16
16
|
# Delegate the the [] and inspect methods to the @hash variable
|
17
17
|
def_delegator(:@hash, :[])
|
18
18
|
def_delegator(:@hash, :inspect)
|
19
|
+
def_delegator(:@hash, :keys)
|
19
20
|
|
20
21
|
# :startdoc:
|
21
22
|
|
@@ -56,9 +57,12 @@ module Linux
|
|
56
57
|
|
57
58
|
File.readlines('/proc/stat').each do |line|
|
58
59
|
info = line.split
|
60
|
+
next if info.empty?
|
61
|
+
key = info.first.to_sym
|
62
|
+
|
59
63
|
unless info.empty?
|
60
64
|
if info.first =~ /^cpu/i
|
61
|
-
hash[
|
65
|
+
hash[key] = {
|
62
66
|
:user => info[1].to_i,
|
63
67
|
:nice => info[2].to_i,
|
64
68
|
:system => info[3].to_i,
|
@@ -71,9 +75,9 @@ module Linux
|
|
71
75
|
:guest_nice => info[10].to_i
|
72
76
|
}
|
73
77
|
elsif info.size > 2
|
74
|
-
hash[
|
78
|
+
hash[key] = info[1..-1].map(&:to_i)
|
75
79
|
else
|
76
|
-
hash[
|
80
|
+
hash[key] = info[1].to_i
|
77
81
|
end
|
78
82
|
end
|
79
83
|
end
|
data/linux-kstat.gemspec
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'linux-kstat'
|
5
|
-
gem.version = '0.2.
|
5
|
+
gem.version = '0.2.8'
|
6
6
|
gem.license = 'Apache-2.0'
|
7
7
|
gem.author = 'Daniel J. Berger'
|
8
8
|
gem.email = 'djberg96@gmail.com'
|
@@ -17,7 +17,10 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.add_development_dependency('rubocop-rspec')
|
18
18
|
gem.add_development_dependency('rspec', '~> 3.9')
|
19
19
|
|
20
|
-
gem
|
20
|
+
# Don't build this gem with Java-based implementations
|
21
|
+
if RUBY_ENGINE !~ /truffleruby|jruby/i
|
22
|
+
gem.platform = Gem::Platform.new(['universal', 'linux'])
|
23
|
+
end
|
21
24
|
|
22
25
|
gem.metadata = {
|
23
26
|
'homepage_uri' => 'https://github.com/djberg96/linux-kstat',
|
@@ -26,7 +29,9 @@ Gem::Specification.new do |gem|
|
|
26
29
|
'documentation_uri' => 'https://github.com/djberg96/linux-kstat/wiki',
|
27
30
|
'source_code_uri' => 'https://github.com/djberg96/linux-kstat',
|
28
31
|
'wiki_uri' => 'https://github.com/djberg96/linux-kstat/wiki',
|
29
|
-
'rubygems_mfa_required' => 'true'
|
32
|
+
'rubygems_mfa_required' => 'true',
|
33
|
+
'github_repo' => 'https://github.com/djberg96/linux-kstat',
|
34
|
+
'funding_uri' => 'https://github.com/sponsors/djberg96'
|
30
35
|
}
|
31
36
|
|
32
37
|
gem.description = <<-EOF
|
data/spec/linux_kstat_spec.rb
CHANGED
@@ -13,7 +13,7 @@ describe Linux::Kstat do
|
|
13
13
|
|
14
14
|
context 'constants' do
|
15
15
|
it 'defines a version constant that is set to the expected value' do
|
16
|
-
expect(Linux::Kstat::VERSION).to eql('0.2.
|
16
|
+
expect(Linux::Kstat::VERSION).to eql('0.2.8')
|
17
17
|
expect(Linux::Kstat::VERSION).to be_frozen
|
18
18
|
end
|
19
19
|
end
|
@@ -31,6 +31,12 @@ describe Linux::Kstat do
|
|
31
31
|
expect(kstat[:intr]).to be_a(Array)
|
32
32
|
end
|
33
33
|
|
34
|
+
it 'delegates the keys method' do
|
35
|
+
expect(kstat).to respond_to(:keys)
|
36
|
+
expect(kstat.keys).to be_a(Array)
|
37
|
+
expect(kstat.keys).to include(:cpu)
|
38
|
+
end
|
39
|
+
|
34
40
|
it 'does not allow key assignment' do
|
35
41
|
expect{ kstat[:cpu] = 'test' }.to raise_error(NoMethodError)
|
36
42
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linux-kstat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: universal-linux
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain:
|
11
10
|
- |
|
@@ -35,7 +34,7 @@ cert_chain:
|
|
35
34
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
35
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
36
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
37
|
+
date: 2025-06-13 00:00:00.000000000 Z
|
39
38
|
dependencies:
|
40
39
|
- !ruby/object:Gem::Dependency
|
41
40
|
name: rake
|
@@ -123,7 +122,8 @@ metadata:
|
|
123
122
|
source_code_uri: https://github.com/djberg96/linux-kstat
|
124
123
|
wiki_uri: https://github.com/djberg96/linux-kstat/wiki
|
125
124
|
rubygems_mfa_required: 'true'
|
126
|
-
|
125
|
+
github_repo: https://github.com/djberg96/linux-kstat
|
126
|
+
funding_uri: https://github.com/sponsors/djberg96
|
127
127
|
rdoc_options: []
|
128
128
|
require_paths:
|
129
129
|
- lib
|
@@ -138,8 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
|
-
rubygems_version: 3.
|
142
|
-
signing_key:
|
141
|
+
rubygems_version: 3.6.1
|
143
142
|
specification_version: 4
|
144
143
|
summary: Ruby interface for Linux kernel stats in /proc/stat
|
145
144
|
test_files:
|
metadata.gz.sig
CHANGED
Binary file
|