supply 0.7.0 → 0.7.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: 8316f5d177c6aad6b5918f6fe84eaa0d5fd09b31
4
- data.tar.gz: 96ba141bd6b42ca1aa1f6877ddc65bcfc92cf951
3
+ metadata.gz: 3a10bfd71eb3cc61e7083797bb49b4f5f4d92edd
4
+ data.tar.gz: f6354b200670a8785e715cb5d0779dde7a0816c2
5
5
  SHA512:
6
- metadata.gz: eb6a753cc0904b8f81e9e33227b72c0dd66eccbf4eb7fc5bf9943209d59ac373da76e105bd9ddadda0b1f98cd2751d85c2e05105c10217f31e0736b8541ea9ae
7
- data.tar.gz: 63dc0ca244435b0003f0c0c05cc78903a10aeffa3a14a9abc228b11b53288f6196c5b95bbd55414c4c080b27abaccfb20fed7d5b8a4a2617593796f0c383e409
6
+ metadata.gz: 1c002d9e9647c2ac40e0049111e0f6ac2b60af4ad342a08881c36c3cae9268246efea2920585e811a559113fad32625773b63837f0efb260e502bb9e3292f6f3
7
+ data.tar.gz: 7d94f55922d4eb4727ff0bb5c088ab052e481dbab1f35c98d2f8b732a35d04afb57015f65ca286141e2d58a99db4b56be6b62aefcc9966a992a95b3022fae949
data/README.md CHANGED
@@ -36,6 +36,8 @@ supply
36
36
 
37
37
  ###### Command line tool for updating Android apps and their metadata on the Google Play Store
38
38
 
39
+ `supply` uploads app metadata, screenshots and binaries to Google Play. You can also select tracks for builds and promote builds to production.
40
+
39
41
  Get in contact with the developer on Twitter: [@FastlaneTools](https://twitter.com/FastlaneTools)
40
42
 
41
43
 
@@ -25,4 +25,5 @@ module Supply
25
25
 
26
26
  Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
27
27
  UI = FastlaneCore::UI
28
+ ROOT = Pathname.new(File.expand_path('../..', __FILE__))
28
29
  end
@@ -78,7 +78,7 @@ module Supply
78
78
  def begin_edit(package_name: nil)
79
79
  UI.user_error!("You currently have an active edit") if @current_edit
80
80
 
81
- self.current_edit = android_publisher.insert_edit(package_name)
81
+ self.current_edit = call_google_api { android_publisher.insert_edit(package_name) }
82
82
 
83
83
  self.current_package_name = package_name
84
84
  end
@@ -87,7 +87,7 @@ module Supply
87
87
  def abort_current_edit
88
88
  ensure_active_edit!
89
89
 
90
- android_publisher.delete_edit(current_package_name, current_edit.id)
90
+ call_google_api { android_publisher.delete_edit(current_package_name, current_edit.id) }
91
91
 
92
92
  self.current_edit = nil
93
93
  self.current_package_name = nil
@@ -97,7 +97,7 @@ module Supply
97
97
  def commit_current_edit!
98
98
  ensure_active_edit!
99
99
 
100
- android_publisher.commit_edit(current_package_name, current_edit.id)
100
+ call_google_api { android_publisher.commit_edit(current_package_name, current_edit.id) }
101
101
 
102
102
  self.current_edit = nil
103
103
  self.current_package_name = nil
@@ -112,7 +112,7 @@ module Supply
112
112
  def listings
113
113
  ensure_active_edit!
114
114
 
115
- result = android_publisher.list_listings(current_package_name, current_edit.id)
115
+ result = call_google_api { android_publisher.list_listings(current_package_name, current_edit.id) }
116
116
 
117
117
  return result.listings.map do |row|
118
118
  Listing.new(self, row.language, row)
@@ -127,7 +127,8 @@ module Supply
127
127
  result = android_publisher.get_listing(
128
128
  current_package_name,
129
129
  current_edit.id,
130
- language)
130
+ language
131
+ )
131
132
 
132
133
  return Listing.new(self, language, result)
133
134
  rescue Google::Apis::ClientError => e
@@ -140,7 +141,7 @@ module Supply
140
141
  def apks_version_codes
141
142
  ensure_active_edit!
142
143
 
143
- result = android_publisher.list_apks(current_package_name, current_edit.id)
144
+ result = call_google_api { android_publisher.list_apks(current_package_name, current_edit.id) }
144
145
 
145
146
  return result.apks.map(&:version_code)
146
147
  end
@@ -149,10 +150,13 @@ module Supply
149
150
  def apk_listings(apk_version_code)
150
151
  ensure_active_edit!
151
152
 
152
- result = android_publisher.list_apk_listings(
153
- current_package_name,
154
- current_edit.id,
155
- apk_version_code)
153
+ result = call_google_api do
154
+ android_publisher.list_apk_listings(
155
+ current_package_name,
156
+ current_edit.id,
157
+ apk_version_code
158
+ )
159
+ end
156
160
 
157
161
  return (result.listings || []).map do |row|
158
162
  ApkListing.new(row.recent_changes, row.language, apk_version_code)
@@ -175,20 +179,26 @@ module Supply
175
179
  video: video
176
180
  })
177
181
 
178
- android_publisher.update_listing(
179
- current_package_name,
180
- current_edit.id,
181
- language,
182
- listing)
182
+ call_google_api do
183
+ android_publisher.update_listing(
184
+ current_package_name,
185
+ current_edit.id,
186
+ language,
187
+ listing
188
+ )
189
+ end
183
190
  end
