hwid 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hwid/base.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 121de5c69126fcf97f7658e1d2a0afa74700c6ea
|
4
|
+
data.tar.gz: a4675ee583d8becb73ae10c93da23fdb0e51d995
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a2043702247ff470b310226499b8cba764d729e27e34b37651ecada74dbb7144017628c09a7087f8b544ccec728db29b39830046c6dae247ce2d4f17bcaddd8
|
7
|
+
data.tar.gz: 23887b4d78d4927c490d6028705fae4fabe12ed1aa9390f5b092bf9c37ad3921a6cd4dd00707016ce4e4d0afc6d1eff48d55cb98abd62e0c4e702bfb604ad718
|
data/lib/hwid/base.rb
CHANGED
@@ -28,6 +28,8 @@ module Hwid
|
|
28
28
|
platform << "mac" if (/darwin/ =~ RUBY_PLATFORM) != nil
|
29
29
|
platform << "arm" if (/arm/ =~ RUBY_PLATFORM) != nil
|
30
30
|
platform << "x86" if (/x86/ =~ RUBY_PLATFORM) != nil
|
31
|
+
platform << "i686" if (/i686/ =~ RUBY_PLATFORM) != nil
|
32
|
+
platform << "debian" if `uname -a`.include?('Debian')
|
31
33
|
platform << "linux" if (/linux/ =~ RUBY_PLATFORM) != nil
|
32
34
|
platform
|
33
35
|
end
|
@@ -37,6 +39,7 @@ module Hwid
|
|
37
39
|
return get_rasp_id if platform.include?("raspberry")
|
38
40
|
return get_rasp_id if platform.include?("raspberry 2")
|
39
41
|
return get_mac_id if platform.include?("mac")
|
42
|
+
return get_linuxdebian_id if platform.include?("debian") #virtaul box ??
|
40
43
|
return get_linux_id if platform.include?("linux")
|
41
44
|
end
|
42
45
|
def run_cmd(cmd)
|
@@ -56,6 +59,12 @@ module Hwid
|
|
56
59
|
res=run_cmd('/usr/sbin/system_profiler SPHardwareDataType -timeout 0 | grep Serial')
|
57
60
|
self.parse(res)
|
58
61
|
end
|
62
|
+
def get_linuxdebian_id
|
63
|
+
res="Serial: unknown"
|
64
|
+
res=run_cmd('ip addr show | grep link/ether').split[1]
|
65
|
+
puts "debian command result: #{res}"
|
66
|
+
res
|
67
|
+
end
|
59
68
|
def get_linux_id
|
60
69
|
res="Serial: unknown"
|
61
70
|
ifconfig_avail = !(ifconfig_path = `which ifconfig`.strip).empty? && File.executable?(ifconfig_path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hwid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Sproule
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Get a rough hardware id of the system that the gem is running on
|
14
14
|
email: scott.sproule@ficonab.com
|