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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c51e426e2458257cc45027ee67d79e28fd4d87f
4
- data.tar.gz: 10baf2c1aeb5956072901ab420826b68ef7d58c2
3
+ metadata.gz: dd9c5a65cacf27cf8547498b7f12850b213325dc
4
+ data.tar.gz: 9ab82cb64b8149ac07508852dcf2dc3ad675ab4d
5
5
  SHA512:
6
- metadata.gz: 03ded1c90693263a6ef9363287e490258902cd2a7e646e5971d7ca344cc2908f3dfa9d8826e3165e3e2ff7a95914b7aaa7925f71d16ec5a32bc3ad31e3e052df
7
- data.tar.gz: ce01e2f2e7f52b5513a3337990e30acffa2302b5e1112938664a715a9f3e1e0945c7e33b0821770bb5d040680dc7a8c10d37a8aa77a90265df995f8ba0bbb383
6
+ metadata.gz: 55be67bce09d430b0847ee4c3466a1040987cd2cb6fb16666dd9553a96005117d58fc56fdc8479a93b13c334e7651b148e84c15fca3658456684eacd63257f01
7
+ data.tar.gz: 87c1043779ae80232bdc295407c18ee4777a5c66453790e874639be689a168f82d08998bdab37f8911fc367d791848620eba639e8a1c308fdf02b44d02e08ba6
@@ -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
- JSON.load(`sudo #{ejson_path} decrypt secrets.ejson`).deep_symbolize_keys
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
@@ -1,3 +1,3 @@
1
1
  module Linecook
2
- VERSION = '0.0.9'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linecook-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Hamel