Class: Texas::Build::Task::CopyContentsToBuildPath

Inherits:
Base
  • Object
show all
Defined in:
lib/texas/build/task/copy_contents_to_build_path.rb

Instance Attribute Summary

Attributes inherited from Base

#build

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Texas::Build::Task::Base

Instance Method Details

#build_pathObject



10
11
12
# File 'lib/texas/build/task/copy_contents_to_build_path.rb', line 10

def build_path
  build.__path__
end

#contents_dirObject



14
15
16
# File 'lib/texas/build/task/copy_contents_to_build_path.rb', line 14

def contents_dir
  build.contents_dir
end

#copy_to_build_pathObject



23
24
25
26
# File 'lib/texas/build/task/copy_contents_to_build_path.rb', line 23

def copy_to_build_path
  FileUtils.rm_r build_path
  FileUtils.cp_r contents_dir, build_path
end

#ensure_build_path_existsObject



18
19
20
21
# File 'lib/texas/build/task/copy_contents_to_build_path.rb', line 18

def ensure_build_path_exists
  FileUtils.mkdir_p build_path
  rescue
end

#runObject



5
6
7
8
# File 'lib/texas/build/task/copy_contents_to_build_path.rb', line 5

def run
  ensure_build_path_exists
  copy_to_build_path
end