class PXCBackup::PathResolver

Public Class Methods

new(options = {}) click to toggle source
# File lib/pxcbackup/path_resolver.rb, line 5
def initialize(options = {})
  @options = options
  @paths = {}
end

Public Instance Methods

method_missing(name, *arguments) click to toggle source
# File lib/pxcbackup/path_resolver.rb, line 10
def method_missing(name, *arguments)
  unless @paths[name]
    @paths[name] = @options["#{name.to_s}_path".to_sym] || `which #{name.to_s.shellescape}`.strip
    raise "cannot find path for '#{name.to_s}'" unless File.file?(@paths[name])
  end
  @paths[name]
end