RubyGems Navigation menu

home-dotenv 0.0.1

# `home-dotenv` ## Instalation ``ruby gem install home-dotenv # or in a Gemfile gem 'home-dotenv' ``` ## Explanation So, you have scripts run on your system and you have config variables for those scripts (keys, usernames, passwords, hostnames, etc). A unified way to access those globals would be nice instead of hard-coding them or passing them as parameters. So, now you can put all your variables in ~/.env like so: ``` SUPER_SECRET_PASSWORD=i-definitely-don-t-want-people-to-see-this AWS_KEY=abcdefgh SECRET_HOST=https://private.secret.com ``` Then, in your scripts: ``` require 'home-dotenv' HOME_ENV = HomeDotenv.parse require 'open-uri' open(HOME_HOME[:SECRET_HOST]).read ``` Parsing rules: - if the line is empty or starts by "#" (comment), ignore - otherwise, string before the first "=" is key, after that it's the value - result is a hash indexed by symbol, e.g. HOME_ENV[:AWS_KEY]

Gemfile:
=

安裝:
=

版本列表:

  1. 0.0.5 April 26, 2017 (4.5 KB)
  2. 0.0.4 February 26, 2017 (4.5 KB)
  3. 0.0.3 February 26, 2017 (4.5 KB)
  4. 0.0.2 February 26, 2017 (4.0 KB)
  5. 0.0.1 February 26, 2017 (4.5 KB)

擁有者:

作者:

  • Dorian Marié

SHA 256 總和檢查碼:

=

總下載次數 9,952

這個版本 1,811

版本发布:

授權:

MIT

Ruby 版本需求: >= 0

相關連結: