Sha256: a35e5016e30e6b2d4b5282e8492d4ad04183f4ebaa218e7eadbf184e7f3d2fd9

Contents?: true

Size: 893 Bytes

Versions: 10

Compression:

Stored size: 893 Bytes

Contents

# frozen_string_literal: true

module Epuber
  class Compiler
    module FileTypes
      require_relative 'abstract_file'

      class GeneratedFile < AbstractFile
        # @return [String | #to_s] files content
        #
        attr_accessor :content

        # @param [Compiler::CompilationContext] compilation_context
        #
        def process(_compilation_context)
          write_generate(content.to_s)
        end

        def write_generate(content)
          if self.class.write_to_file?(content, final_destination_path)
            UI.print_processing_debug_info("#{pkg_destination_path}: Writing generated content")
            self.class.write_to_file!(content, final_destination_path)
          else
            UI.print_processing_debug_info("#{pkg_destination_path}: Not writing to disk ... generated content is same")
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
epuber-0.11.1 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.11.0 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.10.3 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.10.2 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.10.1 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.9.3 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.9.2 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.9.1 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.9.0 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.8.0 lib/epuber/compiler/file_types/generated_file.rb