1 # Returns the Extension (the Portion of Filename in Path starting from the
4 # If Path is a Dotfile, or starts with a Period, then the starting Dot is not
5 # dealt with the Start of the Extension.
7 # An empty String will also be returned, when the Period is the last Character
10 Puppet::Functions.create_function(:'stdlib::extname') do
11 # @param filename The Filename
12 # @return [String] The Extension starting from the last Period
13 # @example Determining the Extension of a Filename
14 # stdlib::extname('test.rb') => '.rb'
15 # stdlib::extname('a/b/d/test.rb') => '.rb'
16 # stdlib::extname('test') => ''
17 # stdlib::extname('.profile') => ''
19 param 'String', :filename
24 File.extname(filename)