Created
January 9, 2012 14:58
-
-
Save esmarkowski/1583277 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def run_if_present( path ) | |
puts "if [ -d #{path} ]; then #{yield self}; fi" | |
end | |
my_pid_file = "/somewhere/secret" | |
run_if_present my_pid_file do | |
"ls #{my_pid_file}" | |
end | |
run_if_present(my_pid_file){ "ls #{my_pid_file}" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment