fig_tree 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2569e3b3e914e96bb517fe6a655c9b4b8bafc29ca50b37a31408b41c3b094860
4
- data.tar.gz: 3d9cd4410eea8f55a91d1efeee3557b9633baa82f8c85a41a9ddcbbf7ce40fa3
3
+ metadata.gz: 05e904a52d3b7edb7d02d48b4d063db396de7918b6b1de8f277cfcc6fcbe7cb2
4
+ data.tar.gz: 58334d1b630a134a2e08cefc03d1131d130ff550d9d0a89e350f57ccdb676002
5
5
  SHA512:
6
- metadata.gz: 146d732d5155ab2b25a40278b7372198e894a90aa148ebc05383ccbd3d08d5ac00a445c13152adf8c9f41afcb262b2df23eb586ca33fd547376f290e44ac5b7e
7
- data.tar.gz: 508b13e81c6b588c76c3aed53b016e7e4b77e88960a7b8876e6b299bdf47a783be8704cf40745c5a9e68b6ab186b98ff16b9ab158bf8151fa7e724af8dd5bb03
6
+ metadata.gz: ef3fff25ee51e1bc67f5657a3574e303ca2346cf651379261ca915878d9b3d9e679b5acc6778b995bdac8dc1c412724c9540926563e020983d570ad53103493a
7
+ data.tar.gz: 0b80fb3feee7165b47a7ce1121cd7f374ba40fa2687adfbc94e7237692f78c36c3698e72643666e96da6d208a329b784e0789aaec7352e1461cca4e36d712d5d
data/CHANGELOG.md CHANGED
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## UNRELEASED
9
9
 
10
- ## [0.0.3] - 2022-05-13
10
+ ## [0.0.4] - 2022-05-16
11
11
  - Added `with_config` method for testing.
12
12
 
13
13
  ## [0.0.2] - 2021-02-17
data/README.md CHANGED
@@ -188,6 +188,18 @@ FileCreator.user_read = true
188
188
  # config.user_read is deprecated - use config.file_options.user_read
189
189
  ```
190
190
 
191
+ ## Testing
192
+
193
+ You can use the `with_config` method to test your code with specific config values that get
194
+ reset after the block is done executing:
195
+
196
+ ```ruby
197
+ FileCreator.with_config('file_options.group_name' => 'root') do
198
+ # test this code
199
+ end
200
+ # file_options.group_name will be set back to the original value afterwards
201
+ ```
202
+
191
203
  ## Contributing
192
204
 
193
205
  Bug reports and pull requests are welcome on GitHub at https://github.com/flipp-oss/fig_tree .
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FigTree
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
data/lib/fig_tree.rb CHANGED
@@ -244,7 +244,7 @@ module FigTree
244
244
  # Evaluate a block with the given configuration values. Reset back to the original values
245
245
  # when done.
246
246
  # @param values [Hash]
247
- def with_config(**values, &block) # rubocop:disable Metrics/AbcSize
247
+ def with_config(values={}, &block) # rubocop:disable Metrics/AbcSize
248
248
  set_value = lambda do |k, v|
249
249
  obj = self.config
250
250
  tokens = k.split('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fig_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-13 00:00:00.000000000 Z
11
+ date: 2022-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport