envkey 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/envkey/fetch.rb +2 -1
- data/lib/envkey/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee093a7ca1967322db09090bc8ee1c980d7fcf07
|
4
|
+
data.tar.gz: aa01b9820edb3e8fe35883184f3d5f6e3e6f83a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3be05d7fc4f20b8fd6e12fa8ac90d78523a423c952df083875eedfe157f389450bca71ad26ca5dc0608835ddcc64f9b90fa3bca979a6bbd0335fe9f03a212de
|
7
|
+
data.tar.gz: a75173aea4ad5488ae2552f8e27586de938c7111fa58529a02e1874d36b57b9909aaa8adc79ffc76e4897bce4f4d668ba78417d3378210cb66409269af655c25
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# envkey
|
1
|
+
# envkey gem
|
2
2
|
|
3
3
|
Integrate [EnvKey](https://www.envkey.com) with your Ruby or Ruby On Rails projects to keep api keys, credentials, and other configuration securely and automatically in sync for developers and servers.
|
4
4
|
|
@@ -7,12 +7,12 @@ Integrate [EnvKey](https://www.envkey.com) with your Ruby or Ruby On Rails proje
|
|
7
7
|
In your Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem
|
10
|
+
gem 'envkey'
|
11
11
|
```
|
12
12
|
|
13
13
|
If you're using Rails, that's all you need. In plain Ruby, you need to require envkey at the entry point of your application.
|
14
14
|
|
15
|
-
```
|
15
|
+
```ruby
|
16
16
|
require 'envkey'
|
17
17
|
```
|
18
18
|
|
@@ -45,7 +45,7 @@ Stripe.api_key = ENV.fetch("STRIPE_SECRET_KEY")
|
|
45
45
|
|
46
46
|
Now `STRIPE_SECRET_KEY` will stay automatically in sync for all the developers on your team.
|
47
47
|
|
48
|
-
|
48
|
+
For a server, generate a server `ENVKEY` in the EnvKey App, then set the `ENVKEY` as an environment variable instead of putting it in a `.env` file.
|
49
49
|
|
50
50
|
Now your servers will stay in sync as well. If you need to rotate your `STRIPE_SECRET_KEY` you can do it in a few seconds in the EnvKey App, restart your servers, and you're good to go. All your team's developers and all your servers will have the new value.
|
51
51
|
|
@@ -57,6 +57,8 @@ The envkey gem will not overwrite existing environment variables or additional v
|
|
57
57
|
|
58
58
|
The envkey gem caches your encrypted config in development so that you can still use it while offline. Your config will still be available (though possibly not up-to-date) the next time you lose your internet connection. If you do have a connection available, envkey will always load the latest config. Your cached encrypted config is stored in `$HOME/.envkey/cache`
|
59
59
|
|
60
|
+
For caching purposes, the gem assumes you're in development mode if either `ENV["RAILS_ENV"]` or `ENV["RACK_ENV"]` is `"development"` or `"test"`. If you aren't using Rails or Rack, then it's assumed you're in development mode when a `.env` file exists in the root of your project.
|
61
|
+
|
60
62
|
## Further Reading
|
61
63
|
|
62
64
|
For more on EnvKey in general:
|
data/lib/envkey/fetch.rb
CHANGED
@@ -10,7 +10,8 @@ module Envkey::Fetch
|
|
10
10
|
def self.is_dev
|
11
11
|
dev_vals = %w(development test)
|
12
12
|
dev_vals.include?(ENV["RAILS_ENV"]) ||
|
13
|
-
|
13
|
+
dev_vals.include?(ENV["RACK_ENV"]) ||
|
14
|
+
(ENV["RAILS_ENV"].nil? && ENV["RACK_ENV"].nil? && File.exist?(".env"))
|
14
15
|
end
|
15
16
|
|
16
17
|
end
|
data/lib/envkey/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envkey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dane Schneider
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|