8000 GitHub - grezar/env_detective: Detect environment variables referred from ruby
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

grezar/env_detective

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EnvDetective

Build Status

This gem is for detecting environment variables referred from ruby.

In the case which multiple applications share the same server and so many environment variables are exported in it, it may difficult to grasp which environment variable is referred from which application.

ENV.[] and ENV.fetch will be caught and logged by this gem. It helps you to grasp the above thing.

I wouldn't recommend using this gem in production. You would achieve the purpose even in a staging or another environment.

Installation

Add this line to your application's Gemfile:

gem 'env_detective'

And then execute:

$ bundle

Or install it yourself as:

$ gem install env_detective

Usage

Minimum

This will override ENV and when ENV is referred, that will be logged to STDOUT.

require 'env_detective'

ENV = EnvDetective.extend(ENV)

Use another logger

If you want to use another logger or change output file, you can set logger like below.

require "env_detective"
require "logger"

EnvDetective.configure do |config|
  config.logger = Logger.new(File.join(__dir__, 'log/env_detective.log'))
end

ENV = EnvDetective.extend(ENV)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/grezar/env_detective.

License

The gem is available as open source under the terms of the MIT License.

About

Detect environment variables referred from ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0