Permalink
Browse files

Add helper function for plugins

  • Loading branch information...
1 parent 99ecd26 commit e95d4a4f275664de39c0e475156795fec4d9ed12 Tim Sharpe committed Dec 10, 2010
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/puppet/parser/functions/rabbitmq_version.rb
@@ -0,0 +1,6 @@
+module Puppet::Parser::Functions
+ newfunction(:rabbitmq_version, :type => :rvalue, :doc => "Given a package version (e.g. 2.2.0-1), return the RabbitMQ version (e.g. 2.2.0)") do |args|
+ args[0].is_a? String or raise Puppet::Error.new("I pity the fool who didn't pass rabbitmq_version a String!")
+ args[0].split('-').first
+ end
+end

0 comments on commit e95d4a4

Please sign in to comment.