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

application_env

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

application_env

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

application_env

Tests Gem Gem MIT License

Detect application environments.

Installation

gem install application_env

Or add the following line to your project's Gemfile:

gem "application_env"

Usage

The environment is inferred out of ENV["APP_ENV"], ENV["RACK_ENV"], ENV["RAILS_ENV"], defaulting to development in case no environment is set.

require "application_env"

app_env = AppEnv.new

app_env.development?
app_env.test?
app_env.production?

# runs block on production.
app_env.on(:production, &block)

# runs block on any environment.
app_env.on(:any, &block)

# pass in custom env vars
app_env = AppEnv.new({"APP_ENV" => "development"})

# sets up custom accessors
app_env = AppEnv.new(ENV, accessors: %i[development test staging production])
app_env.staging?

Maintainer

Contributors

Contributing

For more details about how to contribute, please read https://github.com/fnando/application_env/blob/main/CONTRIBUTING.md.

License

The gem is available as open source under the terms of the MIT License. A copy of the license can be found at https://github.com/fnando/application_env/blob/main/LICENSE.md.

Code of Conduct

Everyone interacting in the application_env project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 29 Nov 2022

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