Sha256: fadd611cf224c2c40643d816bdce93d5d6d64fc0895f5bff821199e6c1815113

Contents?: true

Size: 552 Bytes

Versions: 10

Compression:

Stored size: 552 Bytes

Contents

# frozen_string_literal: true

module Epuber
  module Helper
    # @param [Book::TocItem] toc_item
    # @param [Compiler::FileResolver] file_resolver
    # @param [String] context_path
    #
    # @return [String]
    #
    def self.destination_path_for_toc_item(toc_item, file_resolver, context_path)
      file = file_resolver.file_from_request(toc_item.file_request)
      path = [file.final_destination_path, toc_item.file_fragment].compact.join('#')

      Pathname.new(path).relative_path_from(Pathname.new(context_path)).to_s
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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