Module: Backup::Utilities::DSL
- Defined in:
- lib/backup/utilities.rb
Class Method Summary collapse
-
.name ⇒ Object
Allow users to set the path for all utilities in the .configure block.
-
.tar_dist(val) ⇒ Object
Allow users to set the
tar
distribution if needed.
Class Method Details
.name ⇒ Object
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.(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 |