mac_vendor 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad5ec035ebc7603fd75a3e98bc88ab7ef03bac6b
4
- data.tar.gz: a6eb4325ac8dfdf074ef34a42caf6215eae20c1f
3
+ metadata.gz: 2f6334232b940a1ed682a84c45f6e9d18a80226e
4
+ data.tar.gz: b241199483f6f9e9f191bc0c6db7ac9a8ac73766
5
5
  SHA512:
6
- metadata.gz: 0a9256f05e97f9b6ba8c0de5e5296aaa22beaa878ba71399b270016e3af2ad90baaf9fde6713bad549ee4b39fa5dbbbe797c05c83fc3295a97a84a12e3b9fee3
7
- data.tar.gz: 819ad6f99441e7dc9e8a184c4271400e0a16f510f4e20e291b22febcd20ca9fd81283ef9b4d0fe24df9d88200c4197d375c950923eeb8cb279dcd6a855c7dee1
6
+ metadata.gz: 7cbaa7ce6fb5738812a34c90b37e5438287ab779c0ef1427af2e1c7aa47c84784e8c2bf3c80ed2681426a104b6560325fd58d2b6eba8018118849203dc26228d
7
+ data.tar.gz: 7125781e97d6b965403a7a8e8632fcf5366bb78989e791eac16a0a22181041ff69d482b138c35f9a3fd9bbd32ab6fe35796fe0bc70b3e028596969ea8a1b447d
data/data/oui.txt.gz CHANGED
Binary file
data/lib/mac_vendor.rb CHANGED
@@ -43,7 +43,7 @@ class MacVendor
43
43
  mac_prefix = normalize_prefix $1
44
44
  lines = $2.strip.split("\t")
45
45
  company_name = lines[0]
46
- company_address = lines[1..-2].reject {|x| x == ''}
46
+ company_address = lines[1..-2].reject {|x| x.strip == ''}
47
47
 
48
48
  return @prefix_cache[prefix] = {:name => company_name, :address => company_address}
49
49
  end
@@ -56,9 +56,9 @@ class MacVendor
56
56
 
57
57
  entries[1..-1].each do |entry|
58
58
  base16_fields = entry.strip.split("\n")[1].split("\t")
59
- mac_prefix = base16_fields[0][0..5]
59
+ mac_prefix = base16_fields[0].strip[0..5]
60
60
  company_name = base16_fields[-1]
61
- company_address = entry.strip.gsub("\t",'').split("\n")[2..-1]
61
+ company_address = entry.strip.gsub("\t",'').split("\n")[2..-1].map {|x| x.strip}
62
62
 
63
63
  # This actually happens three times in the current dataset!
64
64
  unless @prefix_cache[mac_prefix].nil?
data/mac_vendor.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mac_vendor'
3
- s.version = '0.0.1'
4
- s.date = '2013-08-28'
3
+ s.version = '0.0.2'
4
+ s.date = '2013-11-12'
5
5
  s.license = "MIT"
6
6
  s.summary = "MAC address vendor lookup"
7
7
  s.description = "Given a MAC address, lookup the vendor of the interface."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mac_vendor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Wiegley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-28 00:00:00.000000000 Z
11
+ date: 2013-11-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Given a MAC address, lookup the vendor of the interface.
14
14
  email: doug@uceem.com
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  requirements: []
48
48
  rubyforge_project:
49
- rubygems_version: 2.0.6
49
+ rubygems_version: 2.0.7
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: MAC address vendor lookup