class StreamdeckProf::LazyFile

Attributes

source_path[RW]

Public Class Methods

new(source_path) click to toggle source
# File lib/streamdeck_prof/lazy_file.rb, line 9
def initialize(source_path)
  @source_path = source_path
end

Public Instance Methods

save(path) click to toggle source
# File lib/streamdeck_prof/lazy_file.rb, line 13
def save(path)
  file_dir = File.dirname(path)
  FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)

  FileUtils.copy(source_path, path) unless File.realdirpath(path) == File.realdirpath(source_path)
end