From 83070fc4ea710fb68aa1da8cc94f7b33054a97c4 Mon Sep 17 00:00:00 2001 From: brianleroux Date: Tue, 31 Aug 2010 15:40:19 -0700 Subject: [PATCH] updated pkg to create as per daves suggestion --- bin/droidgap | 24 +++++++++++++----------- lib/{package.rb => create.rb} | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) rename lib/{package.rb => create.rb} (99%) diff --git a/bin/droidgap b/bin/droidgap index 6ccc7307..bee1a682 100755 --- a/bin/droidgap +++ b/bin/droidgap @@ -2,7 +2,7 @@ ROOT = File.expand_path(File.dirname(__FILE__).gsub('bin','')) require 'fileutils' require File.join(ROOT, "lib", "generate.rb") -require File.join(ROOT, "lib", "package.rb") +require File.join(ROOT, "lib", "create.rb") require File.join(ROOT, "lib", "run.rb") require File.join(ROOT, "lib", "update.rb") @@ -15,8 +15,8 @@ require File.join(ROOT, "lib", "update.rb") # droidgap gen [app name] Generate.new(ARGV[1]) if ARGV.first == 'gen' -# droidgap pkg [path to phonegap project] -Package.new(ARGV[1]) if ARGV.first == 'pkg' +# droidgap create [path to phonegap project] +Create.new(ARGV[1]) if ARGV.first == 'create' # droidgap run [optional directory] Run.new(ARGV[1]) if ARGV.first == 'run' @@ -34,8 +34,9 @@ if ARGV.first == 'log' end end - +# TODO implement these! puts "droidgap ship not implemented" if ARGV.first == 'ship' +puts "droidgap test not implemented" if ARGV.first == 'test' if ARGV.first.nil? || ARGV.first == 'help' @@ -54,10 +55,11 @@ if ARGV.first.nil? || ARGV.first == 'help' help ..... See this message. Type help to see specific help topics. gen ...... Generate an example PhoneGap application to current directory. - pkg ...... Creates an Android compatible project from a www folder. Careful, this clobbers previous packaging. + create ... Creates an Android compatible project from a www folder. Careful, this clobbers previous packaging. run ...... Installs a valid PhoneGap Project to first device found. log ...... Attach a logger that listens for console.log statements. update ... Copy a fresh phonegap.jar and phonegap.js into a valid PhoneGap/Android project. + test ..... Gets a copy of mobile-spec and runs in first device or emulator attached. ship ..... Build and sign an APK suitable for submission to an Android Marketplace. Quickstart: @@ -124,25 +126,25 @@ if ARGV.first.nil? || ARGV.first == 'help' EOF - pkg = <<-EOF + create = <<-EOF - DroidGap Package + DroidGap Create ---------------- Creates an Android compatable project from a PhoneGap project. For example, if you have MyProject with index.html this command will create MyProject-android. Usage: - droidgap pkg + droidgap create EOF update = <<-EOF - Update: Builds the JS and PhoneGap Android jar file and copies them to your project. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + DroidGap Update + ~~~~~~~~~~~~~~~ - path ............... The path to generate the Android application. + Builds the JS and PhoneGap Android jar file and copies them to your project. EOF diff --git a/lib/package.rb b/lib/create.rb similarity index 99% rename from lib/package.rb rename to lib/create.rb index 6eeeffac..d500afbb 100644 --- a/lib/package.rb +++ b/lib/create.rb @@ -4,7 +4,7 @@ # # TODO ensure the phonegap.js file is overwritten every single time into the correct tmp dir # -class Package +class Create attr_reader :name, :pkg, :www, :path def initialize(path)