iseq_loader.rb - sample of compiler/loader for binary compiled file

Usage as a compiler: ruby iseq_loader.rb [file or directory] …

It compiles and stores specified files.
If directories are specified, then compiles and stores all *.rb files.
(using Dir.glob)

TODO: add remove option TODO: add verify option

Usage as a loader: simply require this file with the following setting.

Setting with environment variables.

* RUBY_ISEQ_LOADER_STORAGE to select storage type
  * dbm: use dbm
  * fs: [default] use file system. locate a compiled binary files in same
    directory of scripts like Rubinius. foo.rb.yarb will be created for foo.rb.
  * fs2: use file system. locate compiled file in specified directory.
  * nothing: do nothing.

* RUBY_ISEQ_LOADER_STORAGE_DIR to select directory
  * default: ~/.ruby_binaries/

* RUBY_ISEQ_LOADER_STORAGE_COMPILE_IF_NOT_COMPILED
  * true: store compiled file if compiled data is not available.
  * false: [default] do nothing if there is no compiled iseq data.
Required Files
Namespace