184
191
 
185
192
  def upload_apk(path_to_apk)
186
193
  ensure_active_edit!
187
194
 
188
- result_upload = android_publisher.upload_apk(
189
- current_package_name,
190
- current_edit.id,
191
- upload_source: path_to_apk)
195
+ result_upload = call_google_api do
196
+ android_publisher.upload_apk(
197
+ current_package_name,
198
+ current_edit.id,
199
+ upload_source: path_to_apk
200
+ )
201
+ end
192
202
 
193
203
  return result_upload.version_code
194
204
  end
@@ -205,21 +215,27 @@ module Supply
205
215
  version_codes: track_version_codes
206
216
  })
207
217
 
208
- android_publisher.update_track(
209
- current_package_name,
210
- current_edit.id,
211
- track,
212
- track_body)
218
+ call_google_api do
219
+ android_publisher.update_track(
220
+ current_package_name,
221
+ current_edit.id,
222
+ track,
223
+ track_body
224
+ )
225
+ end
213
226
  end
214
227
 
215
228
  # Get list of version codes for track
216
229
  def track_version_codes(track)
217
230
  ensure_active_edit!
218
231
 
219
- result = android_publisher.get_track(
220
- current_package_name,
221
- current_edit.id,
222
- track)
232
+ result = call_google_api do
233
+ android_publisher.get_track(
234
+ current_package_name,
235
+ current_edit.id,
236
+ track
237
+ )
238
+ end
223
239
 
224
240
  return result.version_codes
225
241
  end
@@ -232,12 +248,15 @@ module Supply
232
248
  recent_changes: apk_listing.recent_changes
233
249
  })
234
250
 
235
- android_publisher.update_apk_listing(
236
- current_package_name,
237
- current_edit.id,
238
- apk_listing.apk_version_code,
239
- apk_listing.language,
240
- apk_listing_object)
251
+ call_google_api do
252
+ android_publisher.update_apk_listing(
253
+ current_package_name,
254
+ current_edit.id,
255
+ apk_listing.apk_version_code,
256
+ apk_listing.language,
257
+ apk_listing_object
258
+ )
259
+ end
241
260
  end
242
261
 
243
262
  #####################################################
@@ -247,11 +266,14 @@ module Supply
247
266
  def fetch_images(image_type: nil, language: nil)
248
267
  ensure_active_edit!
249
268
 
250
- result = android_publisher.list_images(
251
- current_package_name,
252
- current_edit.id,
253
- language,
254
- image_type)
269
+ result = call_google_api do
270
+ android_publisher.list_images(
271
+ current_package_name,
272
+ current_edit.id,
273
+ language,
274
+ image_type
275
+ )
276
+ end
255
277
 
256
278
  (result.images || []).map(&:url)
257
279
  end
@@ -260,36 +282,44 @@ module Supply
260
282
  def upload_image(image_path: nil, image_type: nil, language: nil)
261
283
  ensure_active_edit!
262
284
 
263
- android_publisher.upload_image(
264
- current_package_name,
265
- current_edit.id,
266
- language,
267
- image_type,
268
- upload_source: image_path,
269
- content_type: 'image/*')
285
+ call_google_api do
286
+ android_publisher.upload_image(
287
+ current_package_name,
288
+ current_edit.id,
289
+ language,
290
+ image_type,
291
+ upload_source: image_path,
292
+ content_type: 'image/*'
293
+ )
294
+ end
270
295
  end
271
296
 
272
297
  def clear_screenshots(image_type: nil, language: nil)
273
298
  ensure_active_edit!
274
299
 
275
- android_publisher.delete_all_images(
276
- current_package_name,
277
- current_edit.id,
278
- language,
279
- image_type)
300
+ call_google_api do
301
+ android_publisher.delete_all_images(
302
+ current_package_name,
303
+ current_edit.id,
304
+ language,
305
+ image_type
306
+ )
307
+ end
280
308
  end
281
309
 
282
310
  def upload_obb(obb_file_path: nil, apk_version_code: nil, expansion_file_type: nil)
283
311
  ensure_active_edit!
284
312
 
285
- android_publisher.upload_expansion_file(
286
- current_package_name,
287
- current_edit.id,
288
- apk_version_code,
289
- expansion_file_type,
290
- upload_source: obb_file_path,
291
- content_type: 'application/octet-stream'
292
- )
313
+ call_google_api do
314
+ android_publisher.upload_expansion_file(
315
+ current_package_name,
316
+ current_edit.id,
317
+ apk_version_code,
318
+ expansion_file_type,
319
+ upload_source: obb_file_path,
320
+ content_type: 'application/octet-stream'
321
+ )
322
+ end
293
323
  end
294
324
 
295
325
  private
@@ -297,5 +327,11 @@ module Supply
297
327
  def ensure_active_edit!
298
328
  UI.user_error!("You need to have an active edit, make sure to call `begin_edit`") unless @current_edit
299
329
  end
330
+
331
+ def call_google_api
332
+ yield if block_given?
333
+ rescue Google::Apis::ClientError => e
334
+ UI.user_error! "Google Api Error: #{e.message}"
335
+ end
300
336
  end
301
337
  end
@@ -1,4 +1,4 @@
1
1
  module Supply
2
- VERSION = "0.7.0".freeze
2
+ VERSION = "0.7.1".freeze
3
3
  DESCRIPTION = "Command line tool for updating Android apps and their metadata on the Google Play Store"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: supply
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-12 00:00:00.000000000 Z
11
+ date: 2016-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client