Tuesday, 13 January 2015

Dir.pwd command

class RnD1
  puts 'testing'
  puts Dir.pwd
  base_path =  File.expand_path('basics/', Dir.pwd)
  x= File.open(base_path + '/RnD1.rb')
  puts x.inspect
end


testing
C:/Users/user/workspace/RubyRnD
#<File:C:/Users/user/workspace/RubyRnD/basics/RnD1.rb>

No comments:

Post a Comment