brianleroux-phonegap 0.1.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -13
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/{lib/phonegap-console.rb → bin/phonegap} +2 -3
- data/lib/devices/blackberry.rb +21 -0
- data/lib/devices/iphone.rb +2 -2
- data/lib/phonegap.rb +11 -4
- data/phonegap.gemspec +60 -0
- data/test/test_helper.rb +1 -1
- metadata +10 -9
data/README.md
CHANGED
@@ -19,19 +19,7 @@ Options
|
|
19
19
|
-g, --generate ..... Generates a PhoneGap application skeleton.
|
20
20
|
-b, --build ........ Compiles your PhoneGapp application for supported platforms.
|
21
21
|
-r, --report ....... Generates a report for supported SDK's.
|
22
|
-
|
23
|
-
TODO
|
24
|
-
---
|
25
|
-
- make executable chmod +x phonegap.rb
|
26
|
-
- install phonegap source into ~/.phonegap using git if available
|
27
|
-
- make bootstrap.js useful
|
28
|
-
- add debug and release options
|
29
|
-
- launch iphone simulator
|
30
|
-
- builds for each platform
|
31
|
-
- fix report for android and blackberry
|
32
|
-
- check for specific versions of iphone, android and bb in the report and build
|
33
|
-
- gemify
|
34
|
-
- add shoulda tests
|
22
|
+
|
35
23
|
|
36
24
|
Copyright (c) 2009 Brian LeRoux. Licensed under the MIT License:
|
37
25
|
http://www.opensource.org/licenses/mit-license.php
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ begin
|
|
5
5
|
require 'jeweler'
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = "phonegap"
|
8
|
-
gem.summary = %Q{
|
8
|
+
gem.summary = %Q{Command line utilities for PhoneGap.}
|
9
9
|
gem.email = "brian@westcoastlogic.com"
|
10
10
|
gem.homepage = "http://github.com/brianleroux/phonegap-dev"
|
11
11
|
gem.authors = ["Brian LeRoux"]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.2
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
%w(optparse optparse/time ostruct pp
|
2
|
+
%w(optparse optparse/time ostruct pp phonegap).each { |x| require x }
|
3
3
|
#
|
4
4
|
# Wraps the command line and passes switches and options back to the PhoneGap class.
|
5
5
|
#
|
@@ -43,8 +43,7 @@ class PhoneGapConsole
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
opts.parse!(args)
|
46
|
-
#options
|
47
46
|
end
|
48
47
|
end
|
49
48
|
|
50
|
-
|
49
|
+
PhoneGapConsole.parse(ARGV)
|
data/lib/devices/blackberry.rb
CHANGED
@@ -6,6 +6,27 @@ module Blackberry
|
|
6
6
|
|
7
7
|
# FIXME
|
8
8
|
def build_blackberry(path)
|
9
|
+
=begin
|
10
|
+
Blackberry uses something rapc.exe to do builds.
|
11
|
+
http://www.blackberry.com/developers/javaknowledge/bbJDE/kpa0203190506.shtml
|
12
|
+
|
13
|
+
From the command line something like this should work:
|
14
|
+
|
15
|
+
>> rapc.exe import=c:\foo\net_rim_api.jar codename=phonegap-bitches -midlet jad=my-app-properties-metadata.jad @file-list.txt
|
16
|
+
|
17
|
+
"@file-list.txt" is a newline separated list of .java files to include
|
18
|
+
|
19
|
+
It requires (at leaset) rapc.exe from the Blackberry JDE (which I am
|
20
|
+
not sure if we can redistribute or not) and JDK.
|
21
|
+
|
22
|
+
To sign the app from the command line you do this:
|
23
|
+
|
24
|
+
>> java -jar "SignatureTool.jar" -a -c -p <mypass> c:\phonegap-bitches.cod
|
25
|
+
|
26
|
+
|
27
|
+
There is also a handy projects that links all this to ANT tasks if we
|
28
|
+
want http://bb-ant-tools.sourceforge.net/
|
29
|
+
=end
|
9
30
|
FileUtils.mkdir_p(File.join(bin,'blackberry')) if blackberry_supported?
|
10
31
|
end
|
11
32
|
end
|
data/lib/devices/iphone.rb
CHANGED
@@ -6,7 +6,7 @@ module Iphone
|
|
6
6
|
|
7
7
|
# builds the iphone using xcode, FIXME should use open toolchain
|
8
8
|
def build_iphone(path_to_build)
|
9
|
-
if iphone_supported?
|
9
|
+
if iphone_supported? && has_phonegap_sauce?
|
10
10
|
FileUtils.mkdir_p(path_to_build)
|
11
11
|
www_local = File.join(path_to_build,'www')
|
12
12
|
www_build = File.join(install_path,'iphone')
|
@@ -16,7 +16,7 @@ module Iphone
|
|
16
16
|
conf = {'Release'=>'iphoneos3.0','Debug'=>'iphonesimulator3.0'}
|
17
17
|
puts `cd #{www_build}; /usr/bin/xcodebuild -alltargets -configuration Debug -sdk #{conf['Debug']}`
|
18
18
|
else
|
19
|
-
puts 'skipping iphone build: iphone sdk not installed'
|
19
|
+
puts 'skipping iphone build: iphone sdk not installed or phonegap source not in ~/.phonegap'
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
data/lib/phonegap.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
%w(
|
1
|
+
%w(devices/android devices/iphone devices/blackberry).each { |x| require x }
|
2
2
|
#
|
3
3
|
# Provides utilities for generating a PhoneGap application and unifies the build process for each of the supported mobile platforms.
|
4
4
|
#
|
@@ -14,14 +14,21 @@ class PhoneGap
|
|
14
14
|
'0.7.0'
|
15
15
|
end
|
16
16
|
|
17
|
-
#
|
17
|
+
# grab install path of the phonegap sauce
|
18
18
|
def install_path
|
19
19
|
File.expand_path('~/.phonegap')
|
20
20
|
end
|
21
21
|
|
22
|
+
# check for the phonegap sauce
|
23
|
+
def has_phonegap_sauce?
|
24
|
+
File.exists?(install_path)
|
25
|
+
end
|
26
|
+
|
22
27
|
# creates an app skeleton
|
23
28
|
def generate(path)
|
24
|
-
|
29
|
+
generate_path = File.join(Dir.pwd,path)
|
30
|
+
template_path = File.join(File.dirname(__FILE__),'generate')
|
31
|
+
FileUtils.cp_r(template_path, generate_path)
|
25
32
|
e=<<-E
|
26
33
|
|
27
34
|
Generated a fresh PhoneGap application!
|
@@ -42,7 +49,7 @@ class PhoneGap
|
|
42
49
|
|
|
43
50
|
'- index.html
|
44
51
|
|
45
|
-
For more information, tutorials, documentation and quickstarts
|
52
|
+
For more information, tutorials, documentation and quickstarts visit http://phonegap.com
|
46
53
|
|
47
54
|
E
|
48
55
|
trim(e)
|
data/phonegap.gemspec
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{phonegap}
|
5
|
+
s.version = "0.2.2"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Brian LeRoux"]
|
9
|
+
s.date = %q{2009-07-24}
|
10
|
+
s.default_executable = %q{phonegap}
|
11
|
+
s.email = %q{brian@westcoastlogic.com}
|
12
|
+
s.executables = ["phonegap"]
|
13
|
+
s.extra_rdoc_files = [
|
14
|
+
"LICENSE",
|
15
|
+
"README.md"
|
16
|
+
]
|
17
|
+
s.files = [
|
18
|
+
".document",
|
19
|
+
".gitignore",
|
20
|
+
"LICENSE",
|
21
|
+
"README.md",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION",
|
24
|
+
"bin/phonegap",
|
25
|
+
"lib/devices/android.rb",
|
26
|
+
"lib/devices/blackberry.rb",
|
27
|
+
"lib/devices/iphone.rb",
|
28
|
+
"lib/generate/config/android-dev-cert.txt",
|
29
|
+
"lib/generate/config/blackberry-dev-cert.txt",
|
30
|
+
"lib/generate/config/bootstrap.js",
|
31
|
+
"lib/generate/config/iphone-dev-cert.txt",
|
32
|
+
"lib/generate/www/assets/css/master.css",
|
33
|
+
"lib/generate/www/assets/js/phongap.js",
|
34
|
+
"lib/generate/www/index.html",
|
35
|
+
"lib/phonegap.rb",
|
36
|
+
"phonegap.gemspec",
|
37
|
+
"test/phonegap-dev_test.rb",
|
38
|
+
"test/test_helper.rb"
|
39
|
+
]
|
40
|
+
s.homepage = %q{http://github.com/brianleroux/phonegap-dev}
|
41
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
42
|
+
s.require_paths = ["lib"]
|
43
|
+
s.rubyforge_project = %q{phonegap}
|
44
|
+
s.rubygems_version = %q{1.3.5}
|
45
|
+
s.summary = %q{Command line utilities for PhoneGap.}
|
46
|
+
s.test_files = [
|
47
|
+
"test/phonegap-dev_test.rb",
|
48
|
+
"test/test_helper.rb"
|
49
|
+
]
|
50
|
+
|
51
|
+
if s.respond_to? :specification_version then
|
52
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
53
|
+
s.specification_version = 3
|
54
|
+
|
55
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
56
|
+
else
|
57
|
+
end
|
58
|
+
else
|
59
|
+
end
|
60
|
+
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brianleroux-phonegap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian LeRoux
|
@@ -9,14 +9,14 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
13
|
-
default_executable:
|
12
|
+
date: 2009-07-24 00:00:00 -07:00
|
13
|
+
default_executable: phonegap
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description:
|
17
17
|
email: brian@westcoastlogic.com
|
18
|
-
executables:
|
19
|
-
|
18
|
+
executables:
|
19
|
+
- phonegap
|
20
20
|
extensions: []
|
21
21
|
|
22
22
|
extra_rdoc_files:
|
@@ -29,6 +29,7 @@ files:
|
|
29
29
|
- README.md
|
30
30
|
- Rakefile
|
31
31
|
- VERSION
|
32
|
+
- bin/phonegap
|
32
33
|
- lib/devices/android.rb
|
33
34
|
- lib/devices/blackberry.rb
|
34
35
|
- lib/devices/iphone.rb
|
@@ -39,11 +40,11 @@ files:
|
|
39
40
|
- lib/generate/www/assets/css/master.css
|
40
41
|
- lib/generate/www/assets/js/phongap.js
|
41
42
|
- lib/generate/www/index.html
|
42
|
-
- lib/phonegap-console.rb
|
43
43
|
- lib/phonegap.rb
|
44
|
+
- phonegap.gemspec
|
44
45
|
- test/phonegap-dev_test.rb
|
45
46
|
- test/test_helper.rb
|
46
|
-
has_rdoc:
|
47
|
+
has_rdoc: false
|
47
48
|
homepage: http://github.com/brianleroux/phonegap-dev
|
48
49
|
post_install_message:
|
49
50
|
rdoc_options:
|
@@ -67,8 +68,8 @@ requirements: []
|
|
67
68
|
rubyforge_project: phonegap
|
68
69
|
rubygems_version: 1.2.0
|
69
70
|
signing_key:
|
70
|
-
specification_version:
|
71
|
-
summary:
|
71
|
+
specification_version: 3
|
72
|
+
summary: Command line utilities for PhoneGap.
|
72
73
|
test_files:
|
73
74
|
- test/phonegap-dev_test.rb
|
74
75
|
- test/test_helper.rb
|