Closed AndrewKeepCoding closed 2 years ago
Typically, PB.INI trims your INI file; but I don't see a problem with adding an extra newline - is that all that's required?
Yes. I did a manual test and this old library didn't load the INI file until I added a new line to the INI file trimmed by PB.INI. Can I make PB.INI not to trim the line at the bottom?
not currently - you're welcome to open a PR - I don't think this would negatively affect any other use-case, and the PR should be fairly simple:
2 modifications (for the 2 Persist methods that actually do work - one goes to a file, the other pushes lines to a stream) and 2 tests that prove that they happen. There may be other tests which are broken by the change, but they shouldn't be hard to fix - trim the result of the "Act" block and they should all pass again. Alternatively, I can look at this tomorrow, perhaps.
I opened a PR. Please take a look. It's a bit different from what you suggested but I think we can avoid change in current use cases.
@AndrewKeepCoding 3.0.6 contains the changes from your PR. Thanks for contributing!
@fluffynuts The old library works now. Thanks for the quick support!
I'm working with an old library that load an INI file and I'm editing its INI file with PeanutButter.INI. The problem I'm facing is that PeanutButter.INI removes empty lines in at the bottom of the file. Apparently, the library needs those empty lines.
Expected Behavior
Not removing empty lines at the bottom.
Actual Behavior
Removes all empty lines at the bottom.
Steps to Reproduce the Problem
Specifications