macker 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/macker.rb +2 -6
- data/lib/macker/version.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: a61388115edde7abbc459f193620b9665e9facfe
|
4
|
+
data.tar.gz: a2d87dca73e3b5002dd615da71ffbdd444912e40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbb1ab031f467e49e877c1cb1d42956b32d80bdced57584b3e1ec3490c7a0ad4525d376a6cecdd67f851846104ffe0f5f05fd08658ac7fb9baf09fe83613b7da
|
7
|
+
data.tar.gz: 2094c183ff2e8feee9940ee058d1d0b4026c8f509bd945c140e92929c66742769a976522196d19a6df1d8cba095a663d41e0e25715fa9071bbae4253f15fafdc
|
data/README.md
CHANGED
@@ -43,11 +43,11 @@ The following configuration is the default configuration of Macker. Store the co
|
|
43
43
|
Rails users can create a file `macker.rb` in `config/initializers` to load the own Macker configuration.
|
44
44
|
|
45
45
|
```ruby
|
46
|
-
|
47
|
-
config.oui_full_url = 'http://linuxnet.ca/ieee/oui.txt'
|
48
|
-
config.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0'
|
49
|
-
config.ttl_in_seconds = 86_400
|
50
|
-
config.cache = File.expand_path(File.dirname(__FILE__) + '/../../data/oui_*.txt')
|
46
|
+
Macker.configure do |config|
|
47
|
+
config.oui_full_url = 'http://linuxnet.ca/ieee/oui.txt' # Full URL of OUI text file
|
48
|
+
config.user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0' # A common user agent
|
49
|
+
config.ttl_in_seconds = 86_400 # Will expire the vendors in one day
|
50
|
+
config.cache = File.expand_path(File.dirname(__FILE__) + '/../../data/oui_*.txt') # Can be a string, pathname or proc
|
51
51
|
config.auto_expiration = true # Expiration can be checked manually
|
52
52
|
end
|
53
53
|
```
|
data/lib/macker.rb
CHANGED
@@ -396,17 +396,13 @@ module Macker
|
|
396
396
|
{ name: base16_fields[-1]
|
397
397
|
.strip
|
398
398
|
.gsub(/\s+/, ' ')
|
399
|
-
.
|
400
|
-
.map(&:capitalize)
|
401
|
-
.join(' '),
|
399
|
+
.sub(/^./, &:upcase),
|
402
400
|
address: address[2..-1].map { |a| a
|
403
401
|
.strip
|
404
402
|
.gsub(/\s+/, ' ')
|
405
403
|
.gsub(/,(?![\s])/, ', ')
|
406
404
|
.gsub(/\,+$/, '')
|
407
|
-
.
|
408
|
-
.map(&:capitalize)
|
409
|
-
.join(' ')
|
405
|
+
.sub(/^./, &:upcase)
|
410
406
|
},
|
411
407
|
iso_code: iso_code.length == 2 ? iso_code.upcase : nil
|
412
408
|
}
|
data/lib/macker/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Egon Zemmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|