module R::Env

Environment Information

Public Class Methods

out_dir() click to toggle source

@return [Pathname] The build output directory.

# File lib/rub/r/env.rb, line 61
def self.out_dir
        @out_dir ||= src_dir + 'build/'
end
project_cache() click to toggle source

@return [Pathname] The project cache directory.

# File lib/rub/r/env.rb, line 68
def self.project_cache
        out_dir + "cache/"
end
src_dir() click to toggle source

@return [Pathname] The directory from which rub was executed.

# File lib/rub/r/env.rb, line 56
def self.src_dir
        @src_dir ||= find_src_dir
end

Private Class Methods

find_src_dir() click to toggle source

@private

# File lib/rub/r/env.rb, line 40
def self.find_src_dir
        d = @cmd_dir
        while not (d+'root.rub').exist?
                d = d.parent
                
                if d.root?
                        $stderr.puts('root.rub not found.  Make sure you are in the source directory.')
                        Sysexits.exit :usage
                end
        end
        
        d.parent + (d.basename.to_s+'/') # Ensure this ends in a '/'
end