Search code examples
rubycosmos

What does 'load_utility' do in COSMOS?


Ruby has 'require' and 'load' so 'load_utility' probably does something similar to 'load'? When should it be used over 'require' and 'load'.


Solution

  • In COSMOS, 'load_utility' instruments your ruby script for use in scripting. Instrumenting means that it displays the line that is executing when it runs. This is different from simply doing a Ruby 'load' because that code is not instrumented and will execute directly in the Ruby interpreter without showing the line by line execution.

    For more information, please read this Require vs Load blog post.