envme 0.0.1 → 0.0.2
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/README.md +3 -0
- data/lib/envme/configuration.rb +1 -1
- data/lib/envme/version.rb +1 -1
- data/lib/envme.rb +1 -3
- data/spec/configuration_spec.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7205bdd99d07269759477f720be981bcf41b553f
|
4
|
+
data.tar.gz: 44fe437c2e0820ba493986af0cc7f05612b60be3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de8333c649d11f501294f1f1fb3ed53f6f03bbab812a103602da8c7ca57b6e6c30947ddf089aa678b824971c5c9437305d62835b52c3b1a73a36ae7a301724be
|
7
|
+
data.tar.gz: b7b2113f59fb9a8a31a5b0cae84f56d82a4052bd9b78f8ec07510e7bad2e045748a3f31c0d52cebd030bd923282415481274f0f80f1d57d2dd660792762bc4f7
|
data/README.md
CHANGED
@@ -1 +1,4 @@
|
|
1
1
|
# Envme
|
2
|
+
[](http://badge.fury.io/rb/envme) [](https://circleci.com/gh/reppard/envme)
|
3
|
+
|
4
|
+
Based on the fine work of [Diplomat](https://github.com/WeAreFarmGeek/diplomat)
|
data/lib/envme/configuration.rb
CHANGED
@@ -2,7 +2,7 @@ module Envme
|
|
2
2
|
class Configuration
|
3
3
|
attr_accessor :url, :acl_token, :options
|
4
4
|
|
5
|
-
def initialize(url="localhost:8500", acl_token=
|
5
|
+
def initialize(url="localhost:8500", acl_token= 'anonymous', options = {})
|
6
6
|
@url = url
|
7
7
|
@acl_token = acl_token
|
8
8
|
@options = options
|
data/lib/envme/version.rb
CHANGED
data/lib/envme.rb
CHANGED
@@ -61,12 +61,10 @@ module Envme
|
|
61
61
|
|
62
62
|
private
|
63
63
|
def run_cmd(prefix)
|
64
|
-
token = 'anonymous' || self.configuration.acl_token
|
65
|
-
|
66
64
|
`envconsul -once \
|
67
65
|
-consul #{self.configuration.url} \
|
68
66
|
-prefix #{prefix} -upcase \
|
69
|
-
-token #{
|
67
|
+
-token #{self.configuration.acl_token} -sanitize env`
|
70
68
|
end
|
71
69
|
end
|
72
70
|
end
|
data/spec/configuration_spec.rb
CHANGED
@@ -24,6 +24,11 @@ describe "Envme" do
|
|
24
24
|
expect(config.url.length).to be > 0
|
25
25
|
end
|
26
26
|
|
27
|
+
it "Returns a default token" do
|
28
|
+
expect(config.acl_token).to_not be_nil
|
29
|
+
expect(config.acl_token).to eq('anonymous')
|
30
|
+
end
|
31
|
+
|
27
32
|
it "Returns an empty options hash" do
|
28
33
|
expect(config.options).to be_a(Hash)
|
29
34
|
expect(config.options).to be_empty
|
@@ -40,7 +45,6 @@ describe "Envme" do
|
|
40
45
|
|
41
46
|
expect(Envme.configuration.url).to eq("google.com")
|
42
47
|
expect(Envme.configuration.acl_token).to eq("f45cbd0b-5022-47ab-8640-4eaa7c1f40f1")
|
43
|
-
expect(Envme.configuration.options).to eq({ssl: { verify: true }})
|
44
48
|
end
|
45
49
|
end
|
46
50
|
end
|