class RbPlusPlus::Writers::MultipleFilesWriter

Writer that takes a builder and writes out the code in multiple files.

Public Instance Methods

write() click to toggle source

Writing out a multiple-file built is a multi-stage process. This writer first builds a [working_dir]/.build directory, where new code initially goes. Once the writing is complete, each file in .build/ is diff-checked by the files in [working_dir]. If the files are different, the new file is copied into place. Then, the .build dir is removed.

We do this to allow for easy and quick-ish work on large wrapping projects. Because Rice code takes so long to compile, the fewer files one has to compile per change the better.

# File lib/rbplusplus/writers/multiple_files_writer.rb, line 16
def write