|
Revision 263, 0.9 kB
(checked in by eric.dumin..@gmail.com, 7 months ago)
|
Removing extra whitespaces at endline.
|
| Line | |
|---|
| 1 |
module RubiGen #:nodoc: |
|---|
| 2 |
module Commands #:nodoc: |
|---|
| 3 |
class Create #:nodoc: |
|---|
| 4 |
# Launch given Rake task in destination_path |
|---|
| 5 |
def rake(task_name) |
|---|
| 6 |
logger.rake task_name |
|---|
| 7 |
Dir.chdir(destination_path('')){ |
|---|
| 8 |
system("rake #{task_name}") |
|---|
| 9 |
} |
|---|
| 10 |
end |
|---|
| 11 |
|
|---|
| 12 |
# Copy one directory to another in destination_path |
|---|
| 13 |
# Can be useful to duplicate index from development to production, |
|---|
| 14 |
# instead of indexing twice. |
|---|
| 15 |
def mirror(relative_source,relative_destination) |
|---|
| 16 |
logger.mirror "#{relative_source} -> #{relative_destination}" |
|---|
| 17 |
source = destination_path(relative_source) |
|---|
| 18 |
destination = destination_path(relative_destination) |
|---|
| 19 |
FileUtils.cp_r source, destination |
|---|
| 20 |
end |
|---|
| 21 |
|
|---|
| 22 |
# Remove every file from destination_path |
|---|
| 23 |
# Useful to remove temporary dirs. |
|---|
| 24 |
def clean |
|---|
| 25 |
FileUtils.remove_entry_secure destination_path('') |
|---|
| 26 |
end |
|---|
| 27 |
end |
|---|
| 28 |
end |
|---|
| 29 |
end |
|---|