Class: Postview::CLI::ServerCommand

Inherits:
Object
  • Object
show all
Includes:
Command
Defined in:
lib/postview/cli/server_command.rb

Overview

Copying © 2009 Hallison Batista

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Command

#hidden_prompt, #init, #prompt, #start, #step

Constructor Details

#initialize(path, arguments) ⇒ ServerCommand

Returns a new instance of ServerCommand.



14
15
16
17
# File 'lib/postview/cli/server_command.rb', line 14

def initialize(path, arguments)
  @path, @arguments, @options = path, arguments, {}
  @server_options = {}
end

Class Method Details

.run(args) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/postview/cli/server_command.rb', line 25

def self.run(args)
  if args.first =~ /^\w.*|^\/\w.*/
    new(args.shift, args.options).run
  else
    new(".", args.options).run
  end
end

Instance Method Details

#runObject



19
20
21
22
23
# File 'lib/postview/cli/server_command.rb', line 19

def run
  parse_arguments
  load_server
  start_server
end