Class: Ppl::Command::Init

Inherits:
Application::Command show all
Defined in:
lib/ppl/command/init.rb

Instance Attribute Summary

Attributes inherited from Application::Command

#description, #name, #storage

Instance Method Summary collapse

Constructor Details

#initializeInit

Returns a new instance of Init.



4
5
6
7
# File 'lib/ppl/command/init.rb', line 4

def initialize
  @name        = "init"
  @description = "Create an empty address book"
end

Instance Method Details

#execute(input, output) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ppl/command/init.rb', line 13

def execute(input, output)

  path = input.arguments.shift
  if path.nil?
    path = Dir.pwd
  end

  storage = Ppl::Adapter::Storage::Git.create_address_book(path)

  return true
end

#options(parser, options) ⇒ Object



9
10
11
# File 'lib/ppl/command/init.rb', line 9

def options(parser, options)
  parser.banner = "usage: ppl init [directory]"
end