add String#absolute_path?
This commit is contained in:
parent
8fcbd39057
commit
7681c7584f
@ -99,7 +99,7 @@ module Rscons
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if @build_root and not found_match
|
if @build_root and not found_match
|
||||||
unless source_fname.start_with?('/') or source_fname =~ %r{^\w:[\\/]}
|
unless source_fname.absolute_path?
|
||||||
build_fname = "#{@build_root}/#{build_fname}"
|
build_fname = "#{@build_root}/#{build_fname}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -17,4 +17,9 @@ class String
|
|||||||
def set_suffix(suffix = '')
|
def set_suffix(suffix = '')
|
||||||
sub(/\.[^.]*$/, suffix)
|
sub(/\.[^.]*$/, suffix)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Return whether the string represents an absolute filesystem path
|
||||||
|
def absolute_path?
|
||||||
|
self =~ %r{^(/|\w:[\\/])}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user