etcenv 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/etcenv/dotenv_file.rb +2 -2
- data/lib/etcenv/environment.rb +3 -0
- data/lib/etcenv/version.rb +1 -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: 2559db6bd0ddb51b79ccbc657e5f966c165faaa5
|
4
|
+
data.tar.gz: 5be9d01368e0e6d6b7a47b0c0dc1028520c889ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe94ab4c655219942e59916e29398ea23f75dab1d31ae56396725b48d810f0c7967e22e22534a8f4b256df1294f35845da5be039256d644ae18724f2e01e099e
|
7
|
+
data.tar.gz: 00342350b47c4bb1290131b9b31335f614d81b13a800247a92bd47de81412e830a02cfc4d1fba29faaa0406435a5d62bdafaf094f267fc814ebc23e2bd3de0d6
|
data/lib/etcenv/dotenv_file.rb
CHANGED
@@ -18,11 +18,11 @@ module Etcenv
|
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
|
-
SHOULD_QUOTE = /\n|"|#|\$/
|
21
|
+
SHOULD_QUOTE = /\r|\n|"|#|\$/
|
22
22
|
def make_dotenv_line(k,v)
|
23
23
|
if v.match(SHOULD_QUOTE)
|
24
24
|
v.gsub!('"', '\"')
|
25
|
-
v.gsub!(
|
25
|
+
v.gsub!(/\r?\n/, '\n')
|
26
26
|
v.gsub!(/\$([^(])/, '\$\1')
|
27
27
|
"#{k}=\"#{v}\""
|
28
28
|
else
|
data/lib/etcenv/environment.rb
CHANGED
@@ -5,6 +5,7 @@ module Etcenv
|
|
5
5
|
class NotDirectory < StandardError; end
|
6
6
|
class DepthLimitError < StandardError; end
|
7
7
|
class LoopError < StandardError; end
|
8
|
+
class KeyNotFound < StandardError; end
|
8
9
|
|
9
10
|
INCLUDE_KEY = '.include'
|
10
11
|
MAX_DEPTH_DEFAULT = 10
|
@@ -98,6 +99,8 @@ module Etcenv
|
|
98
99
|
|
99
100
|
modified_indices[key] = index
|
100
101
|
cache[key] = dir
|
102
|
+
rescue Etcd::KeyNotFound
|
103
|
+
raise KeyNotFound, "Couldn't find key #{key}"
|
101
104
|
end
|
102
105
|
|
103
106
|
def solve_include_order(name, path = [])
|
data/lib/etcenv/version.rb
CHANGED