Method: Metior::Report#copy_assets

Defined in:
lib/metior/report.rb

#copy_assets(target_dir) ⇒ Object (private)

Copies the assets coming with this report to the given target directory

This will copy the contents of the images, javascript and stylesheets directories inside the report's path into the target directory.

Parameters:

  • target_dir (String)

    The target directory of the report

[View source]

126
127
128
129
130
131
132
133
134
135
# File 'lib/metior/report.rb', line 126

def copy_assets(target_dir)
  FileUtils.mkdir_p target_dir

  %w{images javascripts stylesheets}.map do |type|
    File.join(self.class.path, type)
  end.each do |src|
    next unless File.directory? src
    FileUtils.cp_r src, target_dir
  end
end