Method: Sass::Util#realpath
- Defined in:
- lib/sass/util.rb
#realpath(path) ⇒ Pathname
Returns path with all symlinks resolved.
671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 |
# File 'lib/sass/util.rb', line 671
def realpath(path)
path = Pathname.new(path) unless path.is_a?(Pathname)
# Explicitly DON'T run #pathname here. We don't want to convert
# to Windows directory separators because we're comparing these
# against the paths returned by Listen, which use forward
# slashes everywhere.
begin
path.realpath
rescue SystemCallError
# If [path] doesn't actually exist, don't bail, just
# return the original.
path
end
end
|