Class: Markview::Application

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/markview.rb

Class Method Summary collapse

Class Method Details

.markdown_meObject

Renders the html using GitHub::Markup



15
16
17
18
19
20
21
22
# File 'lib/markview.rb', line 15

def self.markdown_me
  ARGV[0] ||= Dir.glob("README*")[0]
  begin
    GitHub::Markup.render(ARGV[0], File.read(ARGV[0]))
  rescue Errno::ENOENT
    raise LoadError, "Failed to open document. Please specify a file."; exit
  end
end