@private
# File lib/rspec/core/ruby_project.rb, line 15 def add_dir_to_load_path(dir) $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) end
# File lib/rspec/core/ruby_project.rb, line 11 def add_to_load_path(*dirs) dirs.map {|dir| add_dir_to_load_path(File.join(root, dir))} end
# File lib/rspec/core/ruby_project.rb, line 31 def ascend_until Pathname(File.expand_path('.')).ascend do |path| return path if yield(path) end end
# File lib/rspec/core/ruby_project.rb, line 23 def determine_root find_first_parent_containing('spec') || '.' end
# File lib/rspec/core/ruby_project.rb, line 27 def find_first_parent_containing(dir) ascend_until {|path| File.exist?(File.join(path, dir))} end
# File lib/rspec/core/ruby_project.rb, line 19 def root @project_root ||= determine_root end
# File lib/rspec/core/ruby_project.rb, line 15 def add_dir_to_load_path(dir) $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) end
# File lib/rspec/core/ruby_project.rb, line 11 def add_to_load_path(*dirs) dirs.map {|dir| add_dir_to_load_path(File.join(root, dir))} end
# File lib/rspec/core/ruby_project.rb, line 31 def ascend_until Pathname(File.expand_path('.')).ascend do |path| return path if yield(path) end end
# File lib/rspec/core/ruby_project.rb, line 23 def determine_root find_first_parent_containing('spec') || '.' end
# File lib/rspec/core/ruby_project.rb, line 27 def find_first_parent_containing(dir) ascend_until {|path| File.exist?(File.join(path, dir))} end
# File lib/rspec/core/ruby_project.rb, line 19 def root @project_root ||= determine_root end