Sha256: 7e5981d9302fadb06732a603edf580552cb739b391b86f0c5308b4c50982f7b6
Contents?: true
Size: 919 Bytes
Versions: 13
Compression:
Stored size: 919 Bytes
Contents
# frozen_string_literal: true require 'ostruct' require 'eac_ruby_utils/core_ext' module EhbrsRubyUtils module WebUtils module Videos class File < ::SimpleDelegator require_sub __FILE__ def initialize(data) super(data.to_struct) end def exist? ::File.exist?(original_path) end def move(target_dir) ::EhbrsRubyUtils::WebUtils::Videos::File::Rename.new( self, target_dir.to_pathname.join(original_path.to_pathname.relative_path_from(root_path)) ).perform end def path_changed? original_path != new_path end def remove return unless exist? ::File.unlink(original_path) end def rename ::EhbrsRubyUtils::WebUtils::Videos::File::Rename.new(self, new_path).perform end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems