Sha256: cf087e4aecaf519e2c71601046f3e254574022e707a5a81f85de7b3ea19a5cc0

Contents?: true

Size: 1.08 KB

Versions: 44

Compression:

Stored size: 1.08 KB

Contents

command 'start server' do |c|
  c.option '--host HOSTNAME', nil, 'What hostname to listen on'
  c.option '--port PORT', nil, 'What port to listen on'

  c.action do |args, options|
    options.default(root: Brief.pwd, port: 9094, host: '0.0.0.0')

    require 'thin'
    require 'rack/handler/thin'
    require 'brief/server/gateway'
    require 'brief/server/socket'
    require 'em-websocket'

    fork do
      Brief::Server::Gateway.start(port: options.port, host: options.host, root: Pathname(options.root))
    end

    EM.run {
      EM::WebSocket.run(:host=>"0.0.0.0",:port => 8089) do |ws|
        Brief::Server::Socket.new(root: options.root, websocket: ws)
      end
    }

  end
end

command 'start socket server' do |c|
  c.option '--port PORT', String, 'What port to listen on'

  c.action do |args, options|
    options.default(root: Brief.pwd, port: 5054)

    require 'brief/server/socket'
    require 'em-websocket'

    EM.run {
      EM::WebSocket.run(:host=>"0.0.0.0",:port => 8089) do |ws|
        Brief::Server::Socket.new(root: options.root, websocket: ws)
      end
    }
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
brief-1.17.14 lib/brief/cli/server.rb
brief-1.17.13 lib/brief/cli/server.rb
brief-1.17.12 lib/brief/cli/server.rb
brief-1.17.11 lib/brief/cli/server.rb
brief-1.17.10 lib/brief/cli/server.rb
brief-1.17.9 lib/brief/cli/server.rb
brief-1.17.8 lib/brief/cli/server.rb
brief-1.17.7 lib/brief/cli/server.rb
brief-1.17.5 lib/brief/cli/server.rb
brief-1.17.4 lib/brief/cli/server.rb
brief-1.17.3 lib/brief/cli/server.rb
brief-1.17.2 lib/brief/cli/server.rb
brief-1.17.1 lib/brief/cli/server.rb
brief-1.17.0 lib/brief/cli/server.rb
brief-1.16.2 lib/brief/cli/server.rb
brief-1.16.1 lib/brief/cli/server.rb
brief-1.16.0 lib/brief/cli/server.rb
brief-1.15.5 lib/brief/cli/server.rb
brief-1.15.4 lib/brief/cli/server.rb
brief-1.15.3 lib/brief/cli/server.rb