hwid 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hwid/base.rb +9 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68c510e39c054d56eeef7b81968d1145db9a9814
4
- data.tar.gz: 452c5882bab9b988e9410407a704bc3712c3e6ba
3
+ metadata.gz: 121de5c69126fcf97f7658e1d2a0afa74700c6ea
4
+ data.tar.gz: a4675ee583d8becb73ae10c93da23fdb0e51d995
5
5
  SHA512:
6
- metadata.gz: 2df5c8ca42443b47920d0191f42fad6200a2ae66198cd219a90e21abd94b311f897da19a573e43266eb4d1a27dffa5216148d70373cd13a4491a1ab8ab5071cd
7
- data.tar.gz: 0df4c3ceb190a6994cb140aed7ffe0ecd670928a6db11963d1cd0a1b91d9b39f295330aac91afb9475750dd07b5adc08872e2f8b7967461c78d5025745423f04
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.0
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: 2015-11-16 00:00:00.000000000 Z
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