You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice: /File[/data/puppet/lib/puppet/parser/functions/basename.rb]/content:
--- /data/puppet/lib/puppet/parser/functions/basename.rb2016-12-0209:26:48.249811558 +0100
+++ /tmp/puppet-file20161203-23755-16hmw6n2016-12-0317:54:23.898892747 +0100
@@ -1,34 +1,15 @@
+# basename(string) : string
+# basename(string[]) : string[]
+#
+# Returns the last component of the filename given as argument, which must be
+# formed using forward slashes (``/..) regardless of the separator used on the
+# local file system.modulePuppet::Parser::Functions
- newfunction(:basename,:type=>:rvalue,:doc=><<-EOS- Strips directory (and optional suffix) from a filename- EOS- ) do |arguments|-- if arguments.size < 1 then- raise(Puppet::ParseError, "basename(): No arguments given")- elsif arguments.size > 2 then- raise(Puppet::ParseError, "basename(): Too many arguments given (#{arguments.size})")+ newfunction(:basename, :type => :rvalue) do |args|+ if args[0].is_a?(Array)+ args.collect do |a| File.basename(a) end else-- unless arguments[0].is_a?(String)- raise(Puppet::ParseError, 'basename(): Requires string as first argument')- end-- if arguments.size == 1 then- rv = File.basename(arguments[0])- elsif arguments.size == 2 then-- unless arguments[1].is_a?(String)- raise(Puppet::ParseError, 'basename(): Requires string as second argument')- end-- rv = File.basename(arguments[0], arguments[1])- end-+ File.basename(args[0]) end-- return rv end-end--# vim: set ts=2 sw=2 et :+end\ No newline at end of fileNotice: /File[/data/puppet/lib/puppet/parser/functions/basename.rb]/content: content changed '{md5}c61952b3f68fd86408c84fca2c3febb1' to '{md5}df195fdf6ee16e19d419e07b96f28fe1'
The text was updated successfully, but these errors were encountered:
Hi,
Stdlib also provide a basename.rb
./modules/stdlib/lib/puppet/parser/functions/basename.rb
./modules/glassfish/lib/puppet/parser/functions/basename.rb
On some runs :
The text was updated successfully, but these errors were encountered: