Module: Postview::CLI

Defined in:
lib/postview/cli.rb,
lib/postview/cli/create_command.rb,
lib/postview/cli/server_command.rb

Overview

Copyright © 2009 Hallison Batista

Defined Under Namespace

Modules: Command Classes: CreateCommand, ServerCommand

Class Method Summary collapse

Class Method Details

.commandsObject

List all commands for CLI options.



10
11
12
13
14
15
16
# File 'lib/postview/cli.rb', line 10

def self.commands
  constants.select do |constant|
    constant.to_s =~ /.Command/
  end.map do |constant|
    constant.to_s.sub(/Command/,'').downcase
  end.sort
end

.run(command, args) ⇒ Object

Run!



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

def self.run(command, args)
  const_get("#{command.capitalize}Command").run(args)
end