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, " The path given for '\#{ name }' was not found or not executable.\n Path was: \#{ path }\n EOS\n end\n UTILITY[name] = path\n }\nend\n" |
.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 |