kojo 0.2.3 → 0.2.4
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 +4 -4
- data/README.md +6 -5
- data/lib/kojo/collection.rb +1 -1
- data/lib/kojo/extensions/string.rb +14 -0
- data/lib/kojo/template.rb +2 -2
- data/lib/kojo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf86e9c731c19158840673852b2edb3fdb047ff1e80170ba8f33685c40e677c1
|
4
|
+
data.tar.gz: 38d5f668d58d4681e635cfb73944f4a5927a9865a9e72f1040cfa968f119186c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9abd6c45fc2cf8a92659db86914ed4baa0e4754d117ae348444b5dcceed7301f7e3f822d3fcf7ad0602be4bdcaa29d8c58e19aff5071c3321c849e1a4e937df
|
7
|
+
data.tar.gz: 4358ffb8cde4c83ec10aa73e2f5bae4c34b369200cfeb1abe837249528a7cfcc16d5ed2c80967232795a38c14dc49a95a9f96ee9bfa0f6c70c199c4d225fcb4d
|
data/README.md
CHANGED
@@ -50,13 +50,12 @@ relevant files, and the expected output.
|
|
50
50
|
|
51
51
|

|
52
52
|
|
53
|
-
Include variables in your configuration templates using this syntax:
|
54
|
-
|
55
|
-
```ruby
|
56
|
-
%{varname}
|
57
|
-
```
|
53
|
+
Include variables in your configuration templates by using this syntax:
|
54
|
+
`%{varname}`
|
58
55
|
|
59
56
|
- Variables can be provided through the command line, or when using `@import`.
|
57
|
+
- When one or more variables are not provided, you will be prompted to provide
|
58
|
+
a value.
|
60
59
|
- Variables from the top level will be forwarded downstream, and aggregated
|
61
60
|
with any additional variables that are defined in subsequent `@imports`.
|
62
61
|
|
@@ -92,6 +91,8 @@ The space after `filename` is optional.
|
|
92
91
|
Process a folder containing templates and `@imports`, and generate a mirror
|
93
92
|
output folder, with all the variables and `@imports` evaluated.
|
94
93
|
|
94
|
+
You may use `%{variables}` in filenames.
|
95
|
+
|
95
96
|
|
96
97
|
|
97
98
|
### One to Many Generation
|
data/lib/kojo/collection.rb
CHANGED
@@ -15,4 +15,18 @@ class String
|
|
15
15
|
|
16
16
|
end
|
17
17
|
end
|
18
|
+
|
19
|
+
def resolve(vars)
|
20
|
+
self % vars
|
21
|
+
|
22
|
+
rescue KeyError => e
|
23
|
+
print "> #{e.key}: "
|
24
|
+
response = $stdin.gets
|
25
|
+
|
26
|
+
raise Kojo::TemplateError, e.message unless response
|
27
|
+
|
28
|
+
vars[e.key] = response.chomp
|
29
|
+
retry
|
30
|
+
end
|
31
|
+
|
18
32
|
end
|
data/lib/kojo/template.rb
CHANGED
data/lib/kojo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kojo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mister_bin
|