Sha256: f2ec3a42c62268aec29843a5eb43b249b05bd9b9b110435df4e2f6140283602f

Contents?: true

Size: 541 Bytes

Versions: 22

Compression:

Stored size: 541 Bytes

Contents

# encoding: utf-8

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

22 entries across 22 versions & 1 rubygems

Version Path
epuber-0.6.0 lib/epuber/helper.rb
epuber-0.5.7 lib/epuber/helper.rb
epuber-0.5.6 lib/epuber/helper.rb
epuber-0.5.5 lib/epuber/helper.rb
epuber-0.5.4 lib/epuber/helper.rb
epuber-0.5.3 lib/epuber/helper.rb
epuber-0.5.2 lib/epuber/helper.rb
epuber-0.5.1 lib/epuber/helper.rb
epuber-0.5.0 lib/epuber/helper.rb
epuber-0.5.0.beta.5 lib/epuber/helper.rb
epuber-0.5.0.beta.4 lib/epuber/helper.rb
epuber-0.5.0.beta.3 lib/epuber/helper.rb
epuber-0.5.0.beta.2 lib/epuber/helper.rb
epuber-0.5.0.beta lib/epuber/helper.rb
epuber-0.4.0 lib/epuber/helper.rb
epuber-0.3.12 lib/epuber/helper.rb
epuber-0.3.11 lib/epuber/helper.rb
epuber-0.3.10 lib/epuber/helper.rb
epuber-0.3.9 lib/epuber/helper.rb
epuber-0.3.7 lib/epuber/helper.rb