ouidb 0.1.0 → 0.1.1

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: 2d8483b8f0d8e9a3a38ade8f58043c782a5b1914
4
- data.tar.gz: 16b3d905fdd850f306667a503f017e5a70ffeffc
3
+ metadata.gz: f862cfcd7814f5aa7843d1b7e7668d4f61928255
4
+ data.tar.gz: 719c588545531ce804ab76355841d2dfe435f1ff
5
5
  SHA512:
6
- metadata.gz: aa3cb666d2269e7e99d0ef6e25e692a82bbac9b997731351c9fd6bd8098db47482171f5086672fbe309fea50d7eadcf58f1a9501ac14c7a2c7dd484155eb9f61
7
- data.tar.gz: 64f33a77000667a1c7bcdcffe4445bfcdc881b14fa8eadec24c1d4b982cca1bdb0a8edd8e544761070270c07cfd3edd397d74b152fc99cb9d15036bcb318ec84
6
+ metadata.gz: bcc28ef865f32ff78084b8766bb14769f5ebdef92c4d8187810c18924595d2e6132c4526e66fb773795fe96f80794a98113d322273fcd280f4143af895b93efe
7
+ data.tar.gz: 93698d22b89d6666abb9ebdc32f13c653ef51e5ab24697895268cf0d40a80ffbf427087d80686dcb661853fdc45b6f64b9a1195606ee825b94d12c12db3b6ff8
data/README.md CHANGED
@@ -20,14 +20,18 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- To make yourself a data file:
23
+ Make yourself a data file:
24
24
 
25
25
  { curl http://standards-oui.ieee.org/oui.txt && \
26
26
  curl http://standards-oui.ieee.org/iab/iab.txt && \
27
- curl http://standards-oui.ieee.org/oui36/oui36.txt } | \
28
- ouidb_generator > my_data_file.json
27
+ curl http://standards-oui.ieee.org/oui36/oui36.txt; } | \
28
+ ouidb > my_data_file.json
29
29
 
30
- And you're good to go.
30
+ And you're good to go. Test it on your local MACs:
31
+
32
+ ifconfig | grep -Eoe '[0-9a-f]{2}(:[0-9a-f]{2}){5}' | sort -u | ouidb my_data_file.json
33
+
34
+ The Ruby interface is quite simple:
31
35
 
32
36
  ```ruby
33
37
  require 'ouidb'
data/exe/ouidb ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'ouidb'
4
+
5
+ DOC = <<-EOF
6
+ Usage:
7
+
8
+ #{$0} DATA_FILE MAC_ADDRESS Show manufacturer for a MAC address
9
+ #{$0} DATA_FILE Print manufacturers of each MAC given through STDIN
10
+ #{$0} Read oui.txt from STDIN and write data file to STDOUT
11
+ EOF
12
+
13
+ case ARGV.first
14
+ when nil
15
+ if STDIN.isatty
16
+ puts DOC
17
+ else
18
+ require 'ouidb/importer'
19
+ Ouidb::Importer.read STDIN
20
+ puts Ouidb::Manufacturer.to_json
21
+ end
22
+ else
23
+ Ouidb.load_file ARGV[0]
24
+ if (mac = ARGV[1])
25
+ if (name = Ouidb.manufacturer_name(mac))
26
+ puts name
27
+ else
28
+ exit 1
29
+ end
30
+ else
31
+ while (str = STDIN.gets)
32
+ str.strip!
33
+ puts "#{str} #{Ouidb.manufacturer_name(str) || '?'}"
34
+ end
35
+ end
36
+ end
data/lib/ouidb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ouidb
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ouidb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil E. Pearson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-13 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,7 +56,7 @@ description: Database of Organizationally Unique Identifiers
56
56
  email:
57
57
  - neil@pearson.sydney
58
58
  executables:
59
- - ouidb_generator
59
+ - ouidb
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
@@ -72,7 +72,7 @@ files:
72
72
  - bin/console
73
73
  - bin/makedb.rb
74
74
  - bin/setup
75
- - exe/ouidb_generator
75
+ - exe/ouidb
76
76
  - lib/data
77
77
  - lib/ouidb.rb
78
78
  - lib/ouidb/importer.rb
data/exe/ouidb_generator DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'ouidb'
4
- require 'ouidb/importer'
5
-
6
- Ouidb::Importer.read STDIN
7
- puts Ouidb::Manufacturer.to_json