dotenv-rails 2.0.0.beta → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/lib/dotenv/rails-now.rb +1 -1
- data/lib/dotenv/rails.rb +6 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0d712ccf911d9509175afbdc7b050eb45a9f1d3
|
4
|
+
data.tar.gz: 5e9c1e0befc03daa04850860a945162cf753f653
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35d6c21fd8cfef23adbb4998431c98e35507cff2db58fb023aef212f371f5644dbd9d46fde5bdb69e0ea2b9fa7e3617dfa369d491c6edfdaf40d1cf9aa84ea9f
|
7
|
+
data.tar.gz: 1a3a8eb1d9e4f63f5e7f273446e5fa1cde7779d8433d686af4c577b104b7fa18184613c05b0dddef9075f997c470c3ee1f0153b7bc69f2839911c77b24d19f8e
|
data/README.md
CHANGED
@@ -101,9 +101,19 @@ Whenever your application loads, these variables will be available in `ENV`:
|
|
101
101
|
config.fog_directory = ENV['S3_BUCKET']
|
102
102
|
```
|
103
103
|
|
104
|
+
Comments may be added to your file as such:
|
105
|
+
|
106
|
+
```shell
|
107
|
+
# This is a comment
|
108
|
+
SECRET_KEY=YOURSECRETKEYGOESHERE # comment
|
109
|
+
SECRET_HASH="something-with-a-#-hash"
|
110
|
+
```
|
111
|
+
|
112
|
+
Variable names may not contain the `#` symbol. Values can use the `#` if they are enclosed in quotes.
|
113
|
+
|
104
114
|
## Multiple Rails Environments
|
105
115
|
|
106
|
-
dotenv was originally created to load configuration variables into `ENV` in *development*. There are typically better ways to manage configuration in production environments
|
116
|
+
dotenv was originally created to load configuration variables into `ENV` in *development*. There are typically better ways to manage configuration in production environments - such as `/etc/environment` managed by [Puppet](https://github.com/puppetlabs/puppet) or [Chef](https://github.com/opscode/chef), `heroku config`, etc.
|
107
117
|
|
108
118
|
However, some find dotenv to be a convenient way to configure Rails applications in staging and production environments, and you can do that by defining environment-specific files like `.env.production` or `.env.test`.
|
109
119
|
|
data/lib/dotenv/rails-now.rb
CHANGED
data/lib/dotenv/rails.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require "dotenv"
|
2
2
|
|
3
3
|
Dotenv.instrumenter = ActiveSupport::Notifications
|
4
4
|
|
5
5
|
# Watch all loaded env files with Spring
|
6
6
|
begin
|
7
|
-
require
|
7
|
+
require "spring/watcher"
|
8
8
|
ActiveSupport::Notifications.subscribe(/^dotenv/) do |*args|
|
9
9
|
event = ActiveSupport::Notifications::Event.new(*args)
|
10
10
|
Spring.watch event.payload[:env].filename if Rails.application
|
@@ -14,6 +14,8 @@ rescue LoadError
|
|
14
14
|
end
|
15
15
|
|
16
16
|
module Dotenv
|
17
|
+
# Dotenv Railtie for using Dotenv to load environment from a file into
|
18
|
+
# Rails applications
|
17
19
|
class Railtie < Rails::Railtie
|
18
20
|
config.before_configuration { load }
|
19
21
|
|
@@ -25,13 +27,13 @@ module Dotenv
|
|
25
27
|
Dotenv.load(
|
26
28
|
root.join(".env.local"),
|
27
29
|
root.join(".env.#{Rails.env}"),
|
28
|
-
root.join(
|
30
|
+
root.join(".env")
|
29
31
|
)
|
30
32
|
end
|
31
33
|
|
32
34
|
# Internal: `Rails.root` is nil in Rails 4.1 before the application is
|
33
35
|
# initialized, so this falls back to the `RAILS_ROOT` environment variable,
|
34
|
-
# or the current
|
36
|
+
# or the current working directory.
|
35
37
|
def root
|
36
38
|
Rails.root || Pathname.new(ENV["RAILS_ROOT"] || Dir.pwd)
|
37
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotenv-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0.0
|
19
|
+
version: 2.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.0.0
|
26
|
+
version: 2.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spring
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,9 +79,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
79
79
|
version: '0'
|
80
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- - "
|
82
|
+
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
84
|
+
version: '0'
|
85
85
|
requirements: []
|
86
86
|
rubyforge_project:
|
87
87
|
rubygems_version: 2.2.2
|