Sha256: 93b7bdb122236f07518ca355fcd483e1cbaa2fa4e0af5617a22bfda62ff19eb9

Contents?: true

Size: 1.44 KB

Versions: 2

Compression:

Stored size: 1.44 KB

Contents

# Env

* [Homepage](http://github.com/postmodern/env)
* [Issues](http://github.com/postmodern/env/issues)
* [Documentation](http://rubydoc.info/gems/env)
* Postmodern (postmodern.mod3 at gmail.com)

## Description

{Env} provides a Ruby interface to common environment variables, used on
Linux, BSD, OSX and Windows.

## Features

* Provides access to:
  * `HOME` (or `HOMEPATH` on Windows)
  * `PATH`
  * `LD_LIBRARY_PATH`
  * `SHELL`
  * `TERM` and `COLORTERM`
  * `COLOMNS`
  * `LINES`
  * `EDITOR`
  * `BROWSER`
  * `LANG`

## Examples

    require 'env'

Transparently access environment variables as a Hash:

    Env['DESKTOP_SESSION']
    # => "gnome"

Transparently access environment variables as Constants:

    Env::DESKTOP_SESSION
    # => "gnome"

Transparently access environment variables with methods:

    Env.desktop_session
    # => "gnome"

Parse complex variables:

    Env.home
    # => #<Pathname:/home/alice>

    Env.paths
    # => [#<Pathname:/usr/local/bin>, #<Pathname:/usr/bin>, #<Pathname:/bin>, #<Pathname:/usr/local/sbin>, #<Pathname:/usr/sbin>, #<Pathname:/sbin>]

    Env.lang
    # => ["en_US", "utf8"]

    Env.terminal
    # => "gnome-terminal"

    Env.shell
    # => "/bin/bash"

    Env.editor
    # => "vim"

Only access the common variables from your Class:

    class Project

      include Env::Variables

    end

## Install

    $ gem install env

## Copyright

Copyright (c) 2011 Hal Brodigan

See {file:LICENSE.txt} for details.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
env-0.1.2 README.md
env-0.1.0 README.md