Sha256: 7f797523f3398ec92212e0aa045c40bf3aee890cc8c8ded0049934823ef057f1

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 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

1 entries across 1 versions & 1 rubygems

Version Path
massimo-0.7.0 lib/massimo/commands/server.rb