Skip to content

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

Merged
apenney merged 2 commits intopuppetlabs:masterfrom
mckern:enhancement/master/camelcasedembools
May 15, 2014
Merged

(MODULES-905) Add bool2str() and camelcase() for string manipulation#255
apenney merged 2 commits intopuppetlabs:masterfrom
mckern:enhancement/master/camelcasedembools

Conversation

@mckern
Copy link
Copy Markdown
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.

mckern added 2 commits May 13, 2014 15:46
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
Copy Markdown
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