Sha256: 0e58930c316c8ca61f89651defd717e763e761c58f5f8acc7fa87cdd1e7acce6

Contents?: true

Size: 496 Bytes

Versions: 5

Compression:

Stored size: 496 Bytes

Contents

require 'active_support/core_ext/string/starts_ends_with'

module Massimo
  module Commands
    class Server < Base
      def banner
%{
#{Massimo::UI.color('massimo server [PORT]', :cyan)}
Runs a local Rack based web server on the given port.
}
      end
      
      def add_options
        if ARGV.first && !ARGV.first.starts_with?('-')
          @port = ARGV.shift
        end
      end
      
      def run
        Massimo::Server.start(site, (@port || 3000).to_i)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
massimo-0.7.5 lib/massimo/commands/server.rb
massimo-0.7.4 lib/massimo/commands/server.rb
massimo-0.7.3 lib/massimo/commands/server.rb
massimo-0.7.2 lib/massimo/commands/server.rb
massimo-0.7.1 lib/massimo/commands/server.rb