sideshowcoder / canned

Server to respond with fake API responses, by using a directory of files for finding out what to say!
213 stars 46 forks source link

handle carriage return #83

Closed git-jiby-me closed 8 years ago

git-jiby-me commented 8 years ago

windows uses CR+LF for line breaks, since we split lines by using LF, make sure that, we convert all CR into LF before breaking into lines, also handles case some operation system uses just CR for line breaks

git-jiby-me commented 8 years ago

fixes #79

git-jiby-me commented 8 years ago

@sideshowcoder I added the test, but had to do some refactor on the code structure to make the test possible. I basically move the implementation of Canned class to /lib/canned.js and now just put the wrapper canned function in /canned.js.

I think that is a refactor in the good direction, but please comment if you think it is the wrong way.

git-jiby-me commented 8 years ago

@sideshowcoder i actually wanted to rename /canned.js to main.js or index.js, but first wanted to know what you think about the split

sideshowcoder commented 8 years ago

makes sense to me! I would prefer index.js as it is the commonly used name for modules I think so yes go for it!

git-jiby-me commented 8 years ago

@sideshowcoder done :+1: , Travis seems to take forever to run the test for the change :8ball:

sideshowcoder commented 8 years ago

I think just this time of the day travis is quite busy. But yeah looks good I think merge and add a line in the readme changelog that this has been fix for version next and it will go out with the next release! Awesome work! thanks.

git-jiby-me commented 8 years ago

@sideshowcoder shall i go ahead with the merge, and addition to change log, or you do you mean you will do that. Sorry but i don't understand your workflow (yet...).

sideshowcoder commented 8 years ago

You can go ahead. I normally add the line in the PR when I merge it. If it is one I do myself I add it on the branch of the PR if it I merge one from a contributed I add it after the fact because it is easier. The important thing is that the line ends up in the changelog after something is merged. I don't have much of a process for doing that (yet) as there has not been a need for thinking about it more (maybe I should)