bozo-scripts 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/VERSION +1 -1
- data/lib/bozo/preparers/file_templating.rb +16 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTdmZmM2NWE5NGQ4NzhkMDkwNDFhNTllOTEyZjU0MTVmYmIwNDA1ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmJlMDJiYzgzZTEyYTQxZjg0NTI1NjJmODExOTEyMTJjYWMxYTIwNw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWJhOWQyMzJlZTViZDZlNDlkZTJhYzZkMjQ1NjQ1MTk3YTZhZGFiMWNiMzYz
|
10
|
+
OTcxZTAxOTIwNWVlMDg5NWIyNmZiZmVlZjgwZjc5N2VhMDY4OTQ5YWJiM2U4
|
11
|
+
OTAxYTkyNzc0YTZiYzNiOTU0NTIxYjAxOTM0NjA1MjE3MDFkZjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2MxMjY1NmMzZTA0MDE3MjZhYTU1MTc3Mzc5ZGY3ZjU1MjlkN2NhY2RjNWY1
|
14
|
+
OWQxNTY2OTViNjBmYTQ1ZjJiYTVhMTdjMzI5MzgyMjBlZTlmMmU0MjU1YjMy
|
15
|
+
ZGJkMTdlMTMxMmEzM2I5ZTAzZTIxYjY1YjE4NTI2YzA5ODZkZTQ=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
@@ -22,6 +22,7 @@ module Bozo::Preparers
|
|
22
22
|
# t.config_path 'somewhere' # defaults to 'config' if not specified
|
23
23
|
# t.config_file 'my/specific/file.rb' # must be a specific file
|
24
24
|
# t.template_files 'src/**/*.config.template' # can use glob format
|
25
|
+
# t.exclude_files 'src/**/obj/*' # can exclude specific files
|
25
26
|
# end
|
26
27
|
#
|
27
28
|
# Source files are expected to have an additional extension compared to the
|
@@ -69,6 +70,7 @@ module Bozo::Preparers
|
|
69
70
|
@config_path = 'config'
|
70
71
|
@template_globs = []
|
71
72
|
@config_files = []
|
73
|
+
@exclude_globs = []
|
72
74
|
end
|
73
75
|
|
74
76
|
# Sets the path of the directory within which the preparer should look for
|
@@ -97,6 +99,15 @@ module Bozo::Preparers
|
|
97
99
|
@template_globs << glob
|
98
100
|
end
|
99
101
|
|
102
|
+
# Adds a set of templates files from which to exclude from templating.
|
103
|
+
#
|
104
|
+
# @param [String] glob
|
105
|
+
# A glob that points to a set of files that should be excluded from
|
106
|
+
# the templating engine.
|
107
|
+
def exclude_files(glob)
|
108
|
+
@exclude_globs << glob
|
109
|
+
end
|
110
|
+
|
100
111
|
# Generate all the files matching the configuration.
|
101
112
|
def execute
|
102
113
|
log_info '' # formatting
|
@@ -142,8 +153,12 @@ module Bozo::Preparers
|
|
142
153
|
|
143
154
|
# Adds the templates to the templating coordinator.
|
144
155
|
def add_templates(coordinator)
|
156
|
+
exclude = @exclude_globs.map { |glob| Dir[glob] }.flatten
|
157
|
+
|
145
158
|
@template_globs.each do |glob|
|
146
|
-
|
159
|
+
Dir[glob].each do |file|
|
160
|
+
coordinator.template_file file unless exclude.include?(file)
|
161
|
+
end
|
147
162
|
end
|
148
163
|
end
|
149
164
|
|