Class: RubiGen::Commands::Create

Inherits:
Object
  • Object
show all
Defined in:
lib/rubigen_ext.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#cleanObject

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