doppler 1.0.3 → 1.0.4

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: 5d303fcb3660df971db06bd9c2206d06c8a2e0e5
4
- data.tar.gz: 876807ca51165604c8f5b2126febfd486616643c
3
+ metadata.gz: d5df91c5eb6e0b6d07e4a7771edbe786590e299d
4
+ data.tar.gz: 937224bac2be918f6fd08fb20250b9e1bebb9fe6
5
5
  SHA512:
6
- metadata.gz: 660925bf24c7e24c4cebf2d5d530ab4c8b42dee09bc62186e8868eb007801e72307ae17e11f7d2af34471f3435041d0dec750a607e6c7cf0a8556f4fd8a15b55
7
- data.tar.gz: baf51f7cbb44c352a353797da9e4c2b23be4b13777fbb7300f371b079ceae220241c97b8cc47d4800b5733d091a24bc5d81e6a155f8040087e48b7c653f36f4d
6
+ metadata.gz: f7cf0d3c5915e1ce2f47b9ade03ef9818c1429665c61a846aeeb0db26dbc9f345e213d26166d675c311dc4b4be2d1eed8356ef4dad7548aa24b2bd0c10decdd4
7
+ data.tar.gz: e62074428e64bf914b97a60ac36e0a016029cf6ce72ea4ed547f68bfa8ee14f0a59cf10432994dac0d8a297d937785e22b9e2b834afcaf362f20e24ee9e460b7
data/README.md CHANGED
@@ -88,6 +88,21 @@ That is a great question! We recommend storing your `DOPPLER_API_KEY`, `DOPPLER_
88
88
  in a `.env` file or with your infra provider. That means the only variables you should be storing in your local environment are the Doppler keys. All other variables should be be fetched by the Doppler client.
89
89
 
90
90
 
91
+ ### Disable Overriding Environment Variables
92
+ If you would like to disable overriding environment variables, use this follow field.
93
+
94
+ ``` ruby
95
+ Doppler.configure do |config|
96
+ config.override = false
97
+ end
98
+
99
+ doppler = Doppler::Client.new()
100
+
101
+ # Rest of Your Application
102
+ example_variable = doppler.get("EXAMPLE_VARIABLE")
103
+ ```
104
+
105
+
91
106
  ## Ignoring Specific Variables
92
107
 
93
108
  In the case you would want to ignore specific variables from Doppler, say a port set by Heroku, you can add it the `ignore_variables` field.
@@ -46,6 +46,15 @@ module Doppler
46
46
  @@ignore_variables
47
47
  end
48
48
 
49
+ # configure override
50
+ @@override = true
51
+ def self.override=(override)
52
+ @@override = override
53
+ end
54
+ def self.override
55
+ @@override
56
+ end
57
+
49
58
  # configure backup file
50
59
  @@backup_filepath = nil
51
60
  def self.backup_filepath=(backup_filepath)
@@ -26,9 +26,11 @@ module Doppler
26
26
  def startup
27
27
  resp = self._request('/v1/variables')
28
28
  @remote_keys = resp.fetch("variables")
29
-
30
- overwrite_env()
31
29
  write_to_backup()
30
+
31
+ if Doppler.override
32
+ overwrite_env()
33
+ end
32
34
  end
33
35
 
34
36
 
@@ -56,6 +58,11 @@ module Doppler
56
58
  file.close
57
59
  end
58
60
  end
61
+
62
+
63
+ def get(name)
64
+ return @remote_keys.fetch(name)
65
+ end
59
66
 
60
67
 
61
68
  def _request(endpoint, retry_count=0)
@@ -1,3 +1,3 @@
1
1
  module Doppler
2
- VERSION = "1.0.3".freeze
2
+ VERSION = "1.0.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doppler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doppler Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-08 00:00:00.000000000 Z
11
+ date: 2019-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler