jgerminario/snip — pull request #3 by jgerminario (2014-12-02 09:20:21+00:00)
Title: Staging

@philril Nice additions, it's working well, and I like the change of class name. I just changed the names and file names slightly to be clearer - "SourceFileReaderWriter" and "DestinationFileWriter", as well as "scan_array" instead of "file_array". Minor stuff. Also made a small change to the code to find matches that are anywhere in the line, not just at the beginning (buggy - see below), and writing back to file accordingly (so it won't strip the whole line away).

E.g. "# some text here some more text here"

Also decided to call Sherif's bluff and write some Rspec for this ;) bizarrely, though, I keep running into an error where the CodeScanner.strip_snip_tag is removing all of the tags (this is the last rspec test), but only when they are not at the beginning of the line with the comment (as in the example above). It's been driving me nuts for far too long tonight so I'm giving up on it for now... a sanity check/second set of eyes would be welcome. Oy. Glad to explain anything I added.