Class: Calabash::Formatters::Html
- Inherits:
-
Cucumber::Formatter::Html
- Object
- Cucumber::Formatter::Html
- Calabash::Formatters::Html
- Defined in:
- lib/calabash/formatters/html.rb
Instance Method Summary collapse
Instance Method Details
#_output_relative? ⇒ Boolean
26 27 28 29 30 31 |
# File 'lib/calabash/formatters/html.rb', line 26 def _output_relative? if @io.is_a?(File) path = @io.path _relative_uri?(path) end end |
#_relative_uri?(src) ⇒ Boolean
19 20 21 22 23 |
# File 'lib/calabash/formatters/html.rb', line 19 def _relative_uri?(src) uri = URI.parse(src) return false if uri.scheme not Pathname.new(src).absolute? end |
#embed_image(src, label) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/calabash/formatters/html.rb', line 8 def (src, label) if _output_relative? && _relative_uri?(src) output_dir = Pathname.new(File.dirname(@io.path)) src_path = Pathname.new(src) = src_path.relative_path_from(output_dir) super(.to_s, label) else super(src, label) end end |