Merge pull request #111 from JCook21/Pretend

Edits to keep code DRY
This commit is contained in:
Jeremy Cook
2014-04-26 17:45:08 -04:00
5 changed files with 67 additions and 51 deletions

View File

@@ -2,6 +2,22 @@
module Homesick
# Various utility methods that are used by Homesick
module Utils
QUIETABLE = ['say_status']
PRETENDABLE = ['system']
QUIETABLE.each do |method_name|
define_method(method_name) do |*args|
super(*args) unless options[:quiet]
end
end
PRETENDABLE.each do |method_name|
define_method(method_name) do |*args|
super(*args) unless options[:pretend]
end
end
protected
def home_dir