reverse 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/lib/reverse.rb +13 -2
- data/lib/reverse/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5f1872d8385946852d5a4c74be1d8d7a083928b
|
4
|
+
data.tar.gz: 2729d94f08e1329d765afc282889573476bae231
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb4157dac44e0223f40fdb5285d5670e37187be258c5e7cee537d6b63746aa13ef52dd52e7c1f554f1a70443f28dc70147f63b772ab412b67bc63cf17cf66070
|
7
|
+
data.tar.gz: 60c2c2d22e3696544892de71d63184e2365051768fc7de8c1b9f5d14e11279bce434e950d72cfd0b9e3157c321eff65ca8ae764ce30fabcd1b4e2d6c3270da9c
|
data/README.md
CHANGED
@@ -10,7 +10,14 @@ reverse DNS lookup CLI for standard output
|
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
13
|
+
```
|
14
|
+
Usage: reverse [options]
|
15
|
+
-V, --verion Show version number and quit
|
16
|
+
-v, --verbose Verbose Mode (IP Address with reverse DNS)
|
17
|
+
--no-color No Color Mode
|
18
|
+
```
|
19
|
+
|
13
20
|
$ cat /var/log/maillog | reverse
|
14
21
|
$ tail -f /var/log/maillog | reverse
|
15
|
-
$ grep Accepted /var/log/secure | reverse
|
22
|
+
$ grep Accepted /var/log/secure | reverse -v
|
16
23
|
|
data/lib/reverse.rb
CHANGED
@@ -16,10 +16,17 @@ class Reverse
|
|
16
16
|
|
17
17
|
def exec(argv)
|
18
18
|
opt = OptionParser.new
|
19
|
-
opt.on('--
|
19
|
+
opt.on('-V', '--verion', 'Show version number and quit') {|v| @options[:verion] = v }
|
20
|
+
opt.on('-v', '--verbose', 'Verbose Mode (IP Address with reverse DNS)') {|v| @options[:verbose] = v }
|
20
21
|
opt.on('--no-color', 'No Color Mode') {|v| @options[:color] = v }
|
21
22
|
opt.parse!(argv)
|
22
23
|
|
24
|
+
if @options[:verion]
|
25
|
+
name = File.basename($PROGRAM_NAME)
|
26
|
+
puts "#{name} #{VERSION}"
|
27
|
+
exit
|
28
|
+
end
|
29
|
+
|
23
30
|
while line = gets
|
24
31
|
output =
|
25
32
|
if line =~ ADDR_REG_EXP
|
@@ -44,7 +51,11 @@ class Reverse
|
|
44
51
|
@list[addr] = name
|
45
52
|
end
|
46
53
|
if @options[:verbose]
|
47
|
-
|
54
|
+
if name == addr
|
55
|
+
str = "unknown[#{addr}]"
|
56
|
+
else
|
57
|
+
str = "#{name}[#{addr}]"
|
58
|
+
end
|
48
59
|
else
|
49
60
|
str = name
|
50
61
|
end
|
data/lib/reverse/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reverse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hitoshi Kurokawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: term-ansicolor
|
@@ -94,3 +94,4 @@ signing_key:
|
|
94
94
|
specification_version: 4
|
95
95
|
summary: reverse DNS lookup CLI for standard output
|
96
96
|
test_files: []
|
97
|
+
has_rdoc:
|