env_vars 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8ea2051edc275de193a7cd56396e672fd56f081
4
- data.tar.gz: eee02ef652b4dcd75f0da09550865bc46bca664f
3
+ metadata.gz: 28f7bbf699affb4b23e6c9abcaaefb143b325986
4
+ data.tar.gz: a9fc258b62f95ba09e1a4b35ceb9c6d11ff35589
5
5
  SHA512:
6
- metadata.gz: f6921934a70a78876d5fed00e4230043c22db2172d63b3122aedd4dbc57f9274030b034e12779a2c73f31c87112242447ddd4ae29e4784ca4ed593f4249d862e
7
- data.tar.gz: efd20f2d3c21cf05d741119d50bea3d998c111f74589697f505032e835b8c22fd6afea20333be1b143ed2b70e7606d848f5486f7b1f29cfcad6aa5efe4e5e741
6
+ metadata.gz: d27a2dbe351556de1ddfe61331460bf8cf5c91a0267bc83821a910de1cd6b74421b29d4098eaf9c0c5545bbf630096d083c31523ff1e3a764c0af7b03a39a2c6
7
+ data.tar.gz: 4dfd76afcf2eb77768e0369acdb4a8b80b16b1ebeb4487c229a9c7e5c210f37666fdf225408aa5e2c2161515c4095585b39d44a395f21d5d0cd893e335de7e12
data/README.md CHANGED
@@ -35,6 +35,12 @@ Config.timeout
35
35
  Config.force_ssl?
36
36
  ```
37
37
 
38
+ If you're using [dotenv](https://rubygems.org/gems/dotenv), you can simply require `env_vars/dotenv`. This will load environment variables from `.env.local`, `.env.%{environment}` and `.env` files. You _must_ add `dotenv` to your `Gemfile`.
39
+
40
+ ```ruby
41
+ require 'env_vars/dotenv'
42
+ ```
43
+
38
44
  ## Development
39
45
 
40
46
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -0,0 +1,5 @@
1
+ require 'env_vars'
2
+ require 'dotenv'
3
+
4
+ env = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
5
+ Dotenv.load '.env.local', ".env.#{env}", '.env'
data/lib/env_vars.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Env
2
2
  class Vars
3
- VERSION = '0.1.1'
3
+ VERSION = '0.2.0'
4
4
  BOOL_TRUE = ['yes', 'true', '1', true]
5
5
  BOOL_FALSE = ['no', 'false']
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: env_vars
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-13 00:00:00.000000000 Z
11
+ date: 2015-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,6 +83,7 @@ files:
83
83
  - Rakefile
84
84
  - env_vars.gemspec
85
85
  - lib/env_vars.rb
86
+ - lib/env_vars/dotenv.rb
86
87
  homepage: https://github.com/fnando/env_vars
87
88
  licenses:
88
89
  - MIT
@@ -103,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  version: '0'
104
105
  requirements: []
105
106
  rubyforge_project:
106
- rubygems_version: 2.4.6
107
+ rubygems_version: 2.4.5.1
107
108
  signing_key:
108
109
  specification_version: 4
109
110
  summary: Access environment variables. Also includes presence validation, type coercion