Sha256: 2bf4882f5bea548c50a9d82a3173f766a0eaf5a20ade07f526e33ba104589a24
Contents?: true
Size: 979 Bytes
Versions: 21
Compression:
Stored size: 979 Bytes
Contents
require "cucumber/formatter/html" require "uri" require "pathname" # @!visibility private module Calabash # @!visibility private module Formatters # @!visibility private class Html < ::Cucumber::Formatter::Html # @!visibility private def embed_image(src, label) if _output_relative? && _relative_uri?(src) output_dir = Pathname.new(File.dirname(@io.path)) src_path = Pathname.new(src) embed_relative_path = src_path.relative_path_from(output_dir) super(embed_relative_path.to_s, label) else super(src, label) end end # @!visibility private def _relative_uri?(src) uri = URI.parse(src) return false if uri.scheme not Pathname.new(src).absolute? end # @!visibility private def _output_relative? if @io.is_a?(File) path = @io.path _relative_uri?(path) end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems