sys-cpu 1.0.1 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +22 -0
- data/Gemfile +2 -7
- data/MANIFEST.md +1 -0
- data/README.md +21 -14
- data/Rakefile +4 -1
- data/doc/bsd.md +58 -0
- data/doc/linux.md +46 -0
- data/install.rb +2 -2
- data/lib/sys/cpu.rb +10 -1
- data/lib/sys/darwin/sys/cpu.rb +198 -0
- data/lib/sys/linux/sys/cpu.rb +43 -43
- data/lib/sys/unix/sys/cpu.rb +57 -97
- data/lib/sys/windows/sys/cpu.rb +430 -311
- data/lib/sys-cpu.rb +2 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/sys_cpu_bsd_spec.rb +53 -51
- data/spec/sys_cpu_hpux_spec.rb +33 -28
- data/spec/sys_cpu_linux_spec.rb +32 -26
- data/spec/{sys_cpu_spec.rb → sys_cpu_shared.rb} +10 -4
- data/spec/sys_cpu_sunos_spec.rb +44 -42
- data/spec/sys_cpu_windows_spec.rb +39 -34
- data/sys-cpu.gemspec +4 -4
- data.tar.gz.sig +0 -0
- metadata +40 -11
- metadata.gz.sig +0 -0
- data/doc/bsd.txt +0 -49
- data/doc/linux.txt +0 -41
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys-cpu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
36
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2022-06-10 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: ffi
|
@@ -65,6 +65,20 @@ dependencies:
|
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: rubocop
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
68
82
|
- !ruby/object:Gem::Dependency
|
69
83
|
name: rspec
|
70
84
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,6 +93,20 @@ dependencies:
|
|
79
93
|
- - "~>"
|
80
94
|
- !ruby/object:Gem::Version
|
81
95
|
version: '3.9'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: rubocop-rspec
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
82
110
|
description: |2
|
83
111
|
The sys-cpu library provides an interface for gathering information
|
84
112
|
about your system's processor(s). Information includes speed, type,
|
@@ -95,9 +123,9 @@ files:
|
|
95
123
|
- README.md
|
96
124
|
- Rakefile
|
97
125
|
- certs/djberg96_pub.pem
|
98
|
-
- doc/bsd.
|
126
|
+
- doc/bsd.md
|
99
127
|
- doc/hpux.txt
|
100
|
-
- doc/linux.
|
128
|
+
- doc/linux.md
|
101
129
|
- doc/sunos.txt
|
102
130
|
- doc/windows.txt
|
103
131
|
- examples/example_sys_cpu_bsd.rb
|
@@ -108,6 +136,7 @@ files:
|
|
108
136
|
- install.rb
|
109
137
|
- lib/sys-cpu.rb
|
110
138
|
- lib/sys/cpu.rb
|
139
|
+
- lib/sys/darwin/sys/cpu.rb
|
111
140
|
- lib/sys/linux/sys/cpu.rb
|
112
141
|
- lib/sys/unix/sys/cpu.rb
|
113
142
|
- lib/sys/windows/sys/cpu.rb
|
@@ -115,7 +144,7 @@ files:
|
|
115
144
|
- spec/sys_cpu_bsd_spec.rb
|
116
145
|
- spec/sys_cpu_hpux_spec.rb
|
117
146
|
- spec/sys_cpu_linux_spec.rb
|
118
|
-
- spec/
|
147
|
+
- spec/sys_cpu_shared.rb
|
119
148
|
- spec/sys_cpu_sunos_spec.rb
|
120
149
|
- spec/sys_cpu_windows_spec.rb
|
121
150
|
- sys-cpu.gemspec
|
@@ -125,11 +154,11 @@ licenses:
|
|
125
154
|
metadata:
|
126
155
|
homepage_uri: https://github.com/djberg96/sys-cpu
|
127
156
|
bug_tracker_uri: https://github.com/djberg96/sys-cpu/issues
|
128
|
-
changelog_uri: https://github.com/djberg96/sys-cpu/blob/
|
157
|
+
changelog_uri: https://github.com/djberg96/sys-cpu/blob/main/CHANGES.md
|
129
158
|
documentation_uri: https://github.com/djberg96/sys-cpu/wiki
|
130
159
|
source_code_uri: https://github.com/djberg96/sys-cpu
|
131
160
|
wiki_uri: https://github.com/djberg96/sys-cpu/wiki
|
132
|
-
post_install_message:
|
161
|
+
post_install_message:
|
133
162
|
rdoc_options: []
|
134
163
|
require_paths:
|
135
164
|
- lib
|
@@ -144,8 +173,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
173
|
- !ruby/object:Gem::Version
|
145
174
|
version: '0'
|
146
175
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
148
|
-
signing_key:
|
176
|
+
rubygems_version: 3.3.7
|
177
|
+
signing_key:
|
149
178
|
specification_version: 4
|
150
179
|
summary: A Ruby interface for providing CPU information
|
151
180
|
test_files:
|
@@ -153,6 +182,6 @@ test_files:
|
|
153
182
|
- spec/sys_cpu_bsd_spec.rb
|
154
183
|
- spec/sys_cpu_hpux_spec.rb
|
155
184
|
- spec/sys_cpu_linux_spec.rb
|
185
|
+
- spec/sys_cpu_shared.rb
|
156
186
|
- spec/sys_cpu_sunos_spec.rb
|
157
187
|
- spec/sys_cpu_windows_spec.rb
|
158
|
-
- spec/sys_cpu_spec.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/doc/bsd.txt
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
== Description
|
2
|
-
Sys::CPU - An interface for various cpu statistics
|
3
|
-
|
4
|
-
== Synopsis
|
5
|
-
require "sys/cpu"
|
6
|
-
include Sys
|
7
|
-
|
8
|
-
# BSD and OS X
|
9
|
-
puts "Architecture: " + CPU.architecture
|
10
|
-
puts "Machine: " + CPU.machine
|
11
|
-
puts "Mhz: " + CPU.cpu_freq.to_s
|
12
|
-
puts "Number of cpu's on this system: " + CPU.num_cpu.to_s
|
13
|
-
puts "CPU model: " + CPU.model
|
14
|
-
puts "Load averages: " + CPU.load_avg.join(", ")
|
15
|
-
|
16
|
-
== Constants
|
17
|
-
VERSION
|
18
|
-
Returns the current version number for this package.
|
19
|
-
|
20
|
-
== Class Methods
|
21
|
-
CPU.architecture
|
22
|
-
Returns the cpu's architecture.
|
23
|
-
|
24
|
-
CPU.freq
|
25
|
-
Returns an integer indicating the speed (i.e. frequency in Mhz) of
|
26
|
-
the cpu.
|
27
|
-
|
28
|
-
Not supported on OS X.
|
29
|
-
|
30
|
-
CPU.load_avg
|
31
|
-
Returns an array of three floats indicating the 1, 5 and 15 minute load
|
32
|
-
average.
|
33
|
-
|
34
|
-
CPU.machine
|
35
|
-
Returns the class of cpu (probably identical to the architecture).
|
36
|
-
|
37
|
-
CPU.model
|
38
|
-
Returns a string indicating the cpu model.
|
39
|
-
|
40
|
-
CPU.num_cpu
|
41
|
-
Returns an integer indicating the number of cpu's on the system.
|
42
|
-
|
43
|
-
== Error Classes
|
44
|
-
CPU::Error < StandardError
|
45
|
-
Raised is response to internal function errors, usually relating to an
|
46
|
-
invalid cpu number.
|
47
|
-
|
48
|
-
== More Information
|
49
|
-
See the README file for more information.
|
data/doc/linux.txt
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
== Description
|
2
|
-
Sys::CPU - An interface for various cpu statistics
|
3
|
-
|
4
|
-
== Synopsis
|
5
|
-
require "sys/cpu"
|
6
|
-
include Sys
|
7
|
-
|
8
|
-
CPU.processors{ |cs|
|
9
|
-
cs.members.each{ |m|
|
10
|
-
puts "#{m}: " + cs[m].to_s
|
11
|
-
}
|
12
|
-
}
|
13
|
-
|
14
|
-
CPU.bogomips(1) # -> returns bogomips for cpu #2
|
15
|
-
|
16
|
-
== Notes
|
17
|
-
Portions of this documentation built dynamically
|
18
|
-
|
19
|
-
== Constants
|
20
|
-
VERSION
|
21
|
-
Returns the current version number for this package as a String.
|
22
|
-
|
23
|
-
== Class Methods
|
24
|
-
CPU.load_avg
|
25
|
-
Returns an array of three floats indicating the 1, 5 and 15 minute load
|
26
|
-
average.
|
27
|
-
|
28
|
-
CPU.cpu_stats
|
29
|
-
Returns a hash, with the cpu number as the key and an array as the value.
|
30
|
-
The array contains the number of seconds that the system spent in
|
31
|
-
user mode, user mode with low priority (nice), system mode, and the
|
32
|
-
idle task, respectively, for that cpu.
|
33
|
-
|
34
|
-
CPU.processors{ |cpu struct| block }
|
35
|
-
Calls the block for each processor on your system, passing a CPUStruct as the
|
36
|
-
parameter.
|
37
|
-
|
38
|
-
The exact members of the CPUStruct are the same as the class method names, except
|
39
|
-
for CPU.processors (although you may optionally omit the "?" when referring to a
|
40
|
-
struct member). These were determined when you installed this package because they
|
41
|
-
vary from one chip architecture to another.
|