gempm: Sharing JavaScript Code Between Rails and Node.js apps
Background Here at OwnLocal, we’ve built lots of Rails apps and added lots of Ruby code to those apps. As our products and tools have grown organically over the years, our systems have become more opaque and, in some cases, more brittle. In the last quarter of 2016, my team was tasked with automating away a large portion of our bread and butter: writing parsers to extract, transform, and load data from text files sent to us by our partners on a daily basis. Studying the requirements, it seemed to me that the proposed data flow—passing in a text file along with a partner-specific configuration for how the system should translate that data—resembled a pure function: we’d always get the same output from the same input, no side-effects. When I pitched the idea that we build a greenfield project, rather than bolting more functionality onto a Rails app we plan to sunset next year, Drew told us to go for it. ...