class Calabash::Formatters::Html

@!visibility private

Public Instance Methods

_output_relative?() click to toggle source

@!visibility private

# File lib/calabash/formatters/html.rb, line 31
def _output_relative?
  if @io.is_a?(File)
    path = @io.path
    _relative_uri?(path)
  end
end
_relative_uri?(src) click to toggle source

@!visibility private

# File lib/calabash/formatters/html.rb, line 24
def _relative_uri?(src)
  uri = URI.parse(src)
  return false if uri.scheme
  not Pathname.new(src).absolute?
end
embed_image(src, label) click to toggle source

@!visibility private

Calls superclass method
# File lib/calabash/formatters/html.rb, line 12
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