Class: Madman::Commands::Preview

Inherits:
MisterBin::Command
  • Object
show all
Includes:
Colsole
Defined in:
lib/madman/commands/preview.rb

Instance Method Summary collapse

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 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