class Validators

  class << self

    def validate_run_list run_list
      return true if run_list.empty?
      rl = /\Arole|recipe\[[\w-]+(::[\w-]+)?\]\Z/
      e = run_list.select {|l| (rl =~ l).nil?}
      res = e.empty?
      puts I18n.t("handler.project.create.run_list.invalid", :list => e.join(", ")) unless res
      res
    end

  end

end
