File: rt-filter.rb

package info (click to toggle)
rttool 1.0.3.0-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 288 kB
  • sloc: ruby: 1,629; makefile: 12
file content (11 lines) | stat: -rw-r--r-- 284 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
require 'tempfile'
$RC["filter"]["rt"] = Filter.new(:target) do |inn, out|
  ext = $Visitor_Class.const_get('OUTPUT_SUFFIX')
  if ext == 'txt'
    ext = 'html'
  end
  tmpf = Tempfile.new("rt")
  tmpf.write inn.read
  tmpf.close
  out.print `rt2 -r rt/rt2#{ext}-lib #{tmpf.path}`
end