wbconfigurator 0.3.0 → 0.3.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: eab5b88f48a27b6876fd7c088c7a5eecf42be7dedd73e0859ddd03667f72c22f
4
- data.tar.gz: f6a3cdaf035c54c7a5b33d942bfc87b7077d54e9c651728d586b9f2f3155ba5e
3
+ metadata.gz: 6c6a0a05711b29eb8bd8c4eefaa2d45d9fab0813a8a8db1cb6dec7083f6a3475
4
+ data.tar.gz: e456a5d8e1efff923292fa2e48f2f140d5dc51febd8dce95afdae4c97594d792
5
5
  SHA512:
6
- metadata.gz: 9a11c4a85fd15c2a9a860cd342952443fdc33b3a5be83a7990808c93acb67736bd55d065f41ed4ef5eed63d95a1242fb02563a7511816eff681878017c3fd2f1
7
- data.tar.gz: 42e41c07a67d7be9368e704c9930ea8ff18de17a16b8dc7f83e1f05cbcb24c58ec2a7da6830aa978818cc3d45b2ca75febd456b5babd9b6b0052e9abbbb18552
6
+ metadata.gz: 30b89d75958aeb943d2b79d2e7cf315cda716368d3269d6b13e5925deda36e995fd171fa1be5eda8553cf241cd1222f9136cff81957be44971c0209fe96f54ab
7
+ data.tar.gz: 41913c7f625b270c6510edb91b32ff8abcb4833d16a837ee5281c7f7192be202cc506d79e4f46ba60dc091361a88db906a2e9c4d411b18296ecc6a09d8757f95
data/lib/config/app.rb CHANGED
@@ -128,7 +128,8 @@ module App
128
128
  end
129
129
 
130
130
  def load_from_yaml(filename)
131
- SecureYaml.load(File.open(file_full_path(filename)))
131
+ yaml_file = ERB.new(File.read(file_full_path(filename))).result
132
+ SecureYaml.load(yaml_file)
132
133
  end
133
134
 
134
135
  # generate accessors for loaded data
@@ -148,8 +149,6 @@ module App
148
149
  Configurator::Struct.new(object)
149
150
  when Array
150
151
  object.map!(&method(:convert_to_struct))
151
- when String
152
- ERB.new(object).result
153
152
  else
154
153
  object
155
154
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Configurator
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
data/spec/data/test.yaml CHANGED
@@ -1,3 +1,4 @@
1
1
  retry_count: 2
2
2
  display_errors: true
3
3
  error_id: <%= "error_#{1+1}" %>
4
+ boolean: <%= true %>
@@ -39,5 +39,10 @@ describe 'Configurator' do
39
39
  App.config.load!(:test)
40
40
  expect(App.config.test.error_id).to eq('error_2')
41
41
  end
42
+
43
+ it 'erb content - boolean' do
44
+ App.config.load!(:test)
45
+ expect(App.config.test.boolean).to eq(true)
46
+ end
42
47
  end
43
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wbconfigurator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Balos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-20 00:00:00.000000000 Z
11
+ date: 2022-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: secure_yaml