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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0423eb22082c5f775c25c56686eb943f899e6aba
4
- data.tar.gz: ac0d7784f49ac0ccc5688b0afa23e35dead9d829
3
+ metadata.gz: ee093a7ca1967322db09090bc8ee1c980d7fcf07
4
+ data.tar.gz: aa01b9820edb3e8fe35883184f3d5f6e3e6f83a9
5
5
  SHA512:
6
- metadata.gz: 8963f13406a5ac9fa0e66b924d4680ba4273d2b177b72b2aadf07f68e13b943a1d19633b3c82b6e6ba7deb3ee995fe636fa878f6e558e39749ad908edb5c7a74
7
- data.tar.gz: a8a46cf837becd6f9bbd44126dff6b972b8d12ef72522aaeefd00f9128280ee14378a13ee904a251f134e09ed9fbf9683846e6302301c05266e37845993a6032
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 install 'envkey'
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
- On your servers, set the `ENVKEY` as an environment variable instead of putting it in a `.env` file.
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
- dev_vals.include?(ENV["RACK_ENV"])
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
@@ -1,4 +1,4 @@
1
1
  module Envkey
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  ENVKEY_FETCH_VERSION="1.0.0"
4
4
  end
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.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-09-23 00:00:00.000000000 Z
11
+ date: 2017-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler