Updated mcollective.init according to OSCI-658
[packages/precise/mcollective.git] / plugins / mcollective / validator / regex_validator.rb
diff --git a/plugins/mcollective/validator/regex_validator.rb b/plugins/mcollective/validator/regex_validator.rb
new file mode 100644 (file)
index 0000000..3d21ec6
--- /dev/null
@@ -0,0 +1,9 @@
+module MCollective
+  module Validator
+    class RegexValidator
+      def self.validate(validator, regex)
+        raise ValidatorError, "value should match #{regex}" unless validator.match(regex)
+      end
+    end
+  end
+end