retrospec 0.6.0 → 0.6.1
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/CHANGELOG.md +2 -0
- data/lib/retrospec/plugins/v1/module_helpers.rb +20 -5
- data/lib/retrospec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b3ddbc7c0c7df5aec19bac82b036e5f407adfe5
|
4
|
+
data.tar.gz: d1a3b1a087a5348f884e7a73c5076a17f34eed85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a00933dd5c1bb49c0a8231f5c9f05bc0e3d56678cc6c8d4498d732d5c7ce524b0fcab8c40d5955b44cd55ac801dfc36618800a3c6cd0b2c5f7a34bfb8ddc1f5
|
7
|
+
data.tar.gz: 58839f2112a8162ec92bf6f99ae663929811aec88229dd04fd27f747135e2b7670556d4db452b2ea3cfea86153ea8956c8d7f152c9c1440f0fc5ed15ed0b2a6d
|
data/CHANGELOG.md
CHANGED
@@ -189,7 +189,7 @@ module Retrospec
|
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
|
-
# creates any file that is contained in the
|
192
|
+
# creates any file that is contained in the templates_dir directory structure
|
193
193
|
# loops through the directory looking for erb files or other files.
|
194
194
|
# strips the erb extension and renders the template to the current module path
|
195
195
|
# filenames must named how they would appear in the normal module path. The directory
|
@@ -198,12 +198,11 @@ module Retrospec
|
|
198
198
|
# @param [String] module_path - path to the module
|
199
199
|
# @param [String] spec_object - the context that is used for template rendering
|
200
200
|
# @param [String] filter - a regex string used to filter out files
|
201
|
-
def
|
202
|
-
|
203
|
-
templates = Find.find(dir).sort
|
201
|
+
def safe_create_directory_files(template_dir, module_path, spec_object, filter = nil)
|
202
|
+
templates = Find.find(template_dir).sort
|
204
203
|
templates.each do |template|
|
205
204
|
next if template =~ filter
|
206
|
-
dest = template.gsub(
|
205
|
+
dest = template.gsub(template_dir, module_path)
|
207
206
|
if File.symlink?(template)
|
208
207
|
safe_create_symlink(template, dest)
|
209
208
|
elsif File.directory?(template)
|
@@ -224,6 +223,22 @@ module Retrospec
|
|
224
223
|
end
|
225
224
|
end
|
226
225
|
end
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
# creates any file that is contained in the templates/modules_files directory structure
|
230
|
+
# loops through the directory looking for erb files or other files.
|
231
|
+
# strips the erb extension and renders the template to the current module path
|
232
|
+
# filenames must named how they would appear in the normal module path. The directory
|
233
|
+
# structure where the file is contained
|
234
|
+
# @param [String] template directory of where to find templates
|
235
|
+
# @param [String] module_path - path to the module
|
236
|
+
# @param [String] spec_object - the context that is used for template rendering
|
237
|
+
# @param [String] filter - a regex string used to filter out files
|
238
|
+
def safe_create_module_files(template_dir, module_path, spec_object, filter = nil)
|
239
|
+
dir = File.join(template_dir,'module_files')
|
240
|
+
safe_create_directory_files(dir, module_path, spec_object, filter = nil)
|
241
|
+
end
|
227
242
|
end
|
228
243
|
end
|
229
244
|
end
|
data/lib/retrospec/version.rb
CHANGED