doppler 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/doppler.rb +1 -1
- data/lib/doppler/client.rb +14 -13
- data/lib/doppler/version.rb +1 -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: 69b112d5d1d5dbf328711c0f22f1c02be2f4afb8
|
4
|
+
data.tar.gz: 89663dbd70d8c5afddebb2b98cfbbf3a19a64d34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c532bc666dacd189406cf42b2c1ca580956667ea745cf7829cb1bef32180c75fd84f98986e6054210a58957fab48c6206fdd8866867e8873d0afaed1aa081de5
|
7
|
+
data.tar.gz: 3ccf3ff1b647be6a1cc630764cdae2933fa1c6c101e17b2ab1cfd91505063adc4cac06d747c75b38025437f2f7257efc0e247e358bb84d42c687d1f7a50c342b
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Doppler Ruby Library
|
2
2
|
|
3
|
+
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/DopplerHQ/ruby-client)
|
3
4
|
[![image](https://img.shields.io/gem/v/doppler-client.svg)](https://rubygems.org/gems/doppler-client)
|
4
5
|
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/92ec3d37764c40da8dffb6a85c6cbfa4)](https://www.codacy.com/app/Doppler/ruby-client?utm_source=github.com&utm_medium=referral&utm_content=DopplerHQ/ruby-client&utm_campaign=Badge_Grade)
|
5
6
|
|
data/lib/doppler.rb
CHANGED
data/lib/doppler/client.rb
CHANGED
@@ -5,7 +5,6 @@ require 'doppler/version'
|
|
5
5
|
module Doppler
|
6
6
|
class Client
|
7
7
|
MAX_RETRIES = 10
|
8
|
-
ENVIRONMENT_SEGMENT = '/environments/'
|
9
8
|
|
10
9
|
def initialize()
|
11
10
|
if Doppler.api_key.nil?
|
@@ -25,8 +24,8 @@ module Doppler
|
|
25
24
|
end
|
26
25
|
|
27
26
|
def startup
|
28
|
-
resp = self._request('/
|
29
|
-
@remote_keys = resp.fetch("
|
27
|
+
resp = self._request('/v1/variables')
|
28
|
+
@remote_keys = resp.fetch("variables")
|
30
29
|
|
31
30
|
overwrite_env()
|
32
31
|
write_to_backup()
|
@@ -59,24 +58,26 @@ module Doppler
|
|
59
58
|
end
|
60
59
|
|
61
60
|
|
62
|
-
def _request(endpoint,
|
61
|
+
def _request(endpoint, retry_count=0)
|
63
62
|
raise ArgumentError, 'endpoint not string' unless endpoint.is_a? String
|
64
63
|
|
65
|
-
|
66
|
-
uri = URI.
|
64
|
+
uri = URI.parse(Doppler.host_url + endpoint)
|
65
|
+
uri.query = URI.encode_www_form({
|
66
|
+
'pipeline': Doppler.pipeline,
|
67
|
+
'environment': Doppler.environment
|
68
|
+
})
|
67
69
|
header = {
|
68
70
|
'Content-Type': 'application/json',
|
69
71
|
'api-key': Doppler.api_key,
|
70
|
-
'pipeline': Doppler.pipeline,
|
71
72
|
'client-sdk': 'ruby',
|
72
73
|
'client-version': Doppler::VERSION
|
73
|
-
|
74
74
|
}
|
75
|
-
http = ::Net::HTTP.new(uri.host, uri.port)
|
76
|
-
http.use_ssl = true
|
77
75
|
|
78
76
|
begin
|
79
|
-
|
77
|
+
request = Net::HTTP::Get.new(uri, header)
|
78
|
+
response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => true) {|http|
|
79
|
+
http.request(request)
|
80
|
+
}
|
80
81
|
response_data = JSON.parse(response.body)
|
81
82
|
if response_data['success'] == false
|
82
83
|
raise RuntimeError, response_data["messages"].join(". ")
|
@@ -102,11 +103,11 @@ module Doppler
|
|
102
103
|
end
|
103
104
|
|
104
105
|
data = {}
|
105
|
-
data["
|
106
|
+
data["variables"] = keys
|
106
107
|
return data
|
107
108
|
|
108
109
|
else
|
109
|
-
return _request(endpoint,
|
110
|
+
return _request(endpoint, retry_count)
|
110
111
|
end
|
111
112
|
end
|
112
113
|
|
data/lib/doppler/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.2
|
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-
|
11
|
+
date: 2019-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|