linecook-gem 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/linecook/util/config.rb +5 -1
- data/lib/linecook/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: dd9c5a65cacf27cf8547498b7f12850b213325dc
|
4
|
+
data.tar.gz: 9ab82cb64b8149ac07508852dcf2dc3ad675ab4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55be67bce09d430b0847ee4c3466a1040987cd2cb6fb16666dd9553a96005117d58fc56fdc8479a93b13c334e7651b148e84c15fca3658456684eacd63257f01
|
7
|
+
data.tar.gz: 87c1043779ae80232bdc295407c18ee4777a5c66453790e874639be689a168f82d08998bdab37f8911fc367d791848620eba639e8a1c308fdf02b44d02e08ba6
|
data/lib/linecook/util/config.rb
CHANGED
@@ -66,7 +66,11 @@ module Linecook
|
|
66
66
|
@secrets ||= begin
|
67
67
|
if File.exists?(SECRETS_PATH)
|
68
68
|
ejson_path = `which ejson`.strip
|
69
|
-
|
69
|
+
command = "#{ejson_path} decrypt #{SECRETS_PATH}"
|
70
|
+
secrets = JSON.load(`#{command}`)
|
71
|
+
# if we can't read the ejson key, try again with sudo
|
72
|
+
secrets = JSON.load(`sudo #{command}`) if secrets.empty
|
73
|
+
secrets.deep_symbolize_keys
|
70
74
|
else
|
71
75
|
{}
|
72
76
|
end
|
data/lib/linecook/version.rb
CHANGED