hwid 0.3.6 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/hwid.rb +1 -1
  3. data/lib/hwid.rb +1 -1
  4. data/lib/hwid/base.rb +7 -4
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df9b22d944cd80752570ecab0e5166e41346de4120ddb27f0bf9a52e9d5e4a43
4
- data.tar.gz: b37f213684bf33c0c29e0ced30b4c7fd293e287df608f781812667c36d1c45f8
3
+ metadata.gz: c96072e38d1e5e0588ee1e07933040f4a73e8575525d5259c94adac3b37196e0
4
+ data.tar.gz: 912ad6268eb868d51acf35458ee2fcfae60fbfe3515312d798a54fa4f3663ec9
5
5
  SHA512:
6
- metadata.gz: 7cddbba729bbdfe16009db4847f01e897c24ec712666822a7bfe128105d45c090a527a5584001f33287038a9d457bc4356210ce2f1da70b80ffa062961e426e9
7
- data.tar.gz: 6826a8ae18f63f7431c5ebc82b7bde80698d78139ded1e4179c175e22b1fb81484be59a2e5b62dfff6eea4f5ceb4c79b07f24c8f8bb02df09ae62282159455a3
6
+ metadata.gz: 0076ee5b029f906868342c64c9e46163c10afe5dbf811ff3690bbf9fa075becb110a9660c24e2329f045f1b50039007f6eb6a352399b052b29abc7e7e3813ae7
7
+ data.tar.gz: 774f65b97b8031f24d03d3ae395cba55335378fa0ea22006af033c26c6304d2ea8628a7a85b99c49d0bf2692cb263b55b85cb39ba5c0b089a50ac87217f1ba7d
@@ -2,4 +2,4 @@
2
2
  require 'rubygems'
3
3
  require 'hwid'
4
4
  puts 'System id is: ' + Hwid.systemid.to_s
5
- puts "Platform is:" + Hwid.platform.join(',')
5
+ puts "Platform is: " + Hwid.platform.join(',')
@@ -3,5 +3,5 @@ $:.unshift(File.dirname(__FILE__)) unless
3
3
  Dir[File.join(File.dirname(__FILE__), 'hwid/**/*.rb')].sort.each { |lib| require lib }
4
4
 
5
5
  module Hwid
6
- VERSION = '0.0.1'
6
+ VERSION = '0.4.1'
7
7
  end
@@ -22,6 +22,7 @@ module Hwid
22
22
  # returns array of platforms
23
23
  def get_platform
24
24
  platform=[]
25
+ puts "Unname is `uname -a`"
25
26
  platform << "raspberry" if (/arm-linux/ =~ RUBY_PLATFORM) != nil and `uname -a`.include?('armv6')
26
27
  platform << "raspberry" if `uname -a`.include?('armv6')
27
28
  platform << "raspberry 2" if (/armv7l-linux/ =~ RUBY_PLATFORM) != nil and !`uname -a`.include?('armv6')
@@ -29,6 +30,7 @@ module Hwid
29
30
  platform << "arm" if (/arm/ =~ RUBY_PLATFORM) != nil
30
31
  platform << "x86" if (/x86/ =~ RUBY_PLATFORM) != nil
31
32
  platform << "i686" if (/i686/ =~ RUBY_PLATFORM) != nil
33
+ platform << "microsoft" if `uname -a`.include?('Microsoft')
32
34
  platform << "debian" if `uname -a`.include?('Debian')
33
35
  platform << "ubuntu" if `uname -a`.include?('Ubuntu')
34
36
  platform << "linux" if (/linux/ =~ RUBY_PLATFORM) != nil
@@ -36,11 +38,11 @@ module Hwid
36
38
  end
37
39
  def systemid
38
40
  platform=get_platform
39
- # puts "platform is #{platform} #{RUBY_PLATFORM}"
41
+ puts "debug: platform is #{platform} #{RUBY_PLATFORM}"
40
42
  return get_rasp_id if platform.include?("raspberry")
41
43
  return get_rasp_id if platform.include?("raspberry 2")
42
44
  return get_mac_id if platform.include?("mac")
43
- return get_windows_id if platform.include?("Microsoft")
45
+ return get_windows_id if platform.include?("microsoft")
44
46
  return get_linuxdebian_id if platform.include?("debian") #virtaul box ??
45
47
  return get_linuxdebian_id if platform.include?("ubuntu") #virtaul box ??
46
48
  return get_linux_id if platform.include?("linux")
@@ -60,10 +62,11 @@ module Hwid
60
62
  end
61
63
  def get_windows_id
62
64
  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.*'")
65
+ res=run_cmd("lshw -quiet -class network -disable usb -disable spd | grep -oP '(serial: )\\K.*'")
64
66
  res=res.gsub("0000-","")
65
- res=res.gsum(":","")
67
+ res=res.gsub(":","")
66
68
  res=res.gsub("\n","")
69
+ res=res.gsub(" ","")
67
70
  #res=run_cmd("lshw | grep -A 10 '*-cpu' | grep -oP '(serial: )\\K.*'")
68
71
  #puts "Interim result is #{res.inspect}"
69
72
  res=res.chomp
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.6
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Sproule