rtrace 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +2 -2
  3. data/lib/rtrace.rb +9 -14
  4. data/lib/rtrace/version.rb +1 -1
  5. metadata +12 -15
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8ccf2bbb9261dc95ae216210b3122efd250b7cee
4
+ data.tar.gz: c6453d7dd42782919c792add0ea00634a389d17f
5
+ SHA512:
6
+ metadata.gz: 86c006136a798f3019112b30405cbc79cbe78cf4df10337ebce43b6fcac171d65e46442dbf7c1b5022b7a3f6997f11fdf803b84b3451004de414f5d0a415b802
7
+ data.tar.gz: a74e00e11c1436f4e0feed4768c72cec9004743f78fd1a5ed06de82ac5e86fbe7aebb5d995a816a39cb976322051297db91a0fd98cf023314632e4b0c7bff3b7
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Christoph
1
+ Copyright (c) 2012 Christoph Koehler
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -23,8 +23,8 @@ module Rtrace
23
23
  port = 33434
24
24
 
25
25
  @send_socket = Socket.new(:INET, :DGRAM)
26
- @dest_addr = Socket.sockaddr_in(port, options[:host])
27
- @dest_ip = IPSocket::getaddress(options[:host])
26
+ @dest_addr = Socket.sockaddr_in(port, options[:host])
27
+ @dest_ip = IPSocket::getaddress(options[:host])
28
28
  puts "Traceroute for \"#{options[:host]}\" ( #{@dest_ip} ) ..."
29
29
  puts
30
30
 
@@ -36,6 +36,7 @@ module Rtrace
36
36
  end
37
37
  @recv_addr = Socket.sockaddr_in(port, "")
38
38
  @recv_socket.bind(@recv_addr)
39
+
39
40
  self.run_loop
40
41
  end
41
42
 
@@ -47,10 +48,7 @@ module Rtrace
47
48
  t1 = Time.now
48
49
  @send_socket.send("", 0, @dest_addr)
49
50
 
50
-
51
-
52
-
53
- data = ""
51
+ data = []
54
52
  begin
55
53
  timeout(@options[:timeout]) do
56
54
  data = @recv_socket.recvfrom( 512 )[1]
@@ -61,13 +59,10 @@ module Rtrace
61
59
  next
62
60
  end
63
61
 
64
-
65
-
66
-
67
62
  time = ((Time.now - t1)*1000).round 1
68
63
  time = time.to_s+" ms"
69
- ip = data.ip_address
70
- loc = Geocoder.search(ip).first
64
+ ip = data.ip_address
65
+ loc = Geocoder.search(ip).first
71
66
 
72
67
  if loc.city.empty?
73
68
  place = ""
@@ -82,9 +77,9 @@ module Rtrace
82
77
  end
83
78
 
84
79
  s_ttl = ttl.to_s.ljust(5)
85
- name = name.ljust(45)
86
- s_ip = ip.ljust(20)
87
- time = time.ljust(15)
80
+ name = name.ljust(45)
81
+ s_ip = ip.ljust(20)
82
+ time = time.ljust(15)
88
83
  place = place.ljust(25)
89
84
 
90
85
  puts s_ttl+name+s_ip+time+place
@@ -1,3 +1,3 @@
1
1
  module Rtrace
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,34 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Christoph Koehler
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-07-06 00:00:00.000000000 Z
11
+ date: 2014-01-17 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: geocoder
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
- description: ! "Subset of traceroute functionality with added geocoded\n location
31
- based on IP. Uses the geocoder gem. Only tested on OSX."
27
+ description: |-
28
+ Subset of traceroute functionality with added geocoded
29
+ location based on IP. Uses the geocoder gem. Only tested on OSX.
32
30
  email:
33
31
  - christoph@zerodeviation.net
34
32
  executables:
@@ -47,26 +45,25 @@ files:
47
45
  - rtrace.gemspec
48
46
  homepage: http://rubygems.org/gems/rtrace
49
47
  licenses: []
48
+ metadata: {}
50
49
  post_install_message:
51
50
  rdoc_options: []
52
51
  require_paths:
53
52
  - lib
54
53
  required_ruby_version: !ruby/object:Gem::Requirement
55
- none: false
56
54
  requirements:
57
- - - ! '>='
55
+ - - '>='
58
56
  - !ruby/object:Gem::Version
59
57
  version: '0'
60
58
  required_rubygems_version: !ruby/object:Gem::Requirement
61
- none: false
62
59
  requirements:
63
- - - ! '>='
60
+ - - '>='
64
61
  - !ruby/object:Gem::Version
65
62
  version: '0'
66
63
  requirements: []
67
64
  rubyforge_project:
68
- rubygems_version: 1.8.24
65
+ rubygems_version: 2.1.9
69
66
  signing_key:
70
- specification_version: 3
67
+ specification_version: 4
71
68
  summary: traceroute in Ruby with geocoding. Tested on OSX only.
72
69
  test_files: []