File: github-markup

package info (click to toggle)
ruby-github-markup 1.7.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 372 kB
  • sloc: ruby: 441; python: 170; sh: 26; makefile: 18; perl: 12
file content (28 lines) | stat: -rwxr-xr-x 491 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env ruby

$LOAD_PATH.unshift File.dirname(File.realpath(__FILE__)) + "/../lib"
require 'github/markup'

if ARGV.size < 1
  print "usage: #{File.basename($0)} FILE [ FILES ... ]\n"
  exit 1
end

sources = []

ARGV.each { |s|
  begin
    file = File.open( s, "r" )
    sources.push [ s, file ]
  rescue Exception => e
    $stderr.print "error: #{e.message}\n"
    exit 1
  ensure
  end
}

sources.each { |name, file|
  print GitHub::Markup.render( name, file.read )
  file.close
}