eac_templates 0.1.0 → 0.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a62e1a49954d5946fec9053ec54c06bc97c3a8480c2ad853a67fc411ee23e39d
|
4
|
+
data.tar.gz: 9a4255a519a2ce06d294568a9f43f121bdab01d5a679f9bdb1ac5307546c4f9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 405ea6efbee5a0a00f4f1868a10d45560ea0c56dbf7e5e40779a9c53b1f940845e0cc68e0886d5f853f0e7dc0e0c647dcdb583d30a5b32838fa8d3b6074decaa
|
7
|
+
data.tar.gz: b0cb98177ae942cae3df07b44683a627e5ed3951f4fe4d5df7fc1ba05e13e66065b0d78d947789b623e6121a508ad46c471e68369ba0a807c3570350e2f8e40a
|
@@ -6,7 +6,7 @@ module EacTemplates
|
|
6
6
|
module VariableProviders
|
7
7
|
require_sub __FILE__
|
8
8
|
|
9
|
-
PROVIDERS = %w[entries_reader hash generic].map do |name|
|
9
|
+
PROVIDERS = %w[config_reader entries_reader hash generic].map do |name|
|
10
10
|
"eac_templates/variable_providers/#{name}".camelize.constantize
|
11
11
|
end
|
12
12
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_config/node'
|
4
|
+
require 'eac_templates/variable_providers/base'
|
5
|
+
|
6
|
+
module EacTemplates
|
7
|
+
module VariableProviders
|
8
|
+
class ConfigReader < ::EacTemplates::VariableProviders::Base
|
9
|
+
class << self
|
10
|
+
def accept?(variables_source)
|
11
|
+
return false unless variables_source.respond_to?(:entry)
|
12
|
+
|
13
|
+
entry = variables_source.entry(:any_value)
|
14
|
+
entry.respond_to?(:value) && entry.respond_to?(:found?)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def variable_exist?(name)
|
19
|
+
source.entry(name).found?
|
20
|
+
end
|
21
|
+
|
22
|
+
def variable_fetch(name)
|
23
|
+
source.entry(name).value
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_templates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
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-05
|
11
|
+
date: 2021-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eac_config
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: eac_ruby_utils
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- lib/eac_templates/variable_not_found_error.rb
|
68
68
|
- lib/eac_templates/variable_providers.rb
|
69
69
|
- lib/eac_templates/variable_providers/base.rb
|
70
|
+
- lib/eac_templates/variable_providers/config_reader.rb
|
70
71
|
- lib/eac_templates/variable_providers/entries_reader.rb
|
71
72
|
- lib/eac_templates/variable_providers/generic.rb
|
72
73
|
- lib/eac_templates/variable_providers/hash.rb
|