]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
One function per file?
authorPeter Palfrader <peter@palfrader.org>
Wed, 2 Mar 2011 18:26:23 +0000 (19:26 +0100)
committerPeter Palfrader <peter@palfrader.org>
Wed, 2 Mar 2011 18:26:23 +0000 (19:26 +0100)
modules/puppetmaster/lib/puppet/parser/functions/filter.rb [deleted file]
modules/puppetmaster/lib/puppet/parser/functions/filter_ipv4.rb [new file with mode: 0644]
modules/puppetmaster/lib/puppet/parser/functions/filter_ipv6.rb [new file with mode: 0644]
modules/puppetmaster/lib/puppet/parser/functions/join_spc.rb [new file with mode: 0644]

diff --git a/modules/puppetmaster/lib/puppet/parser/functions/filter.rb b/modules/puppetmaster/lib/puppet/parser/functions/filter.rb
deleted file mode 100644 (file)
index e0dd34c..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-module Puppet::Parser::Functions
-
-  # given an array of network addresses, return only the ipv4 addresses
-  newfunction(:filter_ipv4, :type => :rvalue) do |args|
-    x = args.shift
-
-    raise Puppet::ParseError, "Argument is not an array." unless x.kind_of?(Array)
-    return x.reject{ |x| x =~ /:/}
-  end
-
-  # given an array of network addresses, return only the ipv6 addresses
-  newfunction(:filter_ipv6, :type => :rvalue) do |args|
-    x = args.shift
-
-    raise Puppet::ParseError, "Argument is not an array." unless x.kind_of?(Array)
-    return x.reject{ |x| x !~ /:/}
-  end
-
-  # given an list, join with spaces
-  newfunction(:join_spc, :type => :rvalue) do |args|
-    x = args.shift
-
-    raise Puppet::ParseError, "Argument is not an array." unless x.kind_of?(Array)
-    return x.join(' ')
-  end
-end
-# vim:set et:
-# vim:set sts=2 ts=2:
-# vim:set shiftwidth=2:
diff --git a/modules/puppetmaster/lib/puppet/parser/functions/filter_ipv4.rb b/modules/puppetmaster/lib/puppet/parser/functions/filter_ipv4.rb
new file mode 100644 (file)
index 0000000..823d272
--- /dev/null
@@ -0,0 +1,12 @@
+module Puppet::Parser::Functions
+  # given an array of network addresses, return only the ipv4 addresses
+  newfunction(:filter_ipv4, :type => :rvalue) do |args|
+    x = args.shift
+
+    raise Puppet::ParseError, "Argument is not an array." unless x.kind_of?(Array)
+    return x.reject{ |x| x =~ /:/}
+  end
+end
+# vim:set et:
+# vim:set sts=2 ts=2:
+# vim:set shiftwidth=2:
diff --git a/modules/puppetmaster/lib/puppet/parser/functions/filter_ipv6.rb b/modules/puppetmaster/lib/puppet/parser/functions/filter_ipv6.rb
new file mode 100644 (file)
index 0000000..f268cc5
--- /dev/null
@@ -0,0 +1,12 @@
+module Puppet::Parser::Functions
+  # given an array of network addresses, return only the ipv6 addresses
+  newfunction(:filter_ipv6, :type => :rvalue) do |args|
+    x = args.shift
+
+    raise Puppet::ParseError, "Argument is not an array." unless x.kind_of?(Array)
+    return x.reject{ |x| x !~ /:/}
+  end
+end
+# vim:set et:
+# vim:set sts=2 ts=2:
+# vim:set shiftwidth=2:
diff --git a/modules/puppetmaster/lib/puppet/parser/functions/join_spc.rb b/modules/puppetmaster/lib/puppet/parser/functions/join_spc.rb
new file mode 100644 (file)
index 0000000..85b534a
--- /dev/null
@@ -0,0 +1,12 @@
+module Puppet::Parser::Functions
+  # given an list, join with spaces
+  newfunction(:join_spc, :type => :rvalue) do |args|
+    x = args.shift
+
+    raise Puppet::ParseError, "Argument is not an array." unless x.kind_of?(Array)
+    return x.join(' ')
+  end
+end
+# vim:set et:
+# vim:set sts=2 ts=2:
+# vim:set shiftwidth=2: