Class: Awestruct::Commands::Server
- Inherits:
-
Object
- Object
- Awestruct::Commands::Server
- Defined in:
- lib/awestruct/commands/server.rb
Instance Attribute Summary (collapse)
-
- (Object) server
readonly
Returns the value of attribute server.
Instance Method Summary (collapse)
-
- (Server) initialize(path, bind_addr = '0.0.0.0', port = 4242)
constructor
A new instance of Server.
- - (Object) run
Constructor Details
- (Server) initialize(path, bind_addr = '0.0.0.0', port = 4242)
A new instance of Server
12 13 14 15 16 |
# File 'lib/awestruct/commands/server.rb', line 12 def initialize(path, bind_addr='0.0.0.0', port=4242) @path = path @bind_addr = bind_addr @port = port end |
Instance Attribute Details
- (Object) server (readonly)
Returns the value of attribute server
10 11 12 |
# File 'lib/awestruct/commands/server.rb', line 10 def server @server end |
Instance Method Details
- (Object) run
18 19 20 21 |
# File 'lib/awestruct/commands/server.rb', line 18 def run @server = WEBrick::HTTPServer.new( :DocumentRoot=>@path, :Port=>@port, :BindAddress=>@bind_addr ) @server.start end |