Created
October 16, 2012 22:08
-
-
Save bennylope/3902361 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
if CONF.has_key?("mounts") | |
for folder in CONF['mounts'] | |
config.vm.share_folder(folder['name'], folder['virtual'], folder['host'], :nfs => true) | |
end | |
end |
Got my answer. Small change, using the each
method. (Thanks to @guillec.)
if CONF.has_key?("mounts")
CONF['mounts'].each do |folder|
config.vm.share_folder(folder['name'], folder['virtual'], folder['host'], :nfs => true)
end
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the best Ruby-like way of writing the above Ruby code, given a hash called "CONF" which will load a hash called "mounts" if it exists in the CONF hash?