dumb_generator 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5966e8f40de273735fa1ae15860c6ed68d89587ba65aae6306cec761d9dbb742
4
- data.tar.gz: 51c32c60c66b604756e92adadc66ac244c48d4e6379e307ac1b05cbcc166f6ab
3
+ metadata.gz: 78deea2ed941c4ac7cb3451f993e907044b371163846298d75a408af3266db03
4
+ data.tar.gz: a7502655cf833f0597051eaa3c255ebe9a07e25301bca89b2492a67422c8997f
5
5
  SHA512:
6
- metadata.gz: dde873f5028c53c51995dcaeb660a00e16bb4570bd515057e1b6471836822d9ff2b865e0a4e624f96426a50d86c337c84d49b9120d1860c1fb7da0428b92987f
7
- data.tar.gz: f6f2f0d6462fc4edc01c01de5ac83b7a737ae22e8b98b5764ea7e30c77301f641c88822963108e473e22731bdb00f308d693eb7043273b0679dd04e7e544c8b0
6
+ metadata.gz: 81d02d4df7662ca774f2af480a2811465f7667297ba35cc462dc5065662ce3086ceb10f3273d276ce23faabfe91789410645047f2e6279af8bafd66b1207cb7e
7
+ data.tar.gz: e2af15f4e0934c31719d3704d655f4f9098ece606669a7896e318a7aab2ed45452197636f04313f12eabf6d5ba8e8162e311bf5016bdb351fbc138ad86a813be
@@ -43,7 +43,6 @@ module Dumb
43
43
  template_names.each do |template|
44
44
  templates[template] = {
45
45
  template_path: "#{templates_path}/#{template}",
46
- root_path: "#{templates_path}/#{template}/root",
47
46
  linker_path: "#{templates_path}/#{template}/linker.yml",
48
47
  variables_path: "#{templates_path}/#{template}/variables.yml"
49
48
  }
@@ -57,14 +57,15 @@ TEXT
57
57
  # All paths are relative
58
58
 
59
59
  root:
60
+ dgen_source_directory: "root"
60
61
  link_destination_directory: "../../src/{{file_name}}"
61
62
  links:
62
63
  - link:
63
64
  dgen_template: "subdir/file.dgen"
64
- to_destinaiton_file: "subdir/{{file_name}}_file.txt"
65
+ to_destination_file: "subdir/{{file_name}}_file.txt"
65
66
  - link:
66
67
  dgen_template: "file.dgen"
67
- to_destinaiton_file: "{{file_name}}_file.txt"
68
+ to_destination_file: "{{file_name}}_file.txt"
68
69
  TEXT
69
70
 
70
71
  file.close
@@ -17,6 +17,7 @@ module Dumb
17
17
 
18
18
  def execute!
19
19
  root = dgen_linker['root']
20
+ dgen_source_directory = root['dgen_source_directory']
20
21
  link_destination_directory = root['link_destination_directory']
21
22
  links = root['links']
22
23
  template_path = config[:template_path]
@@ -24,8 +25,8 @@ module Dumb
24
25
  links.each do |link|
25
26
  link.transform_keys!(&:to_sym)
26
27
 
27
- file_path = template_path + '/' + link_destination_directory + '/' + link[:to_destinaiton_file]
28
- template_content = File.read(config[:root_path] + '/' + link[:dgen_template])
28
+ file_path = template_path + '/' + link_destination_directory + '/' + link[:to_destination_file]
29
+ template_content = File.read(dgen_source_directory + '/' + link[:dgen_template])
29
30
 
30
31
  parsed_path = PathParser.new(file_path, variables).parse
31
32
  parsed_content = ContentParser.new(template_content, variables).parse
@@ -14,6 +14,7 @@ module Dumb
14
14
 
15
15
  private
16
16
  def validate_template_exists!
17
+ # add contents validators
17
18
  linker_missing = !File.exist?("#{templates_path}/#{template_name}/linker.yml")
18
19
  variables_missing = !File.exist?("#{templates_path}/#{template_name}/variables.yml")
19
20
  root_missing = !File.directory?("#{templates_path}/#{template_name}/root")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dumb_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cristian Cosneanu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-03 00:00:00.000000000 Z
11
+ date: 2024-01-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a simple scaffolding generator. A Copy-Paste tool with some extra
14
14
  features like variable injection, and it intends on remaining like this.