From 8163416e27b81f789953262932556055851a4c8f Mon Sep 17 00:00:00 2001
From: brianleroux <brian@westcoastlogic.com>
Date: Thu, 2 Sep 2010 16:58:24 -0700
Subject: [PATCH] cleanup for merge

---
 lib/create.rb | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/create.rb b/lib/create.rb
index 3fac2f17..559c0292 100644
--- a/lib/create.rb
+++ b/lib/create.rb
@@ -30,11 +30,10 @@ class Create
     raise 'No index.html found!' unless File.exists? File.join(path, 'index.html')    
     
     # setup default vars
-    @name = path.split("/").last.gsub('-','')
-    @path = File.join(path, '..', "#{ name }-android")
+    @name = path.split("/").last.gsub('-','').gsub(' ','') # no dashses nor spaces
+    @path = File.join(path, '..', "#{ @name }_android")
     @www  = path 
-    @name = path.split('/').last
-    @pkg  = "com.phonegap.#{ name }" 
+    @pkg  = "com.phonegap.#{ @name }" 
     
     # android sdk discovery ... could be better
     @android_sdk_path = Dir.getwd[0,1] != "/" ? `android-sdk-path.bat android.bat`.gsub('\\tools','').gsub('\\', '\\\\\\\\') : `which android`.gsub('/tools/android','')
@@ -111,7 +110,8 @@ class Create
   # TODO need to allow more flexible SDK targetting via config.xml
   def create_android
     target_id = `android list targets | grep id:`.split("\n").last.match(/\d/).to_a.first
-    `android create project -t #{ target_id } -k #{ @pkg } -a #{ @name } -n #{ @name.gsub(' ','') } -p #{ @path }`
+    puts "NAME #{@name}"
+    `android create project -t #{ target_id } -k #{ @pkg } -a #{ @name } -n #{ @name } -p #{ @path }`
   end
   
   # copies the project/www folder into tmp/android/www