From 2ffb5d525acae21fc7e773ca98506981c2f37fa3 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 14 Feb 2014 10:32:57 -0500 Subject: [PATCH] remove String#absolute_path? monkey patch --- lib/rscons.rb | 6 ++++++ lib/rscons/environment.rb | 2 +- lib/rscons/monkey/string.rb | 5 ----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/rscons.rb b/lib/rscons.rb index 809f6ea..6a978a4 100644 --- a/lib/rscons.rb +++ b/lib/rscons.rb @@ -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 diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index 4cd475a..1d59cc1 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -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 diff --git a/lib/rscons/monkey/string.rb b/lib/rscons/monkey/string.rb index d4f07f9..dc1f629 100644 --- a/lib/rscons/monkey/string.rb +++ b/lib/rscons/monkey/string.rb @@ -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