Sha256: ac23074d59e5bacab551c857662ceebae46556e5bf01f4185ebb4e84a2241efb

Contents?: true

Size: 1.51 KB

Versions: 7

Compression:

Stored size: 1.51 KB

Contents

# encoding: utf-8


module Epuber
  class Compiler
    module FileTypes
      require_relative 'abstract_file'

      class SourceFile < AbstractFile

        # @return [String] relative source path
        #
        attr_reader :source_path

        # @return [String] absolute source path
        #
        attr_accessor :abs_source_path

        # @return [Epuber::Book::FileRequest]
        #
        attr_accessor :file_request

        # @param [String] source_path  relative path from project root to source file
        #
        def initialize(source_path)
          @source_path = source_path
        end

        def default_file_copy
          if self.class.file_copy?(abs_source_path, final_destination_path)
            UI.print_processing_debug_info("Copying to #{pkg_destination_path}")
            self.class.file_copy!(abs_source_path, final_destination_path)
          end
        end

        def write_compiled(content)
          if self.class.write_to_file?(content, final_destination_path)
            UI.print_processing_debug_info("Writing compiled version to #{pkg_destination_path}")
            self.class.write_to_file!(content, final_destination_path)
          end
        end

        def write_processed(content)
          if self.class.write_to_file?(content, final_destination_path)
            UI.print_processing_debug_info("Writing processed version to #{pkg_destination_path}")
            self.class.write_to_file!(content, final_destination_path)
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
epuber-0.3.12 lib/epuber/compiler/file_types/source_file.rb
epuber-0.3.11 lib/epuber/compiler/file_types/source_file.rb
epuber-0.3.10 lib/epuber/compiler/file_types/source_file.rb
epuber-0.3.9 lib/epuber/compiler/file_types/source_file.rb
epuber-0.3.7 lib/epuber/compiler/file_types/source_file.rb
epuber-0.3.6 lib/epuber/compiler/file_types/source_file.rb
epuber-0.3.5 lib/epuber/compiler/file_types/source_file.rb