Flaque / thaum

Thaum is a simple boilerplate and scaffolding command line utility.
https://flaque.github.io/thaum/
MIT License
23 stars 3 forks source link

Add lowerCase and titleCase naming #8

Closed Carlosedo closed 2 years ago

Carlosedo commented 7 years ago

Solves: https://github.com/Flaque/thaum/issues/5

This was my approach:

  1. I modified the regex in mustache.go so that it also matches two word variables.
  2. These <modifier> <key> variables are added to the variables map in TemplateFile but not to Template. That way we don't ask the user for it's value but we pass them on to mustache later on.
  3. When setting the values inside Template.Update, if the variable has a modifier, apply said modifier and then set the value.

So far I only added two modifiers (lowerCase and titleCase) but I could add more later if you like my approach and this PR is merged. I'd also like to add some tests. But I will do that once the final code is approved by you.

Disclaimer: This is my first ever PR in go, so please have no mercy and try to be explanative, I'm here to learn 😄

Flaque commented 7 years ago

Cool! :D I'm gonna look into those Travis errors. Hold on a bit <3

Carlosedo commented 7 years ago

Great, thanks! Let me know if there's anything I can do to help

Carlosedo commented 7 years ago

Hi @Flaque! Did you get a chance to look at the Travis errors?

Either way, could you give me some feedback on my code?

Thank you so much! Carlos

Flaque commented 7 years ago

Sorry! I haven't gotten a chance to look at this yet! 😭

But I have put it on my schedule and will get to it in the next few days if not today. Thanks for being patient, and thanks so much for the PR!

-Evan