ravioli 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ravioli/builder.rb +7 -4
- data/lib/ravioli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdb5c361547c4d60716b512dc80eb81fb0ba897c898416eb6a70dbbca33200fa
|
4
|
+
data.tar.gz: c62de7b31a55d07c27ca894bce1698ac12477a7f12f4501260682d184bf7b25b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41fb4047b0d97c117e7714d9e8d8e5e2a01f85628d4828d0ddf5e590c3d66d02813d919e9d7f8290d949a0277dfbabc6acf02c9b0029060bce802ab16ae14416
|
7
|
+
data.tar.gz: 9736ba87ea128c55ac03dcda8f6f6a9172fdf549356b7642c14a02136092c262086468cd905d5d592407995e216264ebaed7c7fc2a82603c115c137e0f8d8e64
|
data/lib/ravioli/builder.rb
CHANGED
@@ -99,6 +99,7 @@ module Ravioli
|
|
99
99
|
load_credentials(
|
100
100
|
key_path: "config/master.key",
|
101
101
|
env_names: %w[master root],
|
102
|
+
quiet: true,
|
102
103
|
)
|
103
104
|
|
104
105
|
# Load any environment-specific configuration on top of it. Since Rails will try
|
@@ -107,6 +108,7 @@ module Ravioli
|
|
107
108
|
"config/credentials/#{Rails.env}",
|
108
109
|
key_path: "config/credentials/#{Rails.env}.key",
|
109
110
|
env_names: ["master"],
|
111
|
+
quiet: true,
|
110
112
|
)
|
111
113
|
|
112
114
|
# Apply staging configuration on top of THAT, if need be
|
@@ -115,6 +117,7 @@ module Ravioli
|
|
115
117
|
"config/credentials/staging",
|
116
118
|
env_names: %w[staging master],
|
117
119
|
key_path: "config/credentials/staging.key",
|
120
|
+
quiet: true,
|
118
121
|
)
|
119
122
|
end
|
120
123
|
end
|
@@ -145,11 +148,11 @@ module Ravioli
|
|
145
148
|
end
|
146
149
|
|
147
150
|
# Load secure credentials using a key either from a file or the ENV
|
148
|
-
def load_credentials(path = "credentials", key_path: path, env_names: path.split("/").last)
|
151
|
+
def load_credentials(path = "credentials", key_path: path, env_names: path.split("/").last, quiet: false)
|
149
152
|
error = nil
|
150
153
|
env_names = Array(env_names).map { |env_name| parse_env_name(env_name) }
|
151
154
|
env_names.each do |env_name|
|
152
|
-
credentials = parse_credentials(path, env_name: env_name, key_path: key_path)
|
155
|
+
credentials = parse_credentials(path, env_name: env_name, key_path: key_path, quiet: quiet)
|
153
156
|
if credentials.present?
|
154
157
|
configuration.append(credentials)
|
155
158
|
return credentials
|
@@ -262,14 +265,14 @@ module Ravioli
|
|
262
265
|
env_name.match?(/^RAILS_/) ? env_name : "RAILS_#{env_name.upcase}_KEY"
|
263
266
|
end
|
264
267
|
|
265
|
-
def parse_credentials(path, key_path: path, env_name: path.split("/").last)
|
268
|
+
def parse_credentials(path, key_path: path, env_name: path.split("/").last, quiet: false)
|
266
269
|
@current_credentials = path
|
267
270
|
env_name = parse_env_name(env_name)
|
268
271
|
key_path = path_to_config_file_path(key_path, extnames: "key", quiet: true)
|
269
272
|
options = {key_path: key_path.to_s}
|
270
273
|
options[:env_key] = ENV[env_name].present? ? env_name : "__RAVIOLI__#{SecureRandom.hex(6)}"
|
271
274
|
|
272
|
-
path = path_to_config_file_path(path, extnames: "yml.enc")
|
275
|
+
path = path_to_config_file_path(path, extnames: "yml.enc", quiet: quiet)
|
273
276
|
(Rails.application.encrypted(path, **options)&.config || {}).tap do
|
274
277
|
@current_credentials = nil
|
275
278
|
end
|
data/lib/ravioli/version.rb
CHANGED