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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19de4fc0206ca8af68639d9b6c67b17cdb032e50
4
- data.tar.gz: 8ffcea65ea09e48b7b4e03f634576c06caeda417
3
+ metadata.gz: 2559db6bd0ddb51b79ccbc657e5f966c165faaa5
4
+ data.tar.gz: 5be9d01368e0e6d6b7a47b0c0dc1028520c889ec
5
5
  SHA512:
6
- metadata.gz: 40242eb90c4420c50c33fc0f7b504450f69f4113d0b5b2932a44dcff332925026c8f9b33be1377e3cd3c31b1ce0f144fb3ace65ce3a8592202c9cbf9a39b8378
7
- data.tar.gz: 9e6d6f33ee891675e53393062dbd3e85f036fb5a33f2f46f812cbd66d2a50982cd51e79306bcbadd51b4c84cb4fee17164ffe3a275701d14127ec57fae8b4e69
6
+ metadata.gz: fe94ab4c655219942e59916e29398ea23f75dab1d31ae56396725b48d810f0c7967e22e22534a8f4b256df1294f35845da5be039256d644ae18724f2e01e099e
7
+ data.tar.gz: 00342350b47c4bb1290131b9b31335f614d81b13a800247a92bd47de81412e830a02cfc4d1fba29faaa0406435a5d62bdafaf094f267fc814ebc23e2bd3de0d6
@@ -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!("\n", '\n')
25
+ v.gsub!(/\r?\n/, '\n')
26
26
  v.gsub!(/\$([^(])/, '\$\1')
27
27
  "#{k}=\"#{v}\""
28
28
  else
@@ -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 = [])
@@ -1,3 +1,3 @@
1
1
  module Etcenv
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etcenv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shota Fukumori (sora_h)