Class: Teapot::Command::Create

Inherits:
Flopp::Command
  • Object
show all
Defined in:
lib/teapot/command.rb

Instance Method Summary collapse

Instance Method Details

#invoke(parent) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/teapot/command.rb', line 43

def invoke(parent)
	project_path = parent.root || project_name.gsub(/\s+/, '-').downcase
	root = ::Build::Files::Path.expand(project_path)
	
	if root.exist?
		raise ArgumentError.new("#{root} already exists!")
	end
	
	# Make the path:
	root.create
	
	Teapot::Repository.new(root).init!
	
	parent.controller(root).create(@project_name, @source, @packages)
end