voltos 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -38
- data/lib/voltos/version.rb +1 -1
- data/lib/voltos.rb +5 -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: f4a9232be59e0741a341ca3a1943193065ac1f30
|
4
|
+
data.tar.gz: 834922be6fa5007ab33c003a7d6db02844d67ec0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05c840cf8ee45113e9947f59244910bedb483232bf8c4be518e9091bce98a9511c653971f3a34860f34d4207d32cc21770674ac50df41a7926e7012347fcd67f
|
7
|
+
data.tar.gz: ea54395afa3f468b0e50b3a91f9223a974a91eca82509cf4f397919cd70cf59d115306eb2353a354e321deeb1cfbedb60ecc8739d733a4ff84f57171c34e35f5
|
data/README.md
CHANGED
@@ -20,53 +20,22 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Getting started
|
22
22
|
|
23
|
-
1. Find your unique Voltos API key. See "
|
23
|
+
1. Find your unique Voltos API key. See "Bundle" settings.
|
24
24
|
|
25
25
|
2. Set this key as an environment variable, e.g.
|
26
26
|
```ruby
|
27
27
|
$ export VOLTOS_KEY=13579def13579def
|
28
|
-
|
28
|
+
|
29
29
|
# or on a platform like Heroku
|
30
|
-
$ heroku config:set VOLTOS_KEY=13579def13579def
|
30
|
+
$ heroku config:set VOLTOS_KEY=13579def13579def
|
31
31
|
```
|
32
32
|
We'll use this key to load up our Voltos credentials (don't worry, you'll only need to set one key this way).
|
33
|
-
|
34
|
-
3. Load up the Voltos credentials. You'll probably want them early on, prior to where your trying to use them (e.g. in ``environment.rb`` in Rails).
|
35
|
-
```ruby
|
36
|
-
Voltos.configure do |config|
|
37
|
-
config.api_key = ENV["VOLTOS_KEY"]
|
38
|
-
end
|
39
|
-
|
40
|
-
# load all the bundles of credentials for that API key
|
41
|
-
Voltos.load
|
42
|
-
|
43
|
-
# access the credential "MAILER_API_TOKEN" that's in the "myapp-prod" bundle
|
44
|
-
ENV["MAILER_API_TOKEN"] = Voltos.key("myapp-prod", "MAILER_API_TOKEN")
|
45
|
-
```
|
46
|
-
Note that we're grabbing the credential and stashing it in an environment variable (``MAILER_API_TOKEN``). This fits pretty well with existing idiom, plus ensures that existing code using environment variables keeps working with no change.
|
47
|
-
|
48
|
-
4. You can load different credentials for different environments. For example: let's say you've bundled your credentials into ``myapp-dev`` and ``myapp-prod`` bundles (for development and production environments, respectively).
|
49
|
-
|
50
|
-
In ``config/environments/development.rb``:
|
51
33
|
|
34
|
+
3. Require the `voltos` gem early on, prior to where your trying to use any credentials
|
52
35
|
```ruby
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
Voltos.load
|
58
|
-
ENV["ANALYTICS_KEY"] = Voltos.key("myapp-dev", "ANALYTICS_KEY")
|
59
|
-
```
|
60
|
-
|
61
|
-
Then in ``config/environments/production.rb``:
|
62
|
-
|
63
|
-
```ruby
|
64
|
-
Voltos.configure do |config|
|
65
|
-
config.api_key = ENV["VOLTOS_KEY"]
|
66
|
-
end
|
67
|
-
|
68
|
-
Voltos.load
|
69
|
-
ENV["ANALYTICS_KEY"] = Voltos.key("myapp-prod", "ANALYTICS_KEY")
|
36
|
+
require 'voltos'
|
37
|
+
# access the credential "MAILER_API_TOKEN" that's in the bundle
|
38
|
+
puts ENV["MAILER_API_TOKEN"]
|
70
39
|
```
|
71
40
|
|
72
41
|
## Contributing
|
data/lib/voltos/version.rb
CHANGED
data/lib/voltos.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voltos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel May
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|