rogerluan / arkana

Use dotenv files for Android and iOS projects.
BSD 2-Clause "Simplified" License
374 stars 18 forks source link

Capitalize only first letter of Environment identifier #19

Closed scottymack closed 1 year ago

scottymack commented 1 year ago

When using .map(&:capitalize) it's ensuring that the first letter of the environment is capitalized, BUT it's also lowercasing the rest of the environment name.

For example if one of our environments is DebugPlusMore, then I would think that the environment variable I should add would be MyServiceAPIKeyDebugPlusMore, but it's actually searching for MyServiceAPIKeyDebugplusmore.

By changing the map function we can ensure that the first letter is capitalized in the environments, but also leave the rest of the naming untouched and then our environment variable of MyServiceAPIKeyDebugPlusMore would be found.

scottymack commented 1 year ago

This change makes sense to me! However, could you use the method capitalize_first_letter that is already declared in lib/arkana/helpers/string.rb? 🙏

Also, perhaps it's worth adding a simple test with your example to make sure this won't regress in the future 🙏

Good thinking! Sorry, this is my first work in ruby, so I'm still figuring out the file structure and how it all fits together. Let me know if the there are more changes needed. Thanks!

rogerluan commented 1 year ago

This was released as part of https://github.com/rogerluan/arkana/releases/tag/v1.3.0 @scottymack 🚀