Created
January 8, 2015 16:45
-
-
Save JoelQ/2509e9143cd12ea04e0a to your computer and use it in GitHub Desktop.
__dir__ comparison
This file contains 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 "__dir__ is the same as File.expand_path(__dir__)" | |
puts __dir__ == File.expand_path(__dir__) | |
puts "__dir__ is the same as File.expand_path( File.dirname(__FILE__) )" | |
puts __dir__ == File.expand_path( File.dirname(__FILE__) ) | |
puts "__dir__ is the same as File.expand_path('../', __FILE__)" | |
puts __dir__ == File.expand_path("../", __FILE__) | |
# Script Output: | |
# | |
# __dir__ is the same as File.expand_path(__dir__) | |
# true | |
# __dir__ is the same as File.expand_path( File.dirname(__FILE__) ) | |
# true | |
# __dir__ is the same as File.expand_path('../', __FILE__) | |
# true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment