Previously I was trying to give the Java engine for JavaScript - rhino - a pseudo file system and I have had success (jszip maven plugin)
I now am turning my attention to the SASS compiler
I have integrated JRuby into my Maven plugin and I can call through to the SASS compiler just fine, so now the final step (before the great refactoring from hack-land to maintainable code) is to fake out the paths that JRuby sees,
My feeling is that I will not be able to reuse my Rhino trick (where I remap the java.io.File class adapter in the Rhino scope) as Ruby in general does not have adapter layers to correct for the differences between different Ruby VMs
So my next thought was monkey patch... But I am unsure how big a job that would be...
With JavaScript I just had to fake java.io.File
, java.io.FileReader
, java.io.FileWriter
, java.io.FileInputStream
, java.io.FileOutputStream
How much would I need to monkey patch in the Ruby runtime... Or am I better using an ASM based rewriting classloader to pull the rug from under JRuby itself (where I risk breaking legitimate File use to load eg Gems)