Class: RubiGen::Commands::Create
Overview
:nodoc:
Instance Method Summary collapse
-
#clean ⇒ Object
Remove every file from destination_path Useful to remove temporary dirs.
-
#mirror(relative_source, relative_destination) ⇒ Object
Copy one directory to another in destination_path Can be useful to duplicate index from development to production, instead of indexing twice.
-
#rake(task_name) ⇒ Object
Launch given Rake task in destination_path.
Instance Method Details
#clean ⇒ Object
Remove every file from destination_path Useful to remove temporary dirs.
24 25 26 |
# File 'lib/rubigen_ext.rb', line 24 def clean FileUtils.remove_entry_secure destination_path('') end |
#mirror(relative_source, relative_destination) ⇒ Object
Copy one directory to another in destination_path Can be useful to duplicate index from development to production, instead of indexing twice.
15 16 17 18 19 20 |
# File 'lib/rubigen_ext.rb', line 15 def mirror(relative_source,relative_destination) logger.mirror "#{relative_source} -> #{relative_destination}" source = destination_path(relative_source) destination = destination_path(relative_destination) FileUtils.cp_r source, destination end |
#rake(task_name) ⇒ Object
Launch given Rake task in destination_path
5 6 7 8 9 10 |
# File 'lib/rubigen_ext.rb', line 5 def rake(task_name) logger.rake task_name Dir.chdir(destination_path('')){ system("rake #{task_name}") } end |