From ac6c3a4892bc6f477af00c2dee3a12a3e66b4de7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 17 Mar 2010 20:42:53 -0700 Subject: [PATCH] Util::Errors class to parse errors from YML and render them via ERB --- lib/vagrant/util/errors.rb | 33 ++++++++++++++++++++ templates/errors.yml | 1 + test/vagrant/util/errors_test.rb | 52 ++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 lib/vagrant/util/errors.rb create mode 100644 templates/errors.yml create mode 100644 test/vagrant/util/errors_test.rb diff --git a/lib/vagrant/util/errors.rb b/lib/vagrant/util/errors.rb new file mode 100644 index 000000000..0800ba4c8 --- /dev/null +++ b/lib/vagrant/util/errors.rb @@ -0,0 +1,33 @@ +require 'yaml' + +module Vagrant + module Util + # This class is responsible for outputting errors. It retrieves the errors, + # based on their key, from the error file, and then outputs it. + class Errors + @@errors = nil + + class <