2010-08-31 15:36:09 -07:00
|
|
|
# Creates a new PhoneGap/Android project from ./example
|
2010-08-30 15:57:07 -07:00
|
|
|
class Generate
|
|
|
|
def initialize(name)
|
|
|
|
if name.nil?
|
|
|
|
puts "You need to supply a name to generate a project. Try this:\n\ndroidgap gen MyApp\n\n"
|
|
|
|
return
|
|
|
|
end
|
|
|
|
from = File.join ROOT, "example"
|
|
|
|
to = File.join FileUtils.pwd, name
|
|
|
|
FileUtils.cp_r from, to
|
2010-08-31 15:36:09 -07:00
|
|
|
puts "Generated #{ to }"
|
2010-08-30 15:57:07 -07:00
|
|
|
end
|
|
|
|
end
|