Module: RevealCK::Builders::RakeAware

Included in:
CreationTask
Defined in:
lib/reveal-ck/builders/rake_aware.rb

Overview

Classes including this module reference a Rake application, and know how to add tasks to it. They also know how to use it to copy files and create directories.

Instance Method Summary collapse

Instance Method Details

#copy_file(source, destination) ⇒ Object



13
14
15
16
17
# File 'lib/reveal-ck/builders/rake_aware.rb', line 13

def copy_file(source, destination)
  application.define_task(Rake::FileTask, destination => source) do
    FileUtils.cp source, destination
  end
end

#create_directory(dir) ⇒ Object



19
20
21
22
23
# File 'lib/reveal-ck/builders/rake_aware.rb', line 19

def create_directory(dir)
  application.define_task(Rake::Task, dir) do
    FileUtils.mkdir_p dir
  end
end

#task(*args, &block) ⇒ Object



9
10
11
# File 'lib/reveal-ck/builders/rake_aware.rb', line 9

def task(*args, &block)
  application.define_task(Rake::Task, *args, &block)
end