Method: Backup::Utilities::DSL.name

Defined in:
lib/backup/utilities.rb

.nameObject

Allow users to set the path for all utilities in the .configure block.

Utility names with dashes (‘redis-cli’) will be set using method calls with an underscore (‘redis_cli’).



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/backup/utilities.rb', line 27

NAMES.each do |name|
  define_method name.gsub('-', '_'), lambda {|val|
    path = File.expand_path(val)
    unless File.executable?(path)
      raise Utilities::Error, <<-EOS
        The path given for '#{ name }' was not found or not executable.
        Path was: #{ path }
      EOS
    end
    UTILITY[name] = path
  }
end