Module: Raggle::Path

Module | Raggle::Path
In: | raggle (CVS)

Basic path searching methods.

### Methods

find_app find_browser find_home find_web_ui_root

### Constants

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

### Public Class methods

find_app(app)

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

Example:

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

find_browser()

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()

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_ui_root()

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]