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

Capitalize only first letter of Environment identifier #19

Conversation

scottymack
Copy link
Contributor

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.

Copy link
Owner

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

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

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 🙏

@rogerluan rogerluan changed the title Only capitalize first letter, leave rest untouched Capitalize only first letter of Environment identifier Oct 26, 2022
@scottymack
Copy link
Contributor Author

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!

Copy link
Owner

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

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

Super! Thank you for implementing this improvement @scottymack ❤️

@rogerluan rogerluan merged commit 1d2ca9d into rogerluan:main Nov 7, 2022
@rogerluan
Copy link
Owner

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.

2 participants