Module: Backup::Utilities::DSL

Defined in:
lib/backup/utilities.rb

Class Method Summary collapse

Class Method Details

.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

.tar_dist(val) ⇒ Object

Allow users to set the tar distribution if needed. (:gnu or :bsd)



42
43
44
# File 'lib/backup/utilities.rb', line 42

def tar_dist(val)
  Utilities.tar_dist(val)
end