hwid 0.4.0 → 0.4.5

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 +8 -5
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 347ac63e9b96d23e4023bf5aadf258d5c80b5a0246361baeae9fea081287602c
4
- data.tar.gz: 8dca11a19ca1ad94776702b3be99f0c78887e87af3f26a667b0368d8d85c087b
3
+ metadata.gz: b384f4c14d3ebd601ab9522c3af3a6c03f69e27950056fa3301afb3b76dc6a7c
4
+ data.tar.gz: fc47de366908605cdf864baa2c271c00cb79b537ab236271f5277586952afa7b
5
5
  SHA512:
6
- metadata.gz: 1124b3a1888b84ecd94cb80b98d192625b3f9bc7d99d3b22bf39eb88e48e618b72e08ab20d6022b07d351a2c6d9627f90ed31764b3b55a04fbe76abcaa50fd13
7
- data.tar.gz: 35fc3b996254f7e2c365bf50121b81da8e6073d26073819515bb0b217cea6653388fbd7769f1e302dbf9ad897bc5856320c10442cd97b38db4fbbcc4b223328d
6
+ metadata.gz: 55c083bbb4e72f07e5a87c49a47e8352b3cf30d699becd0130a33d883f362458616c91e072213c72ebd772b4ee913122065c975e5aaf273c7a469a8bbb5ccc08
7
+ data.tar.gz: 157ed7d5230b5647ad9727317106f6360a9aa942c85238878200c3ba62bac68b50a6f0fabe764ca0c3d764273251c4a73467c7621f7ab66286423d1016010df1
@@ -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,8 @@ module Hwid
22
22
  # returns array of platforms
23
23
  def get_platform
24
24
  platform=[]
25
+ testos=`uname -a`
26
+ # puts "osname is #{testos}"
25
27
  platform << "raspberry" if (/arm-linux/ =~ RUBY_PLATFORM) != nil and `uname -a`.include?('armv6')
26
28
  platform << "raspberry" if `uname -a`.include?('armv6')
27
29
  platform << "raspberry 2" if (/armv7l-linux/ =~ RUBY_PLATFORM) != nil and !`uname -a`.include?('armv6')
@@ -29,15 +31,15 @@ module Hwid
29
31
  platform << "arm" if (/arm/ =~ RUBY_PLATFORM) != nil
30
32
  platform << "x86" if (/x86/ =~ RUBY_PLATFORM) != nil
31
33
  platform << "i686" if (/i686/ =~ RUBY_PLATFORM) != nil
32
- platform << "debian" if `uname -a`.include?('Debian')
33
- platform << "microsoft" if `uname -a`.include?('Microsoft')
34
- platform << "ubuntu" if `uname -a`.include?('Ubuntu')
34
+ platform << "microsoft" if testos.include?('Microsoft')
35
+ platform << "debian" if testos.include?('Debian')
36
+ platform << "ubuntu" if testos.include?('Ubuntu')
35
37
  platform << "linux" if (/linux/ =~ RUBY_PLATFORM) != nil
36
38
  platform
37
39
  end
38
40
  def systemid
39
41
  platform=get_platform
40
- puts "debug: platform is #{platform} #{RUBY_PLATFORM}"
42
+ # puts "debug: platform is #{platform} #{RUBY_PLATFORM}"
41
43
  return get_rasp_id if platform.include?("raspberry")
42
44
  return get_rasp_id if platform.include?("raspberry 2")
43
45
  return get_mac_id if platform.include?("mac")
@@ -63,8 +65,9 @@ module Hwid
63
65
  puts "running windows linux sigh"
64
66
  res=run_cmd("lshw -quiet -class network -disable usb -disable spd | grep -oP '(serial: )\\K.*'")
65
67
  res=res.gsub("0000-","")
66
- res=res.gsum(":","")
68
+ res=res.gsub(":","")
67
69
  res=res.gsub("\n","")
70
+ res=res.gsub(" ","")
68
71
  #res=run_cmd("lshw | grep -A 10 '*-cpu' | grep -oP '(serial: )\\K.*'")
69
72
  #puts "Interim result is #{res.inspect}"
70
73
  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.4.0
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Sproule