Skip to content

Instantly share code, notes, and snippets.

@itang
Created January 24, 2015 10:11
Show Gist options
  • Save itang/4698eb18d73fc0ed64cc to your computer and use it in GitHub Desktop.
Save itang/4698eb18d73fc0ed64cc to your computer and use it in GitHub Desktop.
puts "__FILE__:#{__FILE__}"
puts "File.dirname(__FILE__):#{File.dirname(__FILE__)}"
puts "File.expand_path(File.dirname(__FILE__)): #{File.expand_path(File.dirname(__FILE__))}"
puts "File.expand_path(File.dirname(__FILE__) + '../lib'): #{File.expand_path(File.dirname(__FILE__) + '../lib')}"
# __FILE__:a.rb
# File.dirname(__FILE__):.
# File.expand_path(File.dirname(__FILE__)): /home/itang/test/test_ruby_file
# File.expand_path(File.dirname(__FILE__) + '../lib'): /home/itang/test/test_ruby_file/.../lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment