yaml_vault 1.0.1 → 1.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: 4113736dbf8ce7c2b0c505b95fbbb2ba554a9376
4
- data.tar.gz: 84b726f8245e7e74210720aa27ed864acfb81ee1
3
+ metadata.gz: a79d04cb3d8df1d8f24a3411fee8557b49244634
4
+ data.tar.gz: 1ab20b6c54798ea32f882c50eb0bbd03204124d4
5
5
  SHA512:
6
- metadata.gz: c27f4477a86e9d01c4f73aff041656e1b0c344f97add07b5e4643a7914c921fd0d3d788ae11f8b670a285f972b8064d3ac8231e862f685f8268982a09bfd604d
7
- data.tar.gz: 410fe9f926db4ab5f15537ce73d670b87aeaeaba9f5013e8a030dead403e3eb746f228e2fafbbcc9431a6d1c15d84a2368cd0bd55c13cc6b4360dd7eebf7635c
6
+ metadata.gz: 27f581f18b544b3b794024af3aa415660bd7d8974cffb19e7746806e9da3dc195e83a64e59e63700cdbe063cd49de75500a122c5aa434c66843f32a980b35bea
7
+ data.tar.gz: 0d4005e3c7722f0472f66e8f54429ab47def0647783f99ccbfca3b7f88199f423f16233ad45d4b4cf8d16447d9b2617945e9ec149a99c6ebd615b04da45c039e
@@ -9,7 +9,15 @@ module YamlVault
9
9
  if File.exist?(yaml)
10
10
  all_secrets = YamlVault::Main.from_content(IO.read(yaml), keys, cryptor_name, **options).decrypt_hash
11
11
  env_secrets = all_secrets[::Rails.env]
12
- secrets.merge!(env_secrets.symbolize_keys) if env_secrets
12
+ if env_secrets
13
+ if Gem::Version.new(::Rails::VERSION::STRING) >= Gem::Version.new("5.1")
14
+ # In Rails 5.1, nested keys are also symbolized
15
+ # cf. https://github.com/rails/rails/pull/26929
16
+ secrets.merge!(env_secrets.deep_symbolize_keys)
17
+ else
18
+ secrets.merge!(env_secrets.symbolize_keys)
19
+ end
20
+ end
13
21
  end
14
22
 
15
23
  # Fallback to config.secret_key_base if secrets.secret_key_base isn't set
@@ -1,3 +1,3 @@
1
1
  module YamlVault
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml_vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - joker1007
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-05 00:00:00.000000000 Z
11
+ date: 2017-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport