module HTAuth

With many thanks to JEG2 - graysoftinc.com/terminal-tricks/random-access-terminal

Public Class Methods

lib_path( *args ) click to toggle source
# File lib/htauth.rb, line 20
def self.lib_path( *args )
  self.sub_path( "lib", *args )
end
root_dir() click to toggle source

The root directory of the project is considered to be the parent directory of the 'lib' directory.

# File lib/htauth.rb, line 11
def self.root_dir
  unless @root_dir
    path_parts = ::File.expand_path( __FILE__ ).split( ::File::SEPARATOR )
    lib_index  = path_parts.rindex( 'lib' )
    @root_dir  = path_parts[ 0...lib_index].join( ::File::SEPARATOR ) + ::File::SEPARATOR
  end
  return @root_dir
end
sub_path( sub, *args ) click to toggle source
# File lib/htauth.rb, line 24
def self.sub_path( sub, *args )
  sp = ::File.join( root_dir, sub ) + ::File::SEPARATOR
  sp = ::File.join( sp, *args ) if args
end

Public

↑ top

Constants

VERSION

The version of the htauth library

Internal

↑ top