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

Allow re-editing malformed JSON #19

Merged
merged 2 commits into from Apr 10, 2014

Conversation

Projects
None yet
2 participants
@joeyates
Collaborator

joeyates commented Mar 31, 2014

Hello,

My main problem with the gem is that I lose edits if I make typos when editing data bags and try to save.

This modification allows the user to re-open the editor with the malformed JSON in order to fix it.

Implementation note: in order to get hold of the malformed text, I have substituted use of Chef::Knife::UI#edit_data with a new private method: Chef::Knife::SoloDataBagEdit#edit_text. This changes allows #edit_content to get the actual text returned from the editor, which permits re-editing if it's malformed.

Regards,
Joe

joeyates added some commits Mar 31, 2014

Allow re-editing malformed JSON.
* The user is asked whether to re-edit or fail,
* Re-editing presents the same malformed JSON that the user saved,
  not the original data bag.

thbishop added a commit that referenced this pull request Apr 10, 2014

Merge pull request #19 from joeyates/master
Allow re-editing malformed JSON

@thbishop thbishop merged commit 102e7cd into thbishop:master Apr 10, 2014

1 check passed

default The Travis CI build passed
Details
@thbishop

This comment has been minimized.

Show comment
Hide comment
@thbishop

thbishop Apr 10, 2014

Owner

@joeyates awesome, thanks.

Owner

thbishop commented Apr 10, 2014

@joeyates awesome, thanks.

@thbishop

This comment has been minimized.

Show comment
Hide comment
@thbishop

thbishop Apr 10, 2014

Owner

i've released version 1.1.0 with this functionality

Owner

thbishop commented Apr 10, 2014

i've released version 1.1.0 with this functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment