fig_tree 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/README.md +12 -0
- data/lib/fig_tree/version.rb +1 -1
- data/lib/fig_tree.rb +1 -8
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeed3763d9c3d8589a8ff0426ef7bcbc6b27ead3b61a4e930fc4c043a3243ab2
|
4
|
+
data.tar.gz: 99530c56bbed379a3a8ccdf8558fda0ff89d32eff73d3b33d95fa483c30945d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 123fb1d12ecdc117a89e0f1b1c8cc8dcce7a124307d4b2ec6f1d9f89f80d0e727018f43f0b235a4919c46065b1b7396814625710302e5345871f44aa199b64df
|
7
|
+
data.tar.gz: 755b79c660b3c2c72c9fd6389102164ff129f6d35cbe818f1538630d88e5cbcc57ee69b80839bd18c0e56eac0db85f89cb9cce82df743b2b64de6abb401c55b0
|
data/CHANGELOG.md
CHANGED
@@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## UNRELEASED
|
9
9
|
|
10
|
-
## [0.0.
|
10
|
+
## [0.0.5] - 2023-04-04
|
11
|
+
- Remove Deimos-specific Rake Task skip
|
12
|
+
|
13
|
+
## [0.0.4] - 2022-05-16
|
11
14
|
- Added `with_config` method for testing.
|
12
15
|
|
13
16
|
## [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 .
|
data/lib/fig_tree/version.rb
CHANGED
data/lib/fig_tree.rb
CHANGED
@@ -224,13 +224,6 @@ module FigTree
|
|
224
224
|
|
225
225
|
# Configure the settings with values.
|
226
226
|
def configure(&block)
|
227
|
-
if defined?(Rake) && defined?(Rake.application)
|
228
|
-
tasks = Rake.application.top_level_tasks
|
229
|
-
if tasks.any? { |t| %w(assets webpacker yarn).include?(t.split(':').first) }
|
230
|
-
puts 'Skipping Deimos configuration since we are in JS/CSS compilation'
|
231
|
-
return
|
232
|
-
end
|
233
|
-
end
|
234
227
|
config.run_callbacks(:configure) do
|
235
228
|
config.instance_eval(&block)
|
236
229
|
end
|
@@ -244,7 +237,7 @@ module FigTree
|
|
244
237
|
# Evaluate a block with the given configuration values. Reset back to the original values
|
245
238
|
# when done.
|
246
239
|
# @param values [Hash]
|
247
|
-
def with_config(
|
240
|
+
def with_config(values={}, &block) # rubocop:disable Metrics/AbcSize
|
248
241
|
set_value = lambda do |k, v|
|
249
242
|
obj = self.config
|
250
243
|
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.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
|
-
rubygems_version: 3.3.
|
169
|
+
rubygems_version: 3.3.20
|
170
170
|
signing_key:
|
171
171
|
specification_version: 4
|
172
172
|
summary: Configuration framework for Ruby.
|