Method: Roby::Application#make_path_relative

Defined in:
lib/roby/app.rb

#make_path_relative(path) ⇒ Object

Transforms path into a path relative to an entry in search_path (usually the application root directory)



1852
1853
1854
1855
1856
1857
1858
1859
1860
# File 'lib/roby/app.rb', line 1852

def make_path_relative(path)
    if !File.exist?(path)
        path
    elsif (root_path = find_base_path_for(path))
        Pathname.new(path).relative_path_from(root_path).to_s
    else
        path
    end
end