Module: Slideshow::DebugFilter

Included in:
Gen
Defined in:
lib/slideshow/filters/debug_filter.rb

Instance Method Summary collapse

Instance Method Details

#dump_content_to_file_debug_html(content) ⇒ Object

use it to dump content before html post processing



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/slideshow/filters/debug_filter.rb', line 29

def dump_content_to_file_debug_html( content )

  # NB: using attribs from mixed in class
  #   - opts
  #   - outdir

  return content   unless config.verbose?

  outname = "#{outdir}/#{@name}.debug.html"

  puts "  Dumping content before html post processing to #{outname}..."

  File.open( outname, 'w' ) do |f|
    f.write( content )
  end

  content
end

#dump_content_to_file_debug_text(content) ⇒ Object

use it to dump content before text-to-html conversion



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/slideshow/filters/debug_filter.rb', line 50

def dump_content_to_file_debug_text( content )

  # NB: using attribs from mixed in class
  #   - opts
  #   - outdir

  return content   unless config.verbose?

  outname = "#{outdir}/#{@name}.debug.text"

  puts "  Dumping content before text-to-html conversion to #{outname}..."

  File.open( outname, 'w' ) do |f|
    f.write( content )
  end

  content

end

#dump_content_to_file_debug_text_erb(content) ⇒ Object

use it to dump content before erb merge



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/slideshow/filters/debug_filter.rb', line 8

def dump_content_to_file_debug_text_erb( content )

  # NB: using attribs from mixed in class
  #   - opts
  #   - outdir

  return content   unless config.verbose?

  outname = "#{outdir}/#{@name}.debug.text.erb"

  puts "  Dumping content before erb merge to #{outname}..."

  File.open( outname, 'w' ) do |f|
    f.write( content )
  end

  content
end