nocode 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/nocode/steps_executor.rb +1 -1
- data/lib/nocode/util.rb +0 -1
- data/lib/nocode/version.rb +1 -1
- data/nocode.gemspec +1 -1
- metadata +3 -4
- data/lib/nocode/util/object_template.rb +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8132a6f8dd5bde1975030689aaed4f3858243075116febf95c34fa182df67f5
|
4
|
+
data.tar.gz: 950d30f0d5c5d9ff9c670119f3f03e90628a4ef54b578ca925be9c5f23a0995f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72a179c3862851d65cf38679d2f147da64bb5f3bcceca8c2f7849c3687500f8637fb4c1f3ae78a90f670e356ef19d37ff2b3e35559d11e32467c4ac0b3c1e43b
|
7
|
+
data.tar.gz: 0dafc012dbcd75fe1ac4af1cda75e3084a8c9c85b9e21e51b69451b70b968aba7d03fdb5d485eb44b9f4ecca997a932c1dba750f5e7e8e8bbfcec074b777bde0
|
data/CHANGELOG.md
CHANGED
@@ -33,7 +33,7 @@ module Nocode
|
|
33
33
|
private
|
34
34
|
|
35
35
|
def make_step(step)
|
36
|
-
evaluated_step =
|
36
|
+
evaluated_step = Nay.evaluate(step, context.to_h)
|
37
37
|
type = evaluated_step[TYPE_KEY].to_s
|
38
38
|
name = evaluated_step[NAME_KEY].to_s
|
39
39
|
step_class = StepRegistry.constant!(type)
|
data/lib/nocode/util.rb
CHANGED
data/lib/nocode/version.rb
CHANGED
data/nocode.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
|
30
30
|
s.required_ruby_version = '>= 2.6'
|
31
31
|
|
32
|
-
s.add_dependency('nay', '~>0.0', '>=0.0.
|
32
|
+
s.add_dependency('nay', '~>0.0', '>=0.0.3')
|
33
33
|
|
34
34
|
s.add_development_dependency('bundler-audit')
|
35
35
|
s.add_development_dependency('guard-rspec')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nocode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Ruggio
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '0.0'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.0.
|
22
|
+
version: 0.0.3
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '0.0'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.0.
|
32
|
+
version: 0.0.3
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler-audit
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -227,7 +227,6 @@ files:
|
|
227
227
|
- lib/nocode/util/class_loader.rb
|
228
228
|
- lib/nocode/util/class_registry.rb
|
229
229
|
- lib/nocode/util/dictionary.rb
|
230
|
-
- lib/nocode/util/object_template.rb
|
231
230
|
- lib/nocode/util/optionable.rb
|
232
231
|
- lib/nocode/version.rb
|
233
232
|
- nocode.gemspec
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Nocode
|
4
|
-
module Util
|
5
|
-
# Built on top of StringTemplate but instead of only working for a string, this will
|
6
|
-
# recursively evaluate all strings within an object. Heuristics:
|
7
|
-
# - Strings evaluate using StringTemplate
|
8
|
-
# - Hashes will have their keys and values traversed
|
9
|
-
# - Arrays will have their entries traversed
|
10
|
-
# - All other types will simply return themselves
|
11
|
-
class ObjectTemplate
|
12
|
-
attr_reader :object
|
13
|
-
|
14
|
-
def initialize(object)
|
15
|
-
@object = object
|
16
|
-
|
17
|
-
freeze
|
18
|
-
end
|
19
|
-
|
20
|
-
def evaluate(values = {})
|
21
|
-
recursive_evaluate(object, values)
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def recursive_evaluate(expression, values)
|
27
|
-
case expression
|
28
|
-
when Array
|
29
|
-
expression.map { |o| recursive_evaluate(o, values) }
|
30
|
-
when Hash
|
31
|
-
expression.to_h do |k, v|
|
32
|
-
[recursive_evaluate(k, values), recursive_evaluate(v, values)]
|
33
|
-
end
|
34
|
-
when String
|
35
|
-
Nay.evaluate(expression, values)
|
36
|
-
else
|
37
|
-
expression
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|