Class: Postview::CLI::CreateCommand

Inherits:
Object
  • Object
show all
Includes:
Command
Defined in:
lib/postview/cli/create_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) ⇒ CreateCommand

Returns a new instance of CreateCommand.



10
11
12
# File 'lib/postview/cli/create_command.rb', line 10

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

Class Method Details

.run(args) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/postview/cli/create_command.rb', line 20

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

Instance Method Details

#runObject



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

def run
  parse_arguments
  load_default_settings
  build_settings
end