Created
February 16, 2016 19:33
-
-
Save jkugler/51b5e7a1f492fbfe13df to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env ruby | |
def eval_script filename | |
# Creates a new empty hash when accessing a hash that doesn't exist | |
default = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) } | |
eval(File.read(filename), binding, filename) | |
default | |
end | |
# All data from default.rb now available in 'default' | |
default = eval_script 'default.rb' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment