Sha256: 463e90815f5bd9eadfcaabc3574480ffbe6f7d8e897ae11f1c46fc18fbf31f0c
Contents?: true
Size: 1.06 KB
Versions: 35
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true require 'avm/file_formats/base' require 'avm/file_formats/file_result' require 'avm/file_formats/utf8_assert' require 'eac_ruby_utils/core_ext' module Avm module EacGenericBase0 class FileFormats class Base < ::Avm::FileFormats::Base class Apply enable_method_class common_constructor :file_format, :files # @return [Enumerable<Avm::FileFormats::FileResult>] def result old_content = Hash[files.map { |f| [f, File.read(f)] }] ::Avm::FileFormats::Utf8Assert.assert_files(files) { file_format.internal_apply(files) } files.map { |f| file_result(f, old_content[f]) } end # @param path [Pathname] # @param old_content [String] # @return [Avm::FileFormats::FileResult] def file_result(file, old_content) ::Avm::FileFormats::FileResult.new(file, file_format.class, old_content != File.read(file)) end end end end end end
Version data entries
35 entries across 35 versions & 2 rubygems