Class: Texas::Build::Task::CopyContentsToBuildPath
- Inherits:
-
Base
- Object
- Base
- Texas::Build::Task::CopyContentsToBuildPath
show all
- Defined in:
- lib/texas/build/task/copy_contents_to_build_path.rb
Overview
This build task copies all the templates in the current project’s contents directory to the build directory.
Instance Attribute Summary
Attributes inherited from Base
#build
Instance Method Summary
collapse
Methods inherited from Base
#initialize
#trace, #verbose, #warning
Instance Method Details
#build_path ⇒ Object
13
14
15
|
# File 'lib/texas/build/task/copy_contents_to_build_path.rb', line 13
def build_path
build.__path__
end
|
#contents_dir ⇒ Object
17
18
19
|
# File 'lib/texas/build/task/copy_contents_to_build_path.rb', line 17
def contents_dir
build.contents_dir
end
|
#copy_to_build_path ⇒ Object
26
27
28
29
|
# File 'lib/texas/build/task/copy_contents_to_build_path.rb', line 26
def copy_to_build_path
FileUtils.rm_r build_path
FileUtils.cp_r contents_dir, build_path
end
|
#ensure_build_path_exists ⇒ Object
21
22
23
24
|
# File 'lib/texas/build/task/copy_contents_to_build_path.rb', line 21
def ensure_build_path_exists
FileUtils.mkdir_p build_path
rescue
end
|
#run ⇒ Object
8
9
10
11
|
# File 'lib/texas/build/task/copy_contents_to_build_path.rb', line 8
def run
ensure_build_path_exists
copy_to_build_path
end
|