reverse 0.0.2 → 0.0.3

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: d4aaeca93b8dc60ada1a354e9f859d663b0f4068
4
- data.tar.gz: c9c63f5ee17c81b752219ba0907449349a15ac7e
3
+ metadata.gz: 6a7b405c1ebc765561b3bd4f01db0de451ee0370
4
+ data.tar.gz: 7d9d88193d049558b5084cfb7e3255734c8b6e55
5
5
  SHA512:
6
- metadata.gz: 450c244f6da36ef92f6fb66b67f0b6cd8b008b6c400982d6ad1adf9cd5eabbdad0b3aef82858285788e068ebfaeccb898c2d536776b8742d0648fba3dd8d7023
7
- data.tar.gz: bcb8f3a9c5df489402309699e6ed0600d8aca911bfbcc8b4571b3b185b5ae0f7617e4b08a00f52cd673ecce2ae0295a2756928dabe06de2dc24bee7d4c53f2e1
6
+ metadata.gz: 9a609f2b57f51601b91a175aedac2cb965fdce2aef803275a1b24100536272eeb9f36ddcd3e8e8adcff5cbc3d10c6de8a3b8a0aeb82e9dec7c83e342cd0b52d3
7
+ data.tar.gz: 99caa700335411e58ad14a008eeac55c529ea69e8f669c284559557ef1e0dd3205b3141cc1514b6e89bf688344cc4a5e4ecd8c9b1718ae25f81b12bda407d50f
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
+ [![Gem Version](https://badge.fury.io/rb/reverse.png)](http://badge.fury.io/rb/reverse)
2
+
1
3
  # Reverse
2
4
 
3
- reverse DNS lookup CLU for standard output
5
+ reverse DNS lookup CLI for standard output
4
6
 
5
7
  ## Installation
6
8
 
@@ -8,13 +10,7 @@ reverse DNS lookup CLU for standard output
8
10
 
9
11
  ## Usage
10
12
 
13
+ $ cat /var/log/maillog | reverse
11
14
  $ tail -f /var/log/maillog | reverse
12
15
  $ grep Accepted /var/log/secure | reverse
13
16
 
14
- ## Contributing
15
-
16
- 1. Fork it
17
- 2. Create your feature branch (`git checkout -b my-new-feature`)
18
- 3. Commit your changes (`git commit -am 'Add some feature'`)
19
- 4. Push to the branch (`git push origin my-new-feature`)
20
- 5. Create new Pull Request
@@ -1,6 +1,6 @@
1
1
  require "reverse/version"
2
-
3
- require 'socket'
2
+ require "socket"
3
+ require "term/ansicolor"
4
4
 
5
5
  class Reverse
6
6
  ADDR_REG_EXP = /\b((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))\b/
@@ -25,6 +25,7 @@ class Reverse
25
25
  private
26
26
 
27
27
  def replace_addr(line)
28
+ color = Term::ANSIColor
28
29
  line.gsub(ADDR_REG_EXP) do |addr|
29
30
  name = nil
30
31
  if @list[addr]
@@ -33,16 +34,13 @@ class Reverse
33
34
  name = get_name(addr)
34
35
  @list[addr] = name
35
36
  end
36
- name
37
+ color.green + name + color.clear
37
38
  end
38
39
  end
39
40
 
40
41
  def get_name(addr)
41
- info = Socket.getnameinfo(Socket.sockaddr_in('80', addr))
42
+ info = Socket.getnameinfo(Socket.sockaddr_in("80", addr))
42
43
  info[0]
43
44
  end
44
45
 
45
46
  end
46
-
47
-
48
-
@@ -1,3 +1,3 @@
1
1
  class Reverse
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Reverse::VERSION
9
9
  spec.authors = ["Hitoshi Kurokawa"]
10
10
  spec.email = ["hitoshi@nextseed.jp"]
11
- spec.description = %q{reverse DNS lookup CLU for standard output}
12
- spec.summary = %q{reverse DNS lookup CLU for standard output}
11
+ spec.description = %q{reverse DNS lookup CLI for standard output}
12
+ spec.summary = %q{reverse DNS lookup CLI for standard output}
13
13
  spec.homepage = "https://github.com/krhitoshi/reverse"
14
14
  spec.license = "MIT"
15
15
 
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_dependency "term-ansicolor"
22
+
21
23
  spec.add_development_dependency "bundler", "~> 1.3"
22
24
  spec.add_development_dependency "rake"
23
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reverse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hitoshi Kurokawa
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: term-ansicolor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,7 +52,7 @@ dependencies:
38
52
  - - ">="
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
- description: reverse DNS lookup CLU for standard output
55
+ description: reverse DNS lookup CLI for standard output
42
56
  email:
43
57
  - hitoshi@nextseed.jp
44
58
  executables:
@@ -78,5 +92,5 @@ rubyforge_project:
78
92
  rubygems_version: 2.2.0
79
93
  signing_key:
80
94
  specification_version: 4
81
- summary: reverse DNS lookup CLU for standard output
95
+ summary: reverse DNS lookup CLI for standard output
82
96
  test_files: []