ravioli 0.1.8 → 0.1.9

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
  SHA256:
3
- metadata.gz: e56ab68185fd144f082af7ecf11f18725ad872ffab08684d72c1bdff8a4d3672
4
- data.tar.gz: a304ea94ee11385fad332140b8b521ca1d2f3fb1ba71e8baf0c46a3e73054b89
3
+ metadata.gz: bdb5c361547c4d60716b512dc80eb81fb0ba897c898416eb6a70dbbca33200fa
4
+ data.tar.gz: c62de7b31a55d07c27ca894bce1698ac12477a7f12f4501260682d184bf7b25b
5
5
  SHA512:
6
- metadata.gz: 307d77cdd70599a9c81d19eec6fc8206fb4a524a05e42d0a2a20edac514b4287be510be6708aefb5b18c61444f1e21e5816aca58355693c801a8fd627d00cd39
7
- data.tar.gz: 3436f7252744290a5cc7242d501c1751b79c0ca7e9266b5d39c5e11efbf57269c81822819e77d2760ad8957a85f83cdaec24c4a6ebdec4c790bd8e3154c4d0ab
6
+ metadata.gz: 41fb4047b0d97c117e7714d9e8d8e5e2a01f85628d4828d0ddf5e590c3d66d02813d919e9d7f8290d949a0277dfbabc6acf02c9b0029060bce802ab16ae14416
7
+ data.tar.gz: 9736ba87ea128c55ac03dcda8f6f6a9172fdf549356b7642c14a02136092c262086468cd905d5d592407995e216264ebaed7c7fc2a82603c115c137e0f8d8e64
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ravioli
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ravioli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flip Sasser