Class: Madman::Commands::Serve

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

Instance Method Summary collapse

Instance Method Details

#runObject



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/madman/commands/serve.rb', line 22

def run
  dir = args['DIR']
  port = args['--port']
  bind = args['--bind']
  renderer = args['--github'] ? :github : :default

  say "Starting server at !undblu!localhost:#{port}!txtrst! using the !txtgrn!#{renderer}!txtrst! renderer\n"

  Madman::DirServer.set bind: bind, port: port, 
    dir: dir, renderer: renderer
    
  Madman::DirServer.run!
end