dotenv 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog.md +13 -0
- data/Gemfile +1 -0
- data/README.md +19 -1
- data/dotenv.gemspec +1 -1
- data/lib/dotenv/version.rb +1 -1
- metadata +2 -5
- data/dotenv-rails.gemspec +0 -18
- data/lib/dotenv-rails.rb +0 -1
- data/lib/dotenv/railtie.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cce545159cfd5b2760d935e32c63de6d00351b75
|
4
|
+
data.tar.gz: d28a58b874827bd2419da6a186d0553563cc0a7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5983f239a869fa1480d0604ba55bcc98f3306af3aed5ec6251ceb685460adda7d691975eaefa5bffeb1b3fa8dbd4eaee9df855a6c62251893d8c61274c2fafd0
|
7
|
+
data.tar.gz: f709294d266b13935e00551f427f9a433fe4b996d786df20e4af9b37fc41ea3a3f8d4d3f10aae83b50c7c05e28f012ae610422006e1fe93b16c241b61c5a9195
|
data/Changelog.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.0.2 - Oct 14, 2014
|
4
|
+
|
5
|
+
* Define `#load` on `Dotenv::Railtie`, which can be called to manually load `dotenv` before Rails has initialized.
|
6
|
+
|
7
|
+
* add `dotenv/rails-now`, which can be required in the `Gemfile` to immidately load dotenv.
|
8
|
+
|
9
|
+
gem 'dotenv-rails', :require => 'dotenv/rails-now'
|
10
|
+
gem 'gem-that-requires-env-variables'
|
11
|
+
|
12
|
+
[Full Changelog](https://github.com/bkeepers/dotenv/compare/v1.0.1...v1.0.2)
|
13
|
+
|
3
14
|
## 1.0.1 - Oct 4, 2014
|
4
15
|
|
5
16
|
* Fix load error with Spring when running `rails server` ([#140](https://github.com/bkeepers/dotenv/issues/140))
|
@@ -8,6 +19,8 @@
|
|
8
19
|
|
9
20
|
## 1.0.0 - Oct 3, 2014
|
10
21
|
|
22
|
+
* dotenv-rails is now loaded during the `before_configuration` callback, which is fired when the `Application` constant is defined (`class Application < Rails::Application`).
|
23
|
+
|
11
24
|
* Remove deprecated features. Upgrade to 0.11.0 and fix deprecation warnings before upgrading to 1.0.0.
|
12
25
|
|
13
26
|
* Watch .env for changes with Spring in Rails 4 ([#118](https://github.com/bkeepers/dotenv/pull/118))
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -24,7 +24,25 @@ And then execute:
|
|
24
24
|
$ bundle
|
25
25
|
```
|
26
26
|
|
27
|
-
|
27
|
+
#### Note on load order
|
28
|
+
|
29
|
+
dotenv is initialized in your Rails app during the `before_configuration` callback, which is fired when the `Application` constant is defined in `config/application.rb` with `class Application < Rails::Application`. If you need it to be initialized sooner, you can manually call `Dotenv::Railtie.load`.
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
# config/application.rb
|
33
|
+
Bundler.require(*Rails.groups)
|
34
|
+
|
35
|
+
Dotenv::Railtie.load
|
36
|
+
|
37
|
+
HOSTNAME = ENV['HOSTNAME']
|
38
|
+
```
|
39
|
+
|
40
|
+
If you use gems that require environment variables to be set before they are loaded, then list `dotenv-rails` in the `Gemfile` before those other gems and require `dotenv/rails-now`.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
gem 'dotenv-rails', :require => 'dotenv/rails-now'
|
44
|
+
gem 'gem-that-requires-env-variables'
|
45
|
+
```
|
28
46
|
|
29
47
|
### Sinatra or Plain ol' Ruby
|
30
48
|
|
data/dotenv.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.homepage = "https://github.com/bkeepers/dotenv"
|
11
11
|
gem.license = 'MIT'
|
12
12
|
|
13
|
-
gem.files = `git ls-files`.split($\)
|
13
|
+
gem.files = `git ls-files | grep -v rails`.split($\)
|
14
14
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
15
15
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
16
|
gem.name = "dotenv"
|
data/lib/dotenv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotenv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -56,13 +56,10 @@ files:
|
|
56
56
|
- README.md
|
57
57
|
- Rakefile
|
58
58
|
- bin/dotenv
|
59
|
-
- dotenv-rails.gemspec
|
60
59
|
- dotenv.gemspec
|
61
|
-
- lib/dotenv-rails.rb
|
62
60
|
- lib/dotenv.rb
|
63
61
|
- lib/dotenv/environment.rb
|
64
62
|
- lib/dotenv/parser.rb
|
65
|
-
- lib/dotenv/railtie.rb
|
66
63
|
- lib/dotenv/substitutions/command.rb
|
67
64
|
- lib/dotenv/substitutions/variable.rb
|
68
65
|
- lib/dotenv/tasks.rb
|
data/dotenv-rails.gemspec
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path('../lib/dotenv/version', __FILE__)
|
3
|
-
|
4
|
-
Gem::Specification.new do |gem|
|
5
|
-
gem.version = Dotenv::VERSION
|
6
|
-
gem.authors = ["Brandon Keepers"]
|
7
|
-
gem.email = ["brandon@opensoul.org"]
|
8
|
-
gem.description = %q{Autoload dotenv in Rails.}
|
9
|
-
gem.summary = %q{Autoload dotenv in Rails.}
|
10
|
-
gem.homepage = "https://github.com/bkeepers/dotenv"
|
11
|
-
gem.license = 'MIT'
|
12
|
-
|
13
|
-
gem.files = ["lib/dotenv-rails.rb"]
|
14
|
-
gem.name = "dotenv-rails"
|
15
|
-
gem.require_paths = ["lib"]
|
16
|
-
|
17
|
-
gem.add_dependency 'dotenv', Dotenv::VERSION
|
18
|
-
end
|
data/lib/dotenv-rails.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require "dotenv/railtie"
|
data/lib/dotenv/railtie.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'dotenv'
|
2
|
-
|
3
|
-
module Dotenv
|
4
|
-
class Railtie < Rails::Railtie
|
5
|
-
config.before_configuration do
|
6
|
-
Dotenv.load Rails.root.join('.env')
|
7
|
-
|
8
|
-
begin
|
9
|
-
require "spring/watcher"
|
10
|
-
Spring.watch Rails.root.join('.env')
|
11
|
-
rescue LoadError
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|