LinuxSystemInfo 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -8
- data/lib/LinuxSystemInfo/version.rb +1 -1
- data/lib/LinuxSystemInfo.rb +8 -2
- data/spec/audio_spec.rb +17 -0
- data/spec/video_spec.rb +17 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 748a4f845568bf41239a32eabb16f35994c760f9
|
4
|
+
data.tar.gz: 3d58731f3f371626a18bed8c459554a86a6ff1c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59cb62005a4b49aefe6a56354bee43f871ff86defd0abba30df2799cd561b773732dc7d1b1ac11b0059e2d3b509563a98563c2e7f8b1fa74d8e554ef7a5b6cd6
|
7
|
+
data.tar.gz: 21195531b50a2a75a26282b853bc82cb91c983381d8bcf9d8dd297d76ef89c54fead3e9784eb04487b771fb5196911e9027255f6b152dd9637c0d446b0796dac
|
data/README.md
CHANGED
@@ -47,8 +47,8 @@ LinuxSystemInfo.info
|
|
47
47
|
|
48
48
|
```ruby
|
49
49
|
{
|
50
|
-
:os=>"Linux version 3.13.0-45-generic (buildd@phianna) ...",
|
51
|
-
:uptime=>"up 5 hours, 57 minutes",
|
50
|
+
:os=>"Linux version 3.13.0-45-generic (buildd@phianna) ...",
|
51
|
+
:uptime=>"up 5 hours, 57 minutes",
|
52
52
|
:users=>"8"
|
53
53
|
}
|
54
54
|
```
|
@@ -159,10 +159,11 @@ LinuxSystemInfo.connection
|
|
159
159
|
|
160
160
|
LinuxSystemInfo.video
|
161
161
|
|
162
|
+
```ruby
|
163
|
+
[
|
164
|
+
"Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)"
|
165
|
+
]
|
162
166
|
```
|
163
|
-
"Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)"
|
164
|
-
```
|
165
|
-
|
166
167
|
#### Audio
|
167
168
|
|
168
169
|
LinuxSystemInfo.audio
|
@@ -210,10 +211,10 @@ LinuxSystemInfo.to_hash
|
|
210
211
|
|
211
212
|
```ruby
|
212
213
|
{
|
213
|
-
:info =>
|
214
|
+
:info =>
|
214
215
|
{
|
215
|
-
:os => "Linux version 3.13.0-45-generic (buildd@phianna) ...",
|
216
|
-
:uptime => "up 5 hours, 57 minutes",
|
216
|
+
:os => "Linux version 3.13.0-45-generic (buildd@phianna) ...",
|
217
|
+
:uptime => "up 5 hours, 57 minutes",
|
217
218
|
:users => "8"
|
218
219
|
},
|
219
220
|
:hostname => "example.com",
|
data/lib/LinuxSystemInfo.rb
CHANGED
@@ -95,9 +95,15 @@ module LinuxSystemInfo
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def video
|
98
|
+
data = Array.new
|
98
99
|
video = `lspci`
|
99
|
-
|
100
|
-
video.split(
|
100
|
+
# Graphics Controller
|
101
|
+
videos = video.split("\n").grep /(VGA|Graphics Controller)/
|
102
|
+
videos.each do |video|
|
103
|
+
video = video.split(':')
|
104
|
+
data.push video[2].strip
|
105
|
+
end
|
106
|
+
data
|
101
107
|
end
|
102
108
|
|
103
109
|
def audio
|
data/spec/audio_spec.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'With audio info' do
|
4
|
+
before(:all) do
|
5
|
+
@audio = LinuxSystemInfo.audio
|
6
|
+
end
|
7
|
+
|
8
|
+
describe 'the returned value' do
|
9
|
+
it 'will have hard drives' do
|
10
|
+
expect(@audio.size).to be >= 1
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'will detect correct device' do
|
14
|
+
expect(@audio.first).to match /(Audio)/
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/spec/video_spec.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'With video info' do
|
4
|
+
before(:all) do
|
5
|
+
@video = LinuxSystemInfo.video
|
6
|
+
end
|
7
|
+
|
8
|
+
describe 'the returned value' do
|
9
|
+
it 'will have hard drives' do
|
10
|
+
expect(@video.size).to be >= 1
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'will detect correct device' do
|
14
|
+
expect(@video.first).to match /(VGA|Graphics Controller)/
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: LinuxSystemInfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saimon Lovell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- Rakefile
|
85
85
|
- lib/LinuxSystemInfo.rb
|
86
86
|
- lib/LinuxSystemInfo/version.rb
|
87
|
+
- spec/audio_spec.rb
|
87
88
|
- spec/connection_spec.rb
|
88
89
|
- spec/cpu_spec.rb
|
89
90
|
- spec/info_spec.rb
|
@@ -92,6 +93,7 @@ files:
|
|
92
93
|
- spec/spec_helper.rb
|
93
94
|
- spec/storage_spec.rb
|
94
95
|
- spec/usb_spec.rb
|
96
|
+
- spec/video_spec.rb
|
95
97
|
- tasks/rspec.rake
|
96
98
|
homepage: https://github.com/SaimonL/linux-system-info
|
97
99
|
licenses:
|
@@ -118,6 +120,7 @@ signing_key:
|
|
118
120
|
specification_version: 4
|
119
121
|
summary: Get local linux hardware information.
|
120
122
|
test_files:
|
123
|
+
- spec/audio_spec.rb
|
121
124
|
- spec/connection_spec.rb
|
122
125
|
- spec/cpu_spec.rb
|
123
126
|
- spec/info_spec.rb
|
@@ -126,3 +129,4 @@ test_files:
|
|
126
129
|
- spec/spec_helper.rb
|
127
130
|
- spec/storage_spec.rb
|
128
131
|
- spec/usb_spec.rb
|
132
|
+
- spec/video_spec.rb
|