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

feat: unescape escaped characters when value is not quoted #421

Conversation

bethesque
Copy link
Contributor

@bethesque bethesque commented Jan 15, 2021

Thank you for this handy gem. We use it regularly.

When using Ruby's shellwords library to escape values, the following env file is created.

export FOO=one\ two

Quotes cannot be used around those values, otherwise the backslash is considered a literal.

# incorrect
$ export FOO="one\ two"
$ echo $FOO
one\ two

# correct
$ export FOO=one\ two
$ echo $FOO
one two

This PR updates the code to correctly unescape characters when quotes are not used

The parse_value method had to be refactored to keep Rubocop happy.

@bkeepers bkeepers requested a review from cadwallion April 9, 2021 23:54
Copy link
Owner

@bkeepers bkeepers left a comment

Choose a reason for hiding this comment

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

This makes sense to me. @cadwallion, I'd love to hear your thoughts

Copy link
Collaborator

@cadwallion cadwallion left a comment

Choose a reason for hiding this comment

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

Apologies for the slow response, @bethesque, this looks great! Thank you for the bump @bkeepers.

@cadwallion cadwallion merged commit 2e09f10 into bkeepers:master Apr 10, 2021
@bethesque
Copy link
Contributor Author

Much appreciated!

@bethesque bethesque deleted the feat/unescape-escaped-characters-when-not-quoted branch April 10, 2021 08:50
@bethesque bethesque restored the feat/unescape-escaped-characters-when-not-quoted branch April 10, 2021 08:50
@bethesque
Copy link
Contributor Author

Is there an expected date for the next release?

@cadwallion
Copy link
Collaborator

My plan is to review outstanding PRs/issues tomorrow and cut a release before the end of the day in the pacific timezone.

@bethesque
Copy link
Contributor Author

Hi. I know it's been a while, but as far as I can tell, this was never released. We're currently pointing our gem source at a private repo for this feature, but would like to change that to use the public gem. Could this be released please?

@bkeepers
Copy link
Owner

2.8.0 is out with this change. Sorry for the delayed release. Enjoy!

@bethesque
Copy link
Contributor Author

Better late than never! 😆 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants