eac_config 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eac_config/rspec/setup.rb +19 -0
- data/lib/eac_config/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ac2dc8e897b518ae3ff7c683d486380fa6cf76ad835a718e01436f4dbc4571d
|
4
|
+
data.tar.gz: 7dbefbb66b1912343c4e2e5b529828dea1f1d5165fea20e390ede6de4d7ea3d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5048086be008f75628f187fc588a804a41ac6903f97d8ea60f3ca07e930d823e24d5193a14fbccde27b6a8ff2e328417e2a8cc2bd45960f268031557ac5cd566
|
7
|
+
data.tar.gz: 9fe7946dcb40890a213fba6fab0af3bda15456e00b277f1eb578f69ec6f62d45c0fced3139ea61afadfe491b8bf504ed526ab36ff5298aac29ec75c2798280a4
|
@@ -1,7 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_ruby_utils/fs/temp'
|
4
5
|
require 'eac_config/envvars_node'
|
6
|
+
require 'eac_config/node'
|
7
|
+
require 'eac_config/yaml_file_node'
|
5
8
|
|
6
9
|
module EacConfig
|
7
10
|
module Rspec
|
@@ -25,6 +28,22 @@ module EacConfig
|
|
25
28
|
def envvars_load_path_entry
|
26
29
|
::EacConfig::EnvvarsNode.new.load_path.entry
|
27
30
|
end
|
31
|
+
|
32
|
+
def stub_eac_config_node(&node_builder)
|
33
|
+
parent_self = self
|
34
|
+
rspec_config.around do |example|
|
35
|
+
::EacRubyUtils::Fs::Temp.on_file do |file|
|
36
|
+
::EacConfig::Node
|
37
|
+
.context.on(parent_self.stub_eac_config_node_build(file, &node_builder)) do
|
38
|
+
example.run
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def stub_eac_config_node_build(file, &node_builder)
|
45
|
+
node_builder.present? ? node_builder.call(file) : ::EacConfig::YamlFileNode.new(file)
|
46
|
+
end
|
28
47
|
end
|
29
48
|
end
|
30
49
|
end
|
data/lib/eac_config/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|