[nix-shell:~/src]$ cat x.rb y.rb crap.rb
# x.rb
load 'crap.rb'
load 'crap.rb'
# y.rb
require 'crap.rb'
require 'crap.rb'
# crap.rb
puts 'hi'
[nix-shell:~/src]$ ruby x.rb
hi
hi
[nix-shell:~/src]$ ruby y.rb
hi
Created
November 2, 2016 14:55
-
-
Save mbbx6spp/7741ce8c4ab0b2c7aac74cf0854cfb47 to your computer and use it in GitHub Desktop.
Demonstrate difference between load and require in Ruby
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment