Class: Tracelogger::Traceroute
- Inherits:
-
Object
- Object
- Tracelogger::Traceroute
- Defined in:
- lib/tracelogger.rb
Overview
Wraps ‘traceroute` run.
Instance Method Summary collapse
-
#initialize ⇒ Traceroute
constructor
Finds the system’s traceroute executable.
-
#trace(host) ⇒ Object
Runs the found traceroute with the specified address and returns the result.
Constructor Details
#initialize ⇒ Traceroute
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 |