phonegap 0.2.1 → 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/VERSION +1 -1
- data/lib/devices/iphone.rb +2 -2
- data/lib/phonegap.rb +8 -3
- data/phonegap.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
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
@@ -14,16 +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)
|
25
30
|
template_path = File.join(File.dirname(__FILE__),'generate')
|
26
|
-
|
31
|
+
FileUtils.cp_r(template_path, generate_path)
|
27
32
|
e=<<-E
|
28
33
|
|
29
34
|
Generated a fresh PhoneGap application!
|
@@ -44,7 +49,7 @@ class PhoneGap
|
|
44
49
|
|
|
45
50
|
'- index.html
|
46
51
|
|
47
|
-
For more information, tutorials, documentation and quickstarts
|
52
|
+
For more information, tutorials, documentation and quickstarts visit http://phonegap.com
|
48
53
|
|
49
54
|
E
|
50
55
|
trim(e)
|
data/phonegap.gemspec
CHANGED