hwid 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/hwid.rb +2 -1
- data/lib/hwid/base.rb +7 -3
- data/test/coverage/index.html +1 -1
- data/test/test_hwid.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68c510e39c054d56eeef7b81968d1145db9a9814
|
4
|
+
data.tar.gz: 452c5882bab9b988e9410407a704bc3712c3e6ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2df5c8ca42443b47920d0191f42fad6200a2ae66198cd219a90e21abd94b311f897da19a573e43266eb4d1a27dffa5216148d70373cd13a4491a1ab8ab5071cd
|
7
|
+
data.tar.gz: 0df4c3ceb190a6994cb140aed7ffe0ecd670928a6db11963d1cd0a1b91d9b39f295330aac91afb9475750dd07b5adc08872e2f8b7967461c78d5025745423f04
|
data/Gemfile.lock
CHANGED
data/bin/hwid.rb
CHANGED
data/lib/hwid/base.rb
CHANGED
@@ -4,6 +4,9 @@ module Hwid
|
|
4
4
|
def self.systemid
|
5
5
|
Hwid::Base.new.systemid
|
6
6
|
end
|
7
|
+
def self.platform
|
8
|
+
Hwid::Base.new.get_platform
|
9
|
+
end
|
7
10
|
class Base
|
8
11
|
attr_accessor :systemid
|
9
12
|
|
@@ -19,8 +22,9 @@ module Hwid
|
|
19
22
|
# returns array of platforms
|
20
23
|
def get_platform
|
21
24
|
platform=[]
|
22
|
-
platform << "raspberry" if (/arm-linux/ =~ RUBY_PLATFORM) != nil
|
23
|
-
platform << "raspberry
|
25
|
+
platform << "raspberry" if (/arm-linux/ =~ RUBY_PLATFORM) != nil and `uname -a`.include?('armv6')
|
26
|
+
platform << "raspberry" if `uname -a`.include?('armv6')
|
27
|
+
platform << "raspberry 2" if (/armv7l-linux/ =~ RUBY_PLATFORM) != nil and !`uname -a`.include?('armv6')
|
24
28
|
platform << "mac" if (/darwin/ =~ RUBY_PLATFORM) != nil
|
25
29
|
platform << "arm" if (/arm/ =~ RUBY_PLATFORM) != nil
|
26
30
|
platform << "x86" if (/x86/ =~ RUBY_PLATFORM) != nil
|
@@ -29,7 +33,7 @@ module Hwid
|
|
29
33
|
end
|
30
34
|
def systemid
|
31
35
|
platform=get_platform
|
32
|
-
puts "platform is #{platform} #{RUBY_PLATFORM}"
|
36
|
+
# puts "platform is #{platform} #{RUBY_PLATFORM}"
|
33
37
|
return get_rasp_id if platform.include?("raspberry")
|
34
38
|
return get_rasp_id if platform.include?("raspberry 2")
|
35
39
|
return get_mac_id if platform.include?("mac")
|
data/test/coverage/index.html
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
<img src="./assets/0.8.0/loading.gif" alt="loading"/>
|
15
15
|
</div>
|
16
16
|
<div id="wrapper" style="display:none;">
|
17
|
-
<div class="timestamp">Generated <abbr class="timeago" title="2015-11-07T10:
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2015-11-07T10:56:15+08:00">2015-11-07T10:56:15+08:00</abbr></div>
|
18
18
|
<ul class="group_tabs"></ul>
|
19
19
|
|
20
20
|
<div id="content">
|
data/test/test_hwid.rb
CHANGED
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.
|
4
|
+
version: 0.2.0
|
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-
|
11
|
+
date: 2015-11-16 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
|