Class: Texas::Build::Task::AddDefaultTemplatesToBuildPath

Inherits:
Base
  • Object
show all
Defined in:
lib/texas/build/task/add_default_templates_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



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

def build_path
  build.__path__
end

#runObject



9
10
11
12
13
14
15
16
17
# File 'lib/texas/build/task/add_default_templates_to_build_path.rb', line 9

def run
  glob = File.join(Texas.texas_dir, Texas.contents_subdir_name, '*.*')
  Dir[glob].each do |filename|
    dest = File.join(build_path, File.basename(filename))
    unless File.exists?(dest)
      FileUtils.cp filename, build_path
    end
  end
end