Created
January 25, 2009 04:47
-
-
Save klauern/51689 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assume we have the following program and external_file.rb library with defined function external_function. | |
require "external_file.rb" | |
a = external_function(1,2,3) | |
# Where should the loaded library file be located if program executes without errors? Assume that the | |
# current directory is not the same as the disk root and executed program's directory. | |
# Note: No command line options were used to invoke Ruby | |
# Answers: | |
# In one of the directories RUBYLIB environment variable points to if $SAFE= | |
# In the current directory | |
# Explanation: | |
# Ruby searches for the library files in the current directory and in RUBYLIB directories. This could | |
# be checked by looking at $: global variable contents. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment