-
-
Save fgarcia/3d6acefb1f3936105ebb to your computer and use it in GitHub Desktop.
Test if file extension matters in Ruby 'require'
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
require './b' | |
require './b.rb' |
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
puts "I was required" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of Ruby 2.1.3, executing
ruby a.rb
prints the message only once, so it looks likerequire
can recognize that both lines refrence the same file