Module Raggle::Path
In: raggle  (CVS)

Basic path searching methods.

Methods

Constants

BROWSERS = %w{links elinks w3m lynx iexplore.exe explorer.exe}

Public Class methods

Find an application in your $PATH. Returns nil if the app couldn’t be found.

Example:

  Path::find_app('ls') #=> '/bin/ls'

Find browser, or exit if a browser cannot be found.

Checks for ENV[‘RAGGLE_BROWSER’], ENV[‘BROWSER’], then looks for "links", "elinks", "w3m", "lynx", then finally "explorer.exe". If all those fail, then dies with an error message.

Example:

  Path::find_browser #=> '/usr/bin/links'

Find home directory (different env vars on unix and win32).

Note: checks for ENV[‘HOME’], ENV[‘USERPROFILE’], then ENV[‘HOMEPATH’], and returns nil if none were found.

Example:

  Path::find_home #=> '/home/pabs'

Find web root (in win32 it’s located in the program dir by default)

Example:

  Path::find_web_ui_root #=> '/home/pabs/.raggle/web_ui'

[Validate]