Class: WebpackDriver::DevServer

Inherits:
Process
  • Object
show all
Defined in:
lib/webpack_driver/dev_server.rb

Overview

A wrapper around an instance of ‘webpak-dev-server`

Constant Summary

Constants inherited from Process

Process::READ_CHUNK_SIZE

Instance Attribute Summary collapse

Attributes inherited from Process

#assets, #config, #error, #last_compilation_message, #last_status, #messages

Instance Method Summary collapse

Methods inherited from Process

#in_progress?, #start, #stop

Constructor Details

#initialize(config) ⇒ DevServer

Returns a new instance of DevServer.



8
9
10
# File 'lib/webpack_driver/dev_server.rb', line 8

def initialize(config)
    super('webpack-dev-server', config)
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



6
7
8
# File 'lib/webpack_driver/dev_server.rb', line 6

def host
  @host
end

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/webpack_driver/dev_server.rb', line 6

def path
  @path
end

#portObject (readonly)

Returns the value of attribute port.



6
7
8
# File 'lib/webpack_driver/dev_server.rb', line 6

def port
  @port
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/webpack_driver/dev_server.rb', line 12

def valid?
    alive? && last_status == 'success'
end