Class: RubyMarkRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/rubymark.rb

Instance Method Summary collapse

Instance Method Details



103
104
105
# File 'lib/rubymark.rb', line 103

def print_usage
  puts "Usage: rubymark file.md  # this will send HTML to STDOUT"
end

#process_md_file(md_file_name) ⇒ Object



107
108
109
110
# File 'lib/rubymark.rb', line 107

def process_md_file(md_file_name)
  markdown = File.read(md_file_name)
  puts RubyMark.new(markdown).to_html
end

#run(args) ⇒ Object



95
96
97
98
99
100
101
# File 'lib/rubymark.rb', line 95

def run args
  unless args[0]
    print_usage 
  else
    process_md_file(ARGV[0])
  end
end