lib/rscons.rb in rscons-0.3.1 vs lib/rscons.rb in rscons-1.0.0

- old
+ new

@@ -1,17 +1,15 @@ -require "rscons/builder" -require "rscons/cache" -require "rscons/environment" -require "rscons/varset" -require "rscons/version" +require_relative "rscons/builder" +require_relative "rscons/cache" +require_relative "rscons/environment" +require_relative "rscons/varset" +require_relative "rscons/version" -require "rscons/monkey/string" - # default builders -require "rscons/builders/library" -require "rscons/builders/object" -require "rscons/builders/program" +require_relative "rscons/builders/library" +require_relative "rscons/builders/object" +require_relative "rscons/builders/program" # Namespace module for rscons classes module Rscons DEFAULT_BUILDERS = [ :Library, @@ -34,7 +32,20 @@ if (Dir.entries(directory) - ['.', '..']).empty? Dir.rmdir(directory) rescue nil end 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 + + # Return a new path by changing the suffix in path to suffix. + # @param path [String] the path to alter + # @param suffix [String] the new filename suffix + def self.set_suffix(path, suffix) + path.sub(/\.[^.]*$/, suffix) end end