Skip to content

add Function extname()#949

Merged
david22swan merged 1 commit intopuppetlabs:masterfrom
cocker-cc:feature/master/add_function_extname
Oct 11, 2018
Merged

add Function extname()#949
david22swan merged 1 commit intopuppetlabs:masterfrom
cocker-cc:feature/master/add_function_extname

Conversation

@cocker-cc
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread lib/puppet/parser/functions/extname.rb Outdated
#
# extname.rb
#
module Puppet::Parser::Functions
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please implement using the 4.x function API and namespace the function to stdlib

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for Your Review.
I changed the Function to using Puppet-4-Function-API now.

Copy link
Copy Markdown
Contributor

@hlindberg hlindberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented, this should be in the stdlib namespace - and if it is I have no principle arguments against this function - and it is up to the maintainers of stdlib to decide if they want it or not.

Comment thread lib/puppet/functions/extname.rb Outdated
# An empty String will also be returned, when the Period is the last Character
# in Path.

Puppet::Functions.create_function(:extname) do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make that :'stdlib::extname' to place it in the stdlib namespace.
Then, the examples need to be updated to use stdlib::extname(...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
Also I moved it into functions/stdlib/ according to the Documentation.
I adapted also README.md, although this one might be auto-generated.

@hlindberg hlindberg dismissed their stale review September 14, 2018 19:26

My concern is addressed - the maintainers of stdlib can decide if they want this function or not.

@david22swan david22swan merged commit b9caf4d into puppetlabs:master Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants