class MarkdownFormatter::CLI

Public Class Methods

run(filepath) click to toggle source
# File lib/markdown_formatter/cli.rb, line 3
def self.run(filepath)
  result = MarkdownFormatter.format(File.read(filepath))

  if MarkdownFormatter::OPTIONS[:overwrite]
    File.write(filepath, result)
  else
    puts result
  end
end