voltos 0.0.91 → 0.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +49 -10
- data/lib/voltos/version.rb +1 -1
- data/voltos.gemspec +2 -2
- metadata +16 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 183c110bb7f2b1f56deb19eafb077c0fcd831752
|
4
|
+
data.tar.gz: baae03c07b0dca53be3ce5313342302a0a95f94f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3fd8f96975eb575fdce506196fea796ff66aaca54e0d22af5579e3064c7b8080be56fa3991780173b4823bb58ea2d99d5a8a9af01ecaddf06b8e9668bf31ded
|
7
|
+
data.tar.gz: eb96beb92b2ca1321b71f93fb77c0067e1abaa59fc69f102b3da76f9f8eb7d0c7e7eec8009591085ab79633a4cf3d2c0887096ab2aa386b7f53ce2c4f8435e73
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Voltos
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# Voltos
|
1
|
+
# Voltos Ruby bindings
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
This gem provides Voltos Ruby bindings for provide a small SDK for access to the Voltos API from apps written in Ruby. Voltos ([https://voltos.online](https://voltos.online)) provides credentials-as-a-service for app and system developers.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -20,17 +18,58 @@ Or install it yourself as:
|
|
20
18
|
|
21
19
|
$ gem install voltos
|
22
20
|
|
23
|
-
##
|
21
|
+
## Getting started
|
22
|
+
|
23
|
+
1. Find your unique Voltos API key. See "Account" settings.
|
24
|
+
|
25
|
+
2. Set this key as an environment variable, e.g.
|
26
|
+
```ruby
|
27
|
+
$ export VOLTOS_KEY=13579def13579def
|
28
|
+
|
29
|
+
# or on a platform like Heroku
|
30
|
+
$ heroku config:set VOLTOS_KEY=13579def13579def
|
31
|
+
```
|
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
|
+
|
52
|
+
```ruby
|
53
|
+
Voltos.configure do |config|
|
54
|
+
config.api_key = ENV["VOLTOS_KEY"]
|
55
|
+
end
|
24
56
|
|
25
|
-
|
57
|
+
Voltos.load
|
58
|
+
ENV["ANALYTICS_KEY"] = Voltos.key("myapp-dev", "ANALYTICS_KEY")
|
59
|
+
```
|
26
60
|
|
27
|
-
|
61
|
+
Then in ``config/environments/production.rb``:
|
28
62
|
|
29
|
-
|
63
|
+
```ruby
|
64
|
+
Voltos.configure do |config|
|
65
|
+
config.api_key = ENV["VOLTOS_KEY"]
|
66
|
+
end
|
30
67
|
|
31
|
-
|
68
|
+
Voltos.load
|
69
|
+
ENV["ANALYTICS_KEY"] = Voltos.key("myapp-prod", "ANALYTICS_KEY")
|
70
|
+
```
|
32
71
|
|
33
72
|
## Contributing
|
34
73
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
74
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/voltos-online/voltos-ruby
|
36
75
|
|
data/lib/voltos/version.rb
CHANGED
data/voltos.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency "bundler", "~> 1.11"
|
30
30
|
spec.add_development_dependency "rake", "~> 10.0"
|
31
31
|
spec.add_development_dependency "rspec", "~> 3.0"
|
32
|
-
spec.add_development_dependency "curb", '~> 0'
|
32
|
+
# spec.add_development_dependency "curb", '~> 0'
|
33
33
|
# spec.add_development_dependency "json", '~> 1.8.3'
|
34
34
|
spec.add_development_dependency 'json', '~> 1.8', '>= 1.8.3'
|
35
35
|
|
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
|
|
39
39
|
# spec.add_development_dependency 'curb', '~> 0'
|
40
40
|
# spec.add_development_dependency "json"
|
41
41
|
|
42
|
-
|
42
|
+
spec.add_runtime_dependency "curb", [">= 0"]
|
43
43
|
# spec.add_runtime_dependency "json", [">= 0"]
|
44
44
|
# add_runtime_dependency 'curb', '>= 0', '~> 0'
|
45
45
|
end
|
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.0.
|
4
|
+
version: 0.0.93
|
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-
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,39 +53,39 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: json
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.8'
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 1.8.3
|
62
65
|
type: :development
|
63
66
|
prerelease: false
|
64
67
|
version_requirements: !ruby/object:Gem::Requirement
|
65
68
|
requirements:
|
66
69
|
- - "~>"
|
67
70
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
71
|
+
version: '1.8'
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 1.8.3
|
69
75
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
76
|
+
name: curb
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '1.8'
|
76
79
|
- - ">="
|
77
80
|
- !ruby/object:Gem::Version
|
78
|
-
version:
|
79
|
-
type: :
|
81
|
+
version: '0'
|
82
|
+
type: :runtime
|
80
83
|
prerelease: false
|
81
84
|
version_requirements: !ruby/object:Gem::Requirement
|
82
85
|
requirements:
|
83
|
-
- - "~>"
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '1.8'
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: '0'
|
89
89
|
description:
|
90
90
|
email:
|
91
91
|
- daniel@thedanielmay.com
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- ".gitignore"
|
97
97
|
- ".travis.yml"
|
98
98
|
- Gemfile
|
99
|
+
- LICENSE
|
99
100
|
- README.md
|
100
101
|
- Rakefile
|
101
102
|
- bin/console
|