Parent

SSHKit::CommandMap

Public Class Methods

new(value = nil) click to toggle source
# File lib/sshkit/command_map.rb, line 36
def initialize(value = nil)
  @map = CommandHash.new(value || defaults)
end

Public Instance Methods

[](command) click to toggle source
# File lib/sshkit/command_map.rb, line 40
def [](command)
  if prefix[command].any?
    prefixes = prefix[command].join(" ")

    "#{prefixes} #{command}"
  else
    @map[command]
  end
end
[]=(command, new_command) click to toggle source
# File lib/sshkit/command_map.rb, line 54
def []=(command, new_command)
  @map[command] = new_command
end
clear() click to toggle source
# File lib/sshkit/command_map.rb, line 58
def clear
  @map = CommandHash.new(defaults)
end
defaults() click to toggle source
# File lib/sshkit/command_map.rb, line 62
def defaults
  Hash.new do |hash, command|
    if %{if test time}.include? command.to_s
      hash[command] = command.to_s
    else
      hash[command] = "/usr/bin/env #{command}"
    end
  end
end
prefix() click to toggle source
# File lib/sshkit/command_map.rb, line 50
def prefix
  @prefix ||= PrefixProvider.new
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.