Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

env

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env

  • 0.3.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Env

  • Homepage
  • Issues
  • Documentation
  • [Email](mailto: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
    • TZ
    • DEBUG

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 (c) 2011-2012 Hal Brodigan

See {file:LICENSE.txt} for details.

FAQs

Package last updated on 28 May 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc