Sha256: a49a333b7b8357fadf1792a2a331d11e702f40c6faecd324f79ca6726cd34362

Contents?: true

Size: 757 Bytes

Versions: 1

Compression:

Stored size: 757 Bytes

Contents

# frozen_string_literal: true

require 'thor'

require 'whatup/server/server'

module Whatup
  module CLI
    # Server commands
    class Server < Thor
      option :port,
             type: :numeric,
             default: 9_001,
             desc: 'The port to run the server on'
      option :verbose,
             aliases: '-v',
             type: :boolean,
             desc: 'Enable verbose output',
             default: false
      desc 'start', 'Starts a server instance'
      long_desc <<~DESC
        Starts a server instance running locally on the specified port.
      DESC
      def start
        ENV['WHATUP_LOG_LEVEL'] = 'DEBUG' if options[:verbose]
        Whatup::Server::Server.new(port: options[:port]).start
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
whatup-0.3.5 lib/whatup/cli/commands/server.rb