dotenv 1.0.1 → 1.0.2

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: 2909dd72a57cf2db579c7d0150f9300d0dca78c5
4
- data.tar.gz: 809c0173b3ef00f36ea6d741949d74d8f544e99e
3
+ metadata.gz: cce545159cfd5b2760d935e32c63de6d00351b75
4
+ data.tar.gz: d28a58b874827bd2419da6a186d0553563cc0a7f
5
5
  SHA512:
6
- metadata.gz: 052edd1c3120f6bb90cba716b64147c6aa8261d1ecb7e6b9e39bb01d445b22caa29da5c686ab8f326420f1c0a1ba39fb2aa80f7e3a589e863099d16cc8db3e2f
7
- data.tar.gz: 5ed2d634130c83788b9d3a21204952fe257c046df600b1f07e1d2cbcfb3f934dc34f8bb43f895effb86a69826ad027f6041985dbbbe5551723334a9ed9cffa87
6
+ metadata.gz: 5983f239a869fa1480d0604ba55bcc98f3306af3aed5ec6251ceb685460adda7d691975eaefa5bffeb1b3fa8dbd4eaee9df855a6c62251893d8c61274c2fafd0
7
+ data.tar.gz: f709294d266b13935e00551f427f9a433fe4b996d786df20e4af9b37fc41ea3a3f8d4d3f10aae83b50c7c05e28f012ae610422006e1fe93b16c241b61c5a9195
@@ -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
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec :name => 'dotenv'
3
+ gemspec :name => 'dotenv-rails'
3
4
 
4
5
  gem 'dotenv-deployment', :github => 'bkeepers/dotenv-deployment'
5
6
 
data/README.md CHANGED
@@ -24,7 +24,25 @@ And then execute:
24
24
  $ bundle
25
25
  ```
26
26
 
27
- It should be listed in the Gemfile before any other gems that use environment variables, otherwise those gems will get initialized with the wrong values.
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
 
@@ -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"
@@ -1,3 +1,3 @@
1
1
  module Dotenv
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
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.1
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-04 00:00:00.000000000 Z
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
@@ -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
@@ -1 +0,0 @@
1
- require "dotenv/railtie"
@@ -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