Open rks opened 13 years ago
Thanks for the report! This has been something I've been putting off for a while, but Laser should be able to handle something like ostruct. I'm thinking right now the best solution is to accept an environment variable and/or switch which sets the LOAD_PATH that Laser should use during simulation (in addition to its own stuff). LASER_LOAD_PATH and --load-path sound good to me.
I've added some preliminary support for this feature in 1bcc99acb1854c884706c734c14138432f371880.
The -I option passable to Ruby is now supported, and by default, Laser will consider the environment variable LASER_RUBYPATH, then RUBYPATH, then the current $LOAD_PATH variable (before any modifications made by Laser itself).
You will, however, get "unused method" warnings from the standard library classes you've require
d. Still pondering how to approach that without hiding unused methods in user code.
laser is failing for me when my files require standard libraries, such as ostruct and pathname. It appears to assume that these libraries are part of my application. The error originates in Laser::Analysis::ControlFlow::Simulation#simulate_require: `simulate_require': No such file: ostruct (LoadError)
Example: