Class: Ronin::Web::CLI::Commands::New::Server Private

Inherits:
Ronin::Web::CLI::Command show all
Includes:
Core::CLI::Generator
Defined in:
lib/ronin/web/cli/commands/new/server.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Creates a new ronin-web-server script.

Usage

ronin-web server [options]

Options

-H, --host HOST|IP               Optional host or IP interface to listen on. Defaults to 0.0.0.0.
-p, --port PORT                  Optional port to listen on. Defaults to 8000.
-h, --help                       Print help information

Arguments

FILE                             The file to create

Since:

  • 1.0.0

Instance Method Summary collapse

Instance Method Details

#run(path) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Runs the ronin-web new server command.

Parameters:

  • path (String)

    The path to the new script file to create.

Since:

  • 1.0.0



83
84
85
86
87
88
89
# File 'lib/ronin/web/cli/commands/new/server.rb', line 83

def run(path)
  @host = options[:host]
  @port = options[:port]

  erb 'server.rb.erb', path
  chmod '+x', path
end