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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12844dadae8e2b81b176ddcf2d7b3f28d18403b9
4
- data.tar.gz: 0593bbe7132d9c502057e7d2a5bdbc046f8d68c5
3
+ metadata.gz: 2e0c5f823e46d6457be86cb5297cd24b461aa5fc
4
+ data.tar.gz: 792c13d4c77551350b495716467a691c6850aabb
5
5
  SHA512:
6
- metadata.gz: 7baeb0e1accd202d53dd2f1f143fffc27b27801a38f7df9d9e81fabf731141f1e54702fb6afbe59edd547cde74594c628c7220fab186a95310bf0ded95e00e9f
7
- data.tar.gz: b66b04811b0acbd665c740b60ec5048e8027349d0d72ef6c7eaf8617c269c5d31a38d9ebbd278bc9878db918f78fe5041f83f6c1dc97a46da61ae483a10e95c3
6
+ metadata.gz: 619c405c7655213e187d098711b087b272981d3896a9741fbdef2a99db832cefe4124ec6d17e65023da43c4b358f08bf783f3587d70726ffaed8da079d13c1d3
7
+ data.tar.gz: 6c6661f1685aa071b3858fda80a482c74525496662e11fca7cdd68ea35142108b6c4fbc50581698c58897f6af0c23632a82ca1ce73a900153d871373debfcade
@@ -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 == 'complete' }
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
@@ -1,5 +1,5 @@
1
1
  module PhoneGap
2
2
  module Build
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  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?: false) }
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.0
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-22 00:00:00.000000000 Z
11
+ date: 2014-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httmultiparty