filegen 0.2.3 → 0.3.0
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.
- data/CHANGELOG.md +6 -0
- data/README.md +14 -10
- data/lib/filegen/erb_generator.rb +1 -1
- data/lib/filegen/version.rb +1 -1
- metadata +1 -1
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
0.2.4: 2014-01-14
|
2
|
+
* Activate erb trim mode (see http://ruby-doc.org/stdlib-2.0.0/libdoc/erb/rdoc/ERB.html : new)
|
3
|
+
|
4
|
+
0.2.3: 2014-01-14
|
5
|
+
* Handle SIG INT
|
6
|
+
|
1
7
|
0.2.2: 2014-01-14
|
2
8
|
* Better error messages if template file name is missing
|
3
9
|
* Refactoring of ui messages
|
data/README.md
CHANGED
@@ -32,24 +32,29 @@ available on the commandline.
|
|
32
32
|
Please make sure you have an ERB-template available. It needs to end with
|
33
33
|
`.erb`! Place in anywhere you like. It's important that the name of variable in
|
34
34
|
the template matches the name of environment variable or yaml-key: wording,
|
35
|
-
case. The lookup is case-sensitive. If you want to
|
36
|
-
you need to
|
37
|
-
|
35
|
+
case. The lookup is case-sensitive. If you want to write the output to a file
|
36
|
+
you need to redirect stdout with `>`. Otherwise it will output the content on
|
37
|
+
`$stdout`.
|
38
|
+
|
39
|
+
### Variable lookup
|
40
|
+
|
41
|
+
If you want to get access to the variable, you need to use the `lookup`-method.
|
38
42
|
|
39
43
|
```ruby
|
40
44
|
# look up variable
|
41
45
|
lookup(<variable>)
|
46
|
+
```
|
47
|
+
|
48
|
+
The `lookup`-method will return an empty string '' if a variable cannot be
|
49
|
+
looked up. If a default value is given it will return the default value instead
|
50
|
+
of the empty string.
|
42
51
|
|
52
|
+
```ruby
|
43
53
|
# look up variable and use default value if variable is undefined
|
44
54
|
lookup(<variable>, <default_value>)
|
45
55
|
```
|
46
56
|
|
47
|
-
|
48
|
-
to redirect stdout with `>`. Otherwise it will output the content on `$stdout`.
|
49
|
-
|
50
|
-
### Variable lookup
|
51
|
-
|
52
|
-
The default order of data sources to lookup a variable, is: 1st environment
|
57
|
+
The default order of data sources to lookup a variable, is: 1st environment
|
53
58
|
variable and 2nd yaml file. The yaml file needs be given as command line argument
|
54
59
|
see below at [Generate a file based on YAML file](#yaml).
|
55
60
|
|
@@ -69,7 +74,6 @@ commandline
|
|
69
74
|
--data-sources yaml
|
70
75
|
```
|
71
76
|
|
72
|
-
|
73
77
|
### Generate a file based on Environment Variables
|
74
78
|
|
75
79
|
The content of `template.erb`:
|
data/lib/filegen/version.rb
CHANGED