Class: Tracelogger::Traceroute

Inherits:
Object
  • Object
show all
Defined in:
lib/tracelogger.rb

Overview

Wraps ‘traceroute` run.

Instance Method Summary collapse

Constructor Details

#initializeTraceroute

Finds the system’s traceroute executable.



39
40
41
# File 'lib/tracelogger.rb', line 39

def initialize
  @command = `/usr/bin/env PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin which traceroute`.chomp
end

Instance Method Details

#trace(host) ⇒ Object

Runs the found traceroute with the specified address and returns the result.



45
46
47
# File 'lib/tracelogger.rb', line 45

def trace host
  `#{@command} #{host} 2>&1`
end