]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/libraries/expand.rb
Scrub last munin traces
[chef.git] / cookbooks / munin / libraries / expand.rb
diff --git a/cookbooks/munin/libraries/expand.rb b/cookbooks/munin/libraries/expand.rb
deleted file mode 100644 (file)
index 248c5ad..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-class Chef
-  class Munin
-    def self.expand(template, nodes, separator = " ")
-      nodes.map do |node|
-        if node.is_a?(Hash)
-          template
-            .gsub(/%%%([^%]+)%%%/) { node[Regexp.last_match[1].to_sym].tr("-", "_") }
-            .gsub(/%%([^%]+)%%/) { node[Regexp.last_match[1].to_sym] }
-        else
-          template
-            .gsub("%%%", node.tr("-", "_"))
-            .gsub("%%", node)
-        end
-      end.join(separator)
-    end
-  end
-end