chamber 2.14.0 → 2.14.1

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: 5bf2d68260ae1fa27b7a2befdc5ff274c34477ff3bf584027d39747fbcd5a489
4
- data.tar.gz: 63f97b11849eb6e800b5f4e4f0ae49ad57d1e92cd942f114d417dc8c980a40a4
3
+ metadata.gz: 690d43a7af0262a4fe1ca2f3ab99e66ed6db6a4873a5bdbd50e9bd655a44ffe8
4
+ data.tar.gz: 57ec92f68941f7a281d5ca3b056bdfd64833cd69567de2c07418180f09729d15
5
5
  SHA512:
6
- metadata.gz: 8a8f5f026bee9a0380410ee6ed8c4e563f0c465b56a0d111d10f8ef35eb986f4e3cfeb7acfaa283cfcc7380135026d63f4edbfd3649ea4bfc543b91410f1b155
7
- data.tar.gz: 9d012efb86e89a1a78cd39f0bd54200d0508394b46a7b66b2144b645bcd86f17d25f1f2ad3d2df8c3cab355f1669903b17d8dc8de024d520b854022a6e32d892
6
+ metadata.gz: d38158c0fa8d6bc2c87b6ee4de139c9a13e8118159f2048846d23945c89156597c7106602bd29cb575dce8f15e5a3ee4a279e63f629e23fb25d2dc70feb693f8
7
+ data.tar.gz: 6e5ea4037cd71876681dae104acdd4081129be0dce0373cd6a78e5ed67810156e6545bd29e5124c3fcb92e459ea58a68a356f2acba8ed8232808a07c0752445f
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- ����s'��+�+HG�L�TS�sD���lMRK4�_�LNưZ�B�6�r�7
2
- 7~y�`ԻtjmNLh��2s0�[{�1�1��W*�T��d��6kH �����sߒ�ȡ|
1
+ (����m
2
+ ����-�>µ�Ɇ0���lnL���s��9�:�<(��Y��pf�z�{tej�:;ݳ�� 3�E��?�U]�f��0 ī9�����;cH(���Ke2�,'�q��A%G��5i�UWnʼn�|��y�����1v��v��1D����8o���kC��UjW��h@#�<�� �����l��1}�9�X1�#��')�?l�!�x�ұx��+�W~<���V�.���s���.&�P,@�:�� �M[��G�*��j^f���w���}��S ��j��w��Qm�C���?_�j[bL}d" ��/�T'���n��3����=V����ʋ�Z]�Yi5�y]4c��2/�XZ���I�jH��&xj�o<��k�R
@@ -23,6 +23,14 @@ module Chamber
23
23
  instance.[](key)
24
24
  end
25
25
 
26
+ def dig!(*args)
27
+ instance.dig!(*args)
28
+ end
29
+
30
+ def dig(*args)
31
+ instance.dig(*args)
32
+ end
33
+
26
34
  def configuration
27
35
  instance.configuration
28
36
  end
@@ -86,6 +94,8 @@ module Chamber
86
94
  module_function :[],
87
95
  :configuration,
88
96
  :decrypt,
97
+ :dig!,
98
+ :dig,
89
99
  :encrypt,
90
100
  :env,
91
101
  :filenames,
@@ -22,6 +22,14 @@ class Instance
22
22
  settings.[](key)
23
23
  end
24
24
 
25
+ def dig!(*args)
26
+ settings.dig!(*args)
27
+ end
28
+
29
+ def dig(*args)
30
+ settings.dig(*args)
31
+ end
32
+
25
33
  def filenames
26
34
  files.filenames
27
35
  end
@@ -227,6 +227,27 @@ class Settings
227
227
  namespaces == other.namespaces
228
228
  end
229
229
 
230
+ def [](key)
231
+ warn "WARNING: Bracket access will require strings instead of symbols in Chamber 3.0. You attempted to access the '#{key}' setting. See https://github.com/thekompanee/chamber/wiki/Upgrading-To-Chamber-3.0#removal-of-bracket-indifferent-access for full details." if key.is_a?(::Symbol) # rubocop:disable Layout/LineLength
232
+ warn "WARNING: Accessing a non-existent key ('#{key}') with brackets will fail in Chamber 3.0. See https://github.com/thekompanee/chamber/wiki/Upgrading-To-Chamber-3.0#bracket-access-now-fails-on-non-existent-keys for full details." unless data.has_key?(key) # rubocop:disable Layout/LineLength
233
+
234
+ data.[](key)
235
+ end
236
+
237
+ def dig!(*args)
238
+ args.inject(data) do |data_value, bracket_value|
239
+ key = bracket_value.is_a?(::Symbol) ? bracket_value.to_s : bracket_value
240
+
241
+ data_value.fetch(key)
242
+ end
243
+ end
244
+
245
+ def dig(*args)
246
+ dig!(*args)
247
+ rescue ::KeyError, ::IndexError # rubocop:disable Lint/ShadowedException
248
+ nil
249
+ end
250
+
230
251
  def securable
231
252
  Settings.new(**metadata.merge(
232
253
  settings: raw_data,
@@ -251,9 +272,14 @@ class Settings
251
272
  end
252
273
 
253
274
  def method_missing(name, *args)
254
- return data.public_send(name, *args) if data.respond_to?(name)
275
+ if data.respond_to?(name)
276
+ warn "WARNING: Object notation access is deprecated and will be removed in Chamber 3.0. You attempted to access the '#{name}' setting. See https://github.com/thekompanee/chamber/wiki/Upgrading-To-Chamber-3.0#removal-of-object-notation-access for full details." # rubocop:disable Layout/LineLength
277
+ warn "WARNING: Predicate methods are deprecated and will be removed in Chamber 3.0. You attempted to access the '#{name}' setting. See https://github.com/thekompanee/chamber/wiki/Upgrading-To-Chamber-3.0#removal-of-predicate-accessors for full details." if name.end_with?('?') # rubocop:disable Layout/LineLength
255
278
 
256
- super
279
+ data.public_send(name, *args)
280
+ else
281
+ super
282
+ end
257
283
  end
258
284
 
259
285
  def respond_to_missing?(name, include_private = false)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chamber
4
- VERSION = '2.14.0'
4
+ VERSION = '2.14.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chamber
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.0
4
+ version: 2.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekompanee
@@ -36,7 +36,7 @@ cert_chain:
36
36
  fdbUKgJXqJeb4GYhiKV07l67XExVjmAklMuA6bcB7mk+aSYUkoWNic4ZYGNjVv88
37
37
  AapqLKNG/UPfrJhdhTtFR4ARb8f54rgzONhTaAqVk23Bdp1yoDXaulFCkmU=
38
38
  -----END CERTIFICATE-----
39
- date: 2020-12-29 00:00:00.000000000 Z
39
+ date: 2020-12-31 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: thor
metadata.gz.sig CHANGED
Binary file