Advertisement
Guest User

Untitled

a guest
Feb 9th, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.27 KB | None | 0 0
  1. def project_home_directory
  2.   # Scan for parrents directory and return the project home path
  3.   curr_dir = Dir.pwd
  4.  
  5.   loop do
  6.     return curr_dir if File.file?("#{curr_dir}/Gemfile")
  7.     curr_dir = File.expand_path('..', curr_dir)
  8.     break if curr_dir == '/'
  9.   end
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement