Adding a directory to $LOAD_PATH (Ruby)

前端 未结 7 954
广开言路
广开言路 2020-11-28 01:48

I have seen two commonly used techniques for adding the directory of the file currently being executed to the $LOAD_PATH (or $:). I see the advantages of doing this in case

相关标签:
7条回答
  • 2020-11-28 02:31

    The Ruby load path is very commonly seen written as $: , but just because it is short, does not make it better. If you prefer clarity to cleverness, or if brevity for its own sake makes you itchy, you needn't do it just because everyone else is. Say hello to ...

    $LOAD_PATH
    

    ... and say goodbye to ...

    # I don't quite understand what this is doing...
    $:
    
    0 讨论(0)
提交回复
热议问题