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



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/madman/commands/preview.rb', line 29

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