hwid 0.3.5 → 0.3.6

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 +14 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e14d5b2a5b55c8620bb2794d533748f233327f0d011a96b91fc0f96efb57c9b
4
- data.tar.gz: d602cac4bf9e8109142f78c617a7e3089453f9e686bfc45376733d393b2e25a6
3
+ metadata.gz: df9b22d944cd80752570ecab0e5166e41346de4120ddb27f0bf9a52e9d5e4a43
4
+ data.tar.gz: b37f213684bf33c0c29e0ced30b4c7fd293e287df608f781812667c36d1c45f8
5
5
  SHA512:
6
- metadata.gz: 7b1e76c3c7b0233c815afa593732fb2fe4c6a422d3e4e879e6d8a712a8ddba61cb8693c9f85ea80a872d09d5db5ddca35928a762858c34033d0fb49b51ade482
7
- data.tar.gz: 064d2fc7614ba90648a0840be814d04580e07943bcf2897c30388ad56f0aab38c65180edc89078766dee8337b6dccda0db19dfd0b2be684971e9a9f105a358e6
6
+ metadata.gz: 7cddbba729bbdfe16009db4847f01e897c24ec712666822a7bfe128105d45c090a527a5584001f33287038a9d457bc4356210ce2f1da70b80ffa062961e426e9
7
+ data.tar.gz: 6826a8ae18f63f7431c5ebc82b7bde80698d78139ded1e4179c175e22b1fb81484be59a2e5b62dfff6eea4f5ceb4c79b07f24c8f8bb02df09ae62282159455a3
@@ -40,6 +40,7 @@ module Hwid
40
40
  return get_rasp_id if platform.include?("raspberry")
41
41
  return get_rasp_id if platform.include?("raspberry 2")
42
42
  return get_mac_id if platform.include?("mac")
43
+ return get_windows_id if platform.include?("Microsoft")
43
44
  return get_linuxdebian_id if platform.include?("debian") #virtaul box ??
44
45
  return get_linuxdebian_id if platform.include?("ubuntu") #virtaul box ??
45
46
  return get_linux_id if platform.include?("linux")
@@ -57,6 +58,19 @@ module Hwid
57
58
  res=run_cmd('grep Serial /proc/cpuinfo')
58
59
  self.parse(res)
59
60
  end
61
+ def get_windows_id
62
+ puts "running windows linux sigh"
63
+ res=run_cmd("lshw -quiet -class network -disable usb -disable pci -disable cpuinfo -disable dmi -disable memory -disable isapnp -disable ide -disable device-tree -disable spd | grep -oP '(serial: )\\K.*'")
64
+ res=res.gsub("0000-","")
65
+ res=res.gsum(":","")
66
+ res=res.gsub("\n","")
67
+ #res=run_cmd("lshw | grep -A 10 '*-cpu' | grep -oP '(serial: )\\K.*'")
68
+ #puts "Interim result is #{res.inspect}"
69
+ res=res.chomp
70
+ puts "windows command result: #{res}"
71
+ res
72
+ end
73
+
60
74
  def get_mac_id
61
75
  res=run_cmd('/usr/sbin/system_profiler SPHardwareDataType -timeout 5 | grep Serial')
62
76
  self.parse(res)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hwid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Sproule