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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14d7f984c1a7fa0f2807e9b1f3b45af10ab15abe
4
- data.tar.gz: cdba3d06468a7e4535584035b5dde09643b30045
3
+ metadata.gz: 68c510e39c054d56eeef7b81968d1145db9a9814
4
+ data.tar.gz: 452c5882bab9b988e9410407a704bc3712c3e6ba
5
5
  SHA512:
6
- metadata.gz: 87f3023b75c0447af9ec827ba10480a34ee49362585c581bcbd6c897dc147d7f2994d633cc85d72cce6be77ea34cb05ebbea196fcac9fc263595c4a5df3ccac2
7
- data.tar.gz: fb6d2eb2c364a6005e5f21f7c5f17d68ae8637a39d5fd2f4a9a50a6a293cd7d6b8141074194e32c038ff87ea06e22d32f284a812244c093865f6a7b55fbbe1dd
6
+ metadata.gz: 2df5c8ca42443b47920d0191f42fad6200a2ae66198cd219a90e21abd94b311f897da19a573e43266eb4d1a27dffa5216148d70373cd13a4491a1ab8ab5071cd
7
+ data.tar.gz: 0df4c3ceb190a6994cb140aed7ffe0ecd670928a6db11963d1cd0a1b91d9b39f295330aac91afb9475750dd07b5adc08872e2f8b7967461c78d5025745423f04
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hwid (0.1.8)
4
+ hwid (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'rubygems'
3
3
  require 'hwid'
4
- puts 'System id is: ' + Hwid.systemid
4
+ puts 'System id is: ' + Hwid.systemid
5
+ puts "Platform is:" + Hwid.platform.join(',')
@@ -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 2" if (/armv7l-linux/ =~ RUBY_PLATFORM) != nil
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")
@@ -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:52:40+08:00">2015-11-07T10:52:40+08:00</abbr></div>
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">
@@ -25,7 +25,7 @@ class HwidTest < Minitest::Test
25
25
  end
26
26
  def test_class
27
27
  assert Hwid.systemid!='unknown', "return id is #{Hwid.systemid}"
28
-
28
+ assert Hwid.platform!='unknown', "return id is #{Hwid.platform}"
29
29
  end
30
30
  def test_run_cmd
31
31
  d =@f.run_cmd('date')
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.1.8
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-07 00:00:00.000000000 Z
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