eac_templates 0.1.2 → 0.2.0

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: 7c8864c02b3b9a07ab668f397dca2f3454195f96c971227d09105be621012a0d
4
- data.tar.gz: f0695241dc3eb62850225fea3821569ac648a96ea23d4baeb43ab2c44f4ab839
3
+ metadata.gz: 4b08055198ad24804549c202f6d2745d6f8be3e1f2e7439ea736e66420a50e33
4
+ data.tar.gz: 72016290a6f36b2d3fd0a7064fcb9d640a44edd9dad291bb1f8f4a4c0c44790c
5
5
  SHA512:
6
- metadata.gz: bd9a7f52e73033cbca8cfdd760407d330dad46ecd7a04bec552f0add2335963cc810250abf734a8a8290d124181ffa8894a08bce6182632cdf6aadeb3e8b9590
7
- data.tar.gz: f896791963de78c7e0b8ec3a7697f55d4b3ffcad0685a6df140bf3972b52e3ee03a7a468d64cadb2bc2936a51a2d55c278f8b41c29b34a1162ddea9fbd975534
6
+ metadata.gz: ff3beaf8ea770953ed37043944a725d045b27db070faa53e5d4bc1e6a3f91166c13b1c97b59626b41adbe63e28ebee3cbf3992a184c760a4090f4f30f6757d96
7
+ data.tar.gz: fe944bafe9c0b6a62d0f00fd2ed6da628b4f7865d5d86ea52bff9573e58c2f7d662b43ec593ae4a63876145bbe0eb46dc6920734d7e50362edb36f3b7ffd4a24
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'erb'
4
+
5
+ class Module
6
+ def erb_template(subpath, binding_obj)
7
+ ::ERB.new(template.child(subpath).path.read).result(binding_obj)
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/require_sub'
4
+ ::EacRubyUtils.require_sub __FILE__
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_templates/patches/module/erb_template'
4
+
5
+ class Object
6
+ def erb_template(subpath, binding_obj = nil)
7
+ self.class.erb_template(subpath, binding_obj || binding)
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/require_sub'
4
+ ::EacRubyUtils.require_sub __FILE__
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/require_sub'
4
+ ::EacRubyUtils.require_sub __FILE__
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTemplates
4
- VERSION = '0.1.2'
4
+ VERSION = '0.2.0'
5
5
  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.2
4
+ version: 0.2.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-09-02 00:00:00.000000000 Z
11
+ date: 2021-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_config
@@ -61,7 +61,12 @@ files:
61
61
  - lib/eac_templates.rb
62
62
  - lib/eac_templates/directory.rb
63
63
  - lib/eac_templates/file.rb
64
+ - lib/eac_templates/patches.rb
65
+ - lib/eac_templates/patches/module.rb
66
+ - lib/eac_templates/patches/module/erb_template.rb
64
67
  - lib/eac_templates/patches/module/template.rb
68
+ - lib/eac_templates/patches/object.rb
69
+ - lib/eac_templates/patches/object/erb_template.rb
65
70
  - lib/eac_templates/patches/object/template.rb
66
71
  - lib/eac_templates/searcher.rb
67
72
  - lib/eac_templates/variable_not_found_error.rb