bozo-scripts 0.18.4 → 0.18.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/bozo/erubis_templating_coordinator.rb +20 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70e2b7d9448abedc68f4a9f16234a13c73ba18b1
|
4
|
+
data.tar.gz: 5e4c688f3a2a905bad80a260924ce2afd2ce5d46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d501fdd61ae9a2a34127fb5f6d803f499bfd58c3fbc686e779b5f15873eff2975dbd79600a678524e6c09cdedf697e44f2bc55d1d345987a63b3ddb806b83f9
|
7
|
+
data.tar.gz: ba0482c12d6eb4c992674487ade96d7355798db0e8bcad3fc1bbbfd49a9a8c7d601dc18f215e81a232ba3de2f73b0a7a3704e0a6ae95ce374961083e931f196a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.18.
|
1
|
+
0.18.5
|
@@ -96,7 +96,16 @@ module Bozo
|
|
96
96
|
# A block that will be called with the template path and target file
|
97
97
|
# path when provided.
|
98
98
|
def generate_files(&block)
|
99
|
-
@templates.each {|template| generate_file template, block}
|
99
|
+
@templates.each {|template| generate_file template, block, false}
|
100
|
+
end
|
101
|
+
|
102
|
+
# Generate all the files matching the underlying configuration, preserving line-endings.
|
103
|
+
#
|
104
|
+
# @param [Proc] block
|
105
|
+
# A block that will be called with the template path and target file
|
106
|
+
# path when provided.
|
107
|
+
def generate_binary_files(&block)
|
108
|
+
@templates.each {|template| generate_file template, block, true}
|
100
109
|
end
|
101
110
|
|
102
111
|
private
|
@@ -110,7 +119,10 @@ module Bozo
|
|
110
119
|
# @param [Proc] block
|
111
120
|
# A block that will be called with the template path and target file
|
112
121
|
# path when provided.
|
113
|
-
|
122
|
+
# @param [Boolean] write_binary
|
123
|
+
# Forces the output file to keep its line-endings as-is
|
124
|
+
#
|
125
|
+
def generate_file(template_path, block, write_binary = false)
|
114
126
|
target_path = template_path.sub /\.[^\.]+$/, ''
|
115
127
|
|
116
128
|
block.call(template_path, target_path) unless block.nil?
|
@@ -120,9 +132,13 @@ module Bozo
|
|
120
132
|
|
121
133
|
content = @configuration.apply {|binding| template.result(binding)}
|
122
134
|
|
123
|
-
|
135
|
+
if write_binary
|
136
|
+
File.open(target_path, 'wb') {|f| f.write(content)}
|
137
|
+
else
|
138
|
+
File.open(target_path, 'w+') {|f| f.write(content)}
|
139
|
+
end
|
124
140
|
end
|
125
141
|
|
126
142
|
end
|
127
143
|
|
128
|
-
end
|
144
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bozo-scripts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garry Shutler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-08-
|
12
|
+
date: 2017-08-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|