Skip to content

Instantly share code, notes, and snippets.

@lukeab
Last active June 29, 2016 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukeab/09be583c974ce95d174a25c4f952f843 to your computer and use it in GitHub Desktop.
Save lukeab/09be583c974ce95d174a25c4f952f843 to your computer and use it in GitHub Desktop.
Trying to detect os in vagrantfile
module OS
def OS.windows?
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end
def OS.mac?
(/darwin/ =~ RUBY_PLATFORM) != nil
end
def OS.unix?
!OS.windows?
end
def OS.linux?
OS.unix? and not OS.mac?
end
end
$usenfssyncedfolders= OS.mac? true:false
$puppetsftype= OS.mac? 'nfs':'vboxsf'
==== ERror output ===
Line number: 50
Message: TypeError: OS is not a module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment