Test load command : load « Language Basics « Ruby






Test load command



//Put this in a.rb:

puts "Hello from a.rb"

//And put this in a file called b.rb:

load 'a'
puts "Hello from b.rb"
load 'a'
puts "Hello again from b.rb"

//Run with ruby b.rb

 








Related examples in the same category

1.use load to load external source code files into your program.