vaguerent/lib/vagrant/util/safe_env.rb
2015-11-23 09:39:51 -08:00

15 lines
348 B
Ruby

module Vagrant
module Util
class SafeEnv
# This yields an environment hash to change and catches any issues
# while changing the environment variables and raises a helpful error
# to end users.
def self.change_env
yield ENV
rescue Errno::EINVAL
raise Errors::EnvInval
end
end
end
end