Module: HTAuth

Defined in:
lib/htauth.rb,
lib/htauth/cli.rb,
lib/htauth/md5.rb,
lib/htauth/file.rb,
lib/htauth/sha1.rb,
lib/htauth/crypt.rb,
lib/htauth/entry.rb,
lib/htauth/error.rb,
lib/htauth/argon2.rb,
lib/htauth/bcrypt.rb,
lib/htauth/console.rb,
lib/htauth/version.rb,
lib/htauth/algorithm.rb,
lib/htauth/plaintext.rb,
lib/htauth/cli/digest.rb,
lib/htauth/cli/passwd.rb,
lib/htauth/digest_file.rb,
lib/htauth/passwd_file.rb,
lib/htauth/digest_entry.rb,
lib/htauth/passwd_entry.rb,
lib/htauth/descendant_tracker.rb

Overview

Defined Under Namespace

Modules: CLI, DescendantTracker Classes: Algorithm, Argon2, Bcrypt, Console, ConsoleError, Crypt, DigestEntry, DigestFile, DigestFileError, Entry, Error, File, FileAccessError, InvalidAlgorithmError, InvalidDigestEntry, InvalidPasswdEntry, Md5, PasswdEntry, PasswdFile, PasswdFileError, PasswordError, Plaintext, Sha1, TempFileError

Constant Summary collapse

VERSION =

Public: The version of the htauth library

"3.0.0"

Class Method Summary collapse

Class Method Details

.lib_path(*args) ⇒ Object



23
24
25
# File 'lib/htauth.rb', line 23

def self.lib_path(*args)
  sub_path("lib", *args)
end

.root_dirObject

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



14
15
16
17
18
19
20
21
# File 'lib/htauth.rb', line 14

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
  @root_dir
end

.sub_path(sub, *args) ⇒ Object



27
28
29
30
# File 'lib/htauth.rb', line 27

def self.sub_path(sub, *args)
  sp = ::File.join(root_dir, sub) + ::File::SEPARATOR
  ::File.join(sp, *args) if args
end