Test require command : require « Language Basics « Ruby






Test require command



//Put this in a.rb:
puts "Hello from a.rb"

//And put this in a file called b.rb:
require 'a'
puts "Hello from b.rb"
require 'a'
puts "Hello again from b.rb"

//Run with ruby b.rb

 








Related examples in the same category

1.put this code in a file called string_extensions.rb:
2.A commonly used shortcut uses arrays to quickly load a collection of libraries at once.
3.Nested Inclusions