Sha256: 69a35115d287422a36d9d920223f660e29773015af3ed4dda6d4c74ab05080bf

Contents?: true

Size: 881 Bytes

Versions: 15

Compression:

Stored size: 881 Bytes

Contents

# encoding: utf-8


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

15 entries across 15 versions & 1 rubygems

Version Path
epuber-0.6.0 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.7 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.6 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.5 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.4 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.3 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.2 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.1 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.0 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.0.beta.5 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.0.beta.4 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.0.beta.3 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.0.beta.2 lib/epuber/compiler/file_types/generated_file.rb
epuber-0.5.0.beta lib/epuber/compiler/file_types/generated_file.rb
epuber-0.4.0 lib/epuber/compiler/file_types/generated_file.rb