retrospec 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0659917a8ec821253617d285409639b144be2979
4
- data.tar.gz: 4a797031adc73b0bdf1a031d5298682f6b08cc47
3
+ metadata.gz: 9b3ddbc7c0c7df5aec19bac82b036e5f407adfe5
4
+ data.tar.gz: d1a3b1a087a5348f884e7a73c5076a17f34eed85
5
5
  SHA512:
6
- metadata.gz: 6b0e34a19203df1f8244021fcfda2f9b5ba89465ce2611405cd81ef0c675124a86995eff308680c0da79e1a6d9812106f5bc509600a6b83f1cf0bf1a36658c68
7
- data.tar.gz: f6c4d3c7c6457fa5dbc5c6e63cc3d4f7affae20a43daff185bfd154e225a25573b9cd8bd914fddc46679ba7b5015df2683eb98765c11b79edb674ee825383d2c
6
+ metadata.gz: 0a00933dd5c1bb49c0a8231f5c9f05bc0e3d56678cc6c8d4498d732d5c7ce524b0fcab8c40d5955b44cd55ac801dfc36618800a3c6cd0b2c5f7a34bfb8ddc1f5
7
+ data.tar.gz: 58839f2112a8162ec92bf6f99ae663929811aec88229dd04fd27f747135e2b7670556d4db452b2ea3cfea86153ea8956c8d7f152c9c1440f0fc5ed15ed0b2a6d
@@ -1,4 +1,6 @@
1
1
  # Retrospec Changelog
2
+ ## 0.6.1
3
+ * Adds ability to create files from any template directory
2
4
  ## 0.6.0
3
5
  * Adds the ability to filter out certain files from being generated
4
6
  * Adds the ability to sync any module file when it ends contains a .sync in the file name
@@ -189,7 +189,7 @@ module Retrospec
189
189
  end
190
190
  end
191
191
 
192
- # creates any file that is contained in the templates/modules_files directory structure
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 safe_create_module_files(template_dir, module_path, spec_object, filter = nil)
202
- dir = File.join(template_dir,'module_files')
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(File.join(template_dir,'module_files'), module_path)
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
@@ -1,4 +1,4 @@
1
1
  module Retrospec
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.1'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retrospec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Osman