phone_gap-build 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phone_gap/build/app.rb +3 -1
- data/lib/phone_gap/build/version.rb +1 -1
- data/spec/phone_gap/build/app_spec.rb +10 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e0c5f823e46d6457be86cb5297cd24b461aa5fc
|
4
|
+
data.tar.gz: 792c13d4c77551350b495716467a691c6850aabb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 619c405c7655213e187d098711b087b272981d3896a9741fbdef2a99db832cefe4124ec6d17e65023da43c4b358f08bf783f3587d70726ffaed8da079d13c1d3
|
7
|
+
data.tar.gz: 6c6661f1685aa071b3858fda80a482c74525496662e11fca7cdd68ea35142108b6c4fbc50581698c58897f6af0c23632a82ca1ce73a900153d871373debfcade
|
data/lib/phone_gap/build/app.rb
CHANGED
@@ -28,6 +28,7 @@ module PhoneGap
|
|
28
28
|
ApiRequest.new.post("#{PATH}/#{id}/build")
|
29
29
|
end
|
30
30
|
|
31
|
+
# @TODO fix this ugly method!
|
31
32
|
def build_complete?(params = {})
|
32
33
|
complete = false
|
33
34
|
error = false
|
@@ -37,12 +38,13 @@ module PhoneGap
|
|
37
38
|
response = ApiRequest.new.get("#{PATH}/#{id}")
|
38
39
|
if response.success?
|
39
40
|
json_object = JSON.parse(response.body)
|
40
|
-
complete = json_object['status'].all? { |platform, status| status
|
41
|
+
complete = json_object['status'].all? { |platform, status| %w(complete skip).include?(status) }
|
41
42
|
error = json_object['status'].any? { |platform, status| status == 'error' }
|
42
43
|
end
|
43
44
|
sleep (params[:poll_interval] || poll_interval) unless complete or error
|
44
45
|
end
|
45
46
|
raise BuildError.new('An error occurred building at least one of the apps.') if error
|
47
|
+
raise BuildError.new('Builds did not complete within the allotted time.') if !error && !complete
|
46
48
|
complete
|
47
49
|
end
|
48
50
|
end
|
@@ -100,7 +100,7 @@ describe PhoneGap::Build::App do
|
|
100
100
|
|
101
101
|
describe '#build_complete?' do
|
102
102
|
|
103
|
-
let(:http_response) { double('http response', success?:
|
103
|
+
let(:http_response) { double('http response', success?: true, body: '{"status": { "ios": "complete"}}') }
|
104
104
|
|
105
105
|
before do
|
106
106
|
api_request.stub(:get).with("/apps/#{id}").and_return http_response
|
@@ -152,6 +152,15 @@ describe PhoneGap::Build::App do
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
+
context 'when the build doesnt complete' do
|
156
|
+
|
157
|
+
let(:http_response) { double('http response', success?: true, body: '{"status": { "ios": "nil"}}') }
|
158
|
+
|
159
|
+
it 'returns throws an exception' do
|
160
|
+
expect{subject.build_complete?}.to raise_error PhoneGap::Build::BuildError
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
155
164
|
context 'when there was an error building' do
|
156
165
|
|
157
166
|
let(:http_response) { double('http response', success?: true, body: '{"status": { "ios": "error"}}') }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phone_gap-build
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seb Glazebrook
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httmultiparty
|