Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(MODULES-905) Add bool2str() and camelcase() for string manipulation #255

Merged
merged 2 commits into from
May 15, 2014
Merged

(MODULES-905) Add bool2str() and camelcase() for string manipulation #255

merged 2 commits into from
May 15, 2014

Conversation

mckern
Copy link
Contributor

@mckern mckern commented May 13, 2014

Python likes to have its constants Capitalized, and the capitalize function only understands strings... so I shave a yak.

bool2str() will convert a boolean to its equivalent string value, and camelcase() extends on the functionality provided by uppercase() & downcase() to convert an underscore-delimited string into a camelcased string.

I also added spec tests for these new functions.

Python likes to have its constants Capitalized, and the capitalize
function only understands strings... so I shave a yak.

bool2str will convert a boolean to its equivalent string value,
and camelcase extends on uppercase & downcase to convert an underscore
delimited string into a camelcased string.
@mckern
Copy link
Contributor Author

mckern commented May 15, 2014

I don't know if I made intent clear here, but the need for these was that I've got to edit/interpolate values into a decent amount of Python configuration files (specifically for tools like mock and createrepo). Python loves it some CamelCasing (they call them StudlyWords!), and the ability to coerce strings into that format natively (without having to munge them in templates) would be very useful.

apenney pushed a commit that referenced this pull request May 15, 2014
(MODULES-905) Add bool2str() and camelcase() for string manipulation
@apenney apenney merged commit 430d821 into puppetlabs:master May 15, 2014
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.

3 participants