hwid 0.3.3 → 0.4.0
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 +16 -1
- metadata +1 -6
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -32
- data/README.md +0 -19
- data/hwid-0.3.2.gem +0 -0
- data/hwid.gemspec +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 347ac63e9b96d23e4023bf5aadf258d5c80b5a0246361baeae9fea081287602c
|
4
|
+
data.tar.gz: 8dca11a19ca1ad94776702b3be99f0c78887e87af3f26a667b0368d8d85c087b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1124b3a1888b84ecd94cb80b98d192625b3f9bc7d99d3b22bf39eb88e48e618b72e08ab20d6022b07d351a2c6d9627f90ed31764b3b55a04fbe76abcaa50fd13
|
7
|
+
data.tar.gz: 35fc3b996254f7e2c365bf50121b81da8e6073d26073819515bb0b217cea6653388fbd7769f1e302dbf9ad897bc5856320c10442cd97b38db4fbbcc4b223328d
|
data/lib/hwid/base.rb
CHANGED
@@ -30,16 +30,18 @@ module Hwid
|
|
30
30
|
platform << "x86" if (/x86/ =~ RUBY_PLATFORM) != nil
|
31
31
|
platform << "i686" if (/i686/ =~ RUBY_PLATFORM) != nil
|
32
32
|
platform << "debian" if `uname -a`.include?('Debian')
|
33
|
+
platform << "microsoft" if `uname -a`.include?('Microsoft')
|
33
34
|
platform << "ubuntu" if `uname -a`.include?('Ubuntu')
|
34
35
|
platform << "linux" if (/linux/ =~ RUBY_PLATFORM) != nil
|
35
36
|
platform
|
36
37
|
end
|
37
38
|
def systemid
|
38
39
|
platform=get_platform
|
39
|
-
|
40
|
+
puts "debug: platform is #{platform} #{RUBY_PLATFORM}"
|
40
41
|
return get_rasp_id if platform.include?("raspberry")
|
41
42
|
return get_rasp_id if platform.include?("raspberry 2")
|
42
43
|
return get_mac_id if platform.include?("mac")
|
44
|
+
return get_windows_id if platform.include?("microsoft")
|
43
45
|
return get_linuxdebian_id if platform.include?("debian") #virtaul box ??
|
44
46
|
return get_linuxdebian_id if platform.include?("ubuntu") #virtaul box ??
|
45
47
|
return get_linux_id if platform.include?("linux")
|
@@ -57,6 +59,19 @@ module Hwid
|
|
57
59
|
res=run_cmd('grep Serial /proc/cpuinfo')
|
58
60
|
self.parse(res)
|
59
61
|
end
|
62
|
+
def get_windows_id
|
63
|
+
puts "running windows linux sigh"
|
64
|
+
res=run_cmd("lshw -quiet -class network -disable usb -disable spd | grep -oP '(serial: )\\K.*'")
|
65
|
+
res=res.gsub("0000-","")
|
66
|
+
res=res.gsum(":","")
|
67
|
+
res=res.gsub("\n","")
|
68
|
+
#res=run_cmd("lshw | grep -A 10 '*-cpu' | grep -oP '(serial: )\\K.*'")
|
69
|
+
#puts "Interim result is #{res.inspect}"
|
70
|
+
res=res.chomp
|
71
|
+
puts "windows command result: #{res}"
|
72
|
+
res
|
73
|
+
end
|
74
|
+
|
60
75
|
def get_mac_id
|
61
76
|
res=run_cmd('/usr/sbin/system_profiler SPHardwareDataType -timeout 5 | grep Serial')
|
62
77
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Sproule
|
@@ -17,12 +17,7 @@ executables:
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- Gemfile
|
21
|
-
- Gemfile.lock
|
22
|
-
- README.md
|
23
20
|
- bin/hwid.rb
|
24
|
-
- hwid-0.3.2.gem
|
25
|
-
- hwid.gemspec
|
26
21
|
- lib/hwid.rb
|
27
22
|
- lib/hwid/base.rb
|
28
23
|
- test/coverage/assets/0.7.1/application.css
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
hwid (0.3.2)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
codeclimate-test-reporter (1.0.9)
|
10
|
-
simplecov (<= 0.13)
|
11
|
-
docile (1.1.5)
|
12
|
-
json (2.3.1)
|
13
|
-
minitest (5.14.1)
|
14
|
-
simplecov (0.13.0)
|
15
|
-
docile (~> 1.1.0)
|
16
|
-
json (>= 1.8, < 3)
|
17
|
-
simplecov-html (~> 0.10.0)
|
18
|
-
simplecov-html (0.10.2)
|
19
|
-
|
20
|
-
PLATFORMS
|
21
|
-
ruby
|
22
|
-
|
23
|
-
DEPENDENCIES
|
24
|
-
codeclimate-test-reporter
|
25
|
-
hwid!
|
26
|
-
minitest
|
27
|
-
|
28
|
-
RUBY VERSION
|
29
|
-
ruby 2.6.6p146
|
30
|
-
|
31
|
-
BUNDLED WITH
|
32
|
-
1.17.3
|
data/README.md
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/semdinsp/hwid.svg?branch=master)](https://travis-ci.org/semdinsp/hwid)[![Code Climate](https://codeclimate.com/github/semdinsp/hwid/badges/gpa.svg)](https://codeclimate.com/github/semdinsp/hwid)
|
2
|
-
[![Gem Version](https://badge.fury.io/rb/hwid.png)](http://badge.fury.io/rb/hwid)
|
3
|
-
|
4
|
-
hwid gem
|
5
|
-
============
|
6
|
-
|
7
|
-
return the hardware id of the system the gem is running on.
|
8
|
-
|
9
|
-
Simple hwid id
|
10
|
-
=====================
|
11
|
-
THis is not secure but gives a simple way to identify the hardware from a particular client application.
|
12
|
-
|
13
|
-
It is a bit slow so perhaps only call it upon startup
|
14
|
-
|
15
|
-
Usage
|
16
|
-
=======
|
17
|
-
|
18
|
-
Hwid.systemid
|
19
|
-
|
data/hwid-0.3.2.gem
DELETED
Binary file
|
data/hwid.gemspec
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = "hwid"
|
3
|
-
s.version = "0.3.3"
|
4
|
-
s.author = "Scott Sproule"
|
5
|
-
s.email = "scott.sproule@ficonab.com"
|
6
|
-
s.homepage = "http://github.com/semdinsp/hwid"
|
7
|
-
s.summary = "Hardware id for mac and rasp pi (not secure)"
|
8
|
-
s.description = "Get a rough hardware id of the system that the gem is running on"
|
9
|
-
s.executables = ['hwid.rb'] #should be "name.rb"
|
10
|
-
s.files = Dir["{lib,test}/**/*"] +Dir["bin/*.rb"] + Dir["[A-Z]*"] # + ["init.rb"]
|
11
|
-
s.require_path = "lib"
|
12
|
-
s.license = 'MIT'
|
13
|
-
s.required_rubygems_version = ">= 1.3.4"
|
14
|
-
end
|