Sha256: 6158e22c23051e00e621a8d245ce376a97a4e4081ed8e539a787da4921a866b0
Contents?: true
Size: 622 Bytes
Versions: 57
Compression:
Stored size: 622 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' module EhbrsRubyUtils module WebUtils module Videos class File < ::SimpleDelegator class Rename common_constructor :file, :target_path delegate :original_path, to: :file def can_rename? ::File.exist?(original_path) && !::File.exist?(target_path) end def perform return unless can_rename? ::FileUtils.mkdir_p(::File.dirname(target_path)) ::FileUtils.mv(original_path, target_path) end end end end end end
Version data entries
57 entries across 57 versions & 2 rubygems