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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f199fcae3341fccc2e54c1c139ba2c7e65a20dda27d2be31c79de02f9ec2558a
4
- data.tar.gz: c10d64f895d34e567b846c52727205d1394641adcd68b1b1d2707c509577700c
3
+ metadata.gz: e8132a6f8dd5bde1975030689aaed4f3858243075116febf95c34fa182df67f5
4
+ data.tar.gz: 950d30f0d5c5d9ff9c670119f3f03e90628a4ef54b578ca925be9c5f23a0995f
5
5
  SHA512:
6
- metadata.gz: 1a53bcec0412b9b8be57d9cb61601db583aa210542f9372c05d4cdee0e693861d05e017a697103253a2d522a2253e609481ded8e0524362ccaf6640a9d13f9d3
7
- data.tar.gz: 131855e439116d1718cf46c53cc32597187aeae36156d71fff508fa4a0a20739a9965b055874aadc93cae4a5dd3fbf3f4b0201d5f7c75a9d1d63ed60e9150044
6
+ metadata.gz: 72a179c3862851d65cf38679d2f147da64bb5f3bcceca8c2f7849c3687500f8637fb4c1f3ae78a90f670e356ef19d37ff2b3e35559d11e32467c4ac0b3c1e43b
7
+ data.tar.gz: 0dafc012dbcd75fe1ac4af1cda75e3084a8c9c85b9e21e51b69451b70b968aba7d03fdb5d485eb44b9f4ecca997a932c1dba750f5e7e8e8bbfcec074b777bde0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ #### 0.0.10 - February 18th, 2022
2
+
3
+ * Replace ObjectTemplate with Nay library.
1
4
  #### 0.0.9 - February 18th, 2022
2
5
 
3
6
  * Replace StringTemplate with Nay library.
@@ -33,7 +33,7 @@ module Nocode
33
33
  private
34
34
 
35
35
  def make_step(step)
36
- evaluated_step = Util::ObjectTemplate.new(step).evaluate(context.to_h)
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
@@ -4,5 +4,4 @@ require_relative 'util/arrayable'
4
4
  require_relative 'util/class_loader'
5
5
  require_relative 'util/class_registry'
6
6
  require_relative 'util/dictionary'
7
- require_relative 'util/object_template'
8
7
  require_relative 'util/optionable'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nocode
4
- VERSION = '0.0.9'
4
+ VERSION = '0.0.10'
5
5
  end
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.2')
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.9
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.2
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.2
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