class Madman::Commands::Preview

Public Instance Methods

run() click to toggle source
# File lib/madman/commands/preview.rb, line 24
def run
  file = args['FILE']
  port = args['--port']
  bind = args['--bind']

  say "Starting server at !undblu!localhost:#{port}!txtrst!"
  if ENV['GITHUB_ACCESS_TOKEN']
    say "To view the GitHub API version go to !undblu!localhost:#{port}/github!txtrst!"
  end
  say ''

  Madman::PreviewServer.set bind: bind, port: port, file: file
  Madman::PreviewServer.run!
end