Sha256: 8e337ebefe473df171be8ddb7588d3c96018c0e5722421f5d23e6b67484690a3

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 KB

Contents

module Slideshow
  module DebugFilter

# use it to dump content before erb merge

def dump_content_to_file_debug_text_erb( content )

  return content   unless logger.level == Logger::DEBUG

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

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

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

  content
end

# use it to dump content before html post processing

def dump_content_to_file_debug_html( content )

  return content   unless logger.level == Logger::DEBUG

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

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

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

  content
end

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

def dump_content_to_file_debug_text( content )

  return content   unless logger.level == Logger::DEBUG

  outname = "#{@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
  
end  # module DebugFilter
end # module Slideshow

class Slideshow::Gen
  include Slideshow::DebugFilter
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
slideshow-0.9.11 lib/slideshow/filters/debug_filter.rb
slideshow-0.9.10 lib/slideshow/filters/debug_filter.rb
slideshow-0.9.9 lib/slideshow/filters/debug_filter.rb
slideshow-0.9.8 lib/slideshow/filters/debug_filter.rb
slideshow-0.9.7 lib/slideshow/filters/debug_filter.rb
slideshow-0.9.6 lib/slideshow/filters/debug_filter.rb
slideshow-0.9.5 lib/slideshow/filters/debug_filter.rb
slideshow-0.9.4 lib/slideshow/filters/debug_filter.rb
slideshow-0.9.3 lib/slideshow/filters/debug_filter.rb