remove String#absolute_path? monkey patch

This commit is contained in:
Josh Holtrop 2014-02-14 10:32:57 -05:00
parent fa7d17675b
commit 2ffb5d525a
3 changed files with 7 additions and 6 deletions

View File

@ -37,4 +37,10 @@ module Rscons
end
Cache.clear
end
# Return whether the given path is an absolute filesystem path or not
# @param path [String] the path to examine
def self.absolute_path?(path)
path =~ %r{^(/|\w:[\\/])}
end
end

View File

@ -111,7 +111,7 @@ module Rscons
end
end
if @build_root and not found_match
unless source_fname.absolute_path? or build_fname.start_with?("#{@build_root}/")
unless Rscons.absolute_path?(source_fname) or build_fname.start_with?("#{@build_root}/")
build_fname = "#{@build_root}/#{build_fname}"
end
end

View File

@ -6,9 +6,4 @@ class String
def set_suffix(suffix = '')
sub(/\.[^.]*$/, suffix)
end
# Return whether the string represents an absolute filesystem path
def absolute_path?
self =~ %r{^(/|\w:[\\/])}
end
end