Skip to content

Instantly share code, notes, and snippets.

@bachue
Last active December 10, 2015 12:08
Show Gist options
  • Save bachue/4431862 to your computer and use it in GitHub Desktop.
Save bachue/4431862 to your computer and use it in GitHub Desktop.
# main file
def f1
require '2.rb'
end
def f2
require '2.rb'
end
f1
f2
# 2.rb
puts 'hello world'
=> hello world
# you can replace 'require' with 'load', it will output 'hello world' twice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment