android-publisher 0.0.13 → 0.0.14

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: f5aa8b776e103d2f4052ad143f40c0374f4b48d8
4
- data.tar.gz: 305bbf66b06be634e359e112ec617d81cc5acfda
3
+ metadata.gz: 0d0af6b6f16b0109528999fff41d3cb32fed8625
4
+ data.tar.gz: cb1a73ea0a3fb56481e09ff4f4e9885634c08474
5
5
  SHA512:
6
- metadata.gz: 3dbc690766924e827d05134394624fbd3ec8711d8f7bb543cf460f88bf69cdbbf697563a15113d8fd45c69001f40ced8d39dc766a89788a5ce5edc1ab797ff9d
7
- data.tar.gz: 5c4b26fb07d81da8f0eec31b0ddfb2afaa0bf636a696feb9c53bcf8644b307707c9a51af3c5eeb0356c6caa5c8452c6da1339f80a8bc8bec93e865f4d6820650
6
+ metadata.gz: 52f49e12b80675589bd10c9301d205698038639b88e21852322537a733b72a949b2668d8a3db9a96bd4027e2f614445d25c86d093bd3129bc4def1e7acea8c21
7
+ data.tar.gz: 06754d4134735babf53a601973c60341fd1a3a7df9ad3169e4594bbd5d9114b920b4b64f882ec67f5a97d035df2b9e11e1604a35430d29913f0b354b3d10c2a1
@@ -19,12 +19,16 @@ module Android
19
19
  def rollout(user_fraction = 0.01)
20
20
  edit.insert
21
21
  edit.upload_apk(@apk_path) unless @apk_path.nil?
22
+ current_user_fraction = edit.rollout_fraction
23
+ user_fraction = current_user_fraction if user_fraction < current_user_fraction
22
24
  edit.assign_to_staged_rollout_track(user_fraction)
23
25
  edit.commit
24
26
  end
25
27
 
26
28
  def update_rollout(user_fraction)
27
29
  edit.insert
30
+ current_user_fraction = edit.rollout_fraction
31
+ user_fraction = current_user_fraction if user_fraction < current_user_fraction
28
32
  edit.update_rollout(user_fraction)
29
33
  edit.commit
30
34
  end
@@ -39,6 +39,10 @@ module Android
39
39
  Track.new(@client, track).has_deployed_apks?
40
40
  end
41
41
 
42
+ def rollout_fraction
43
+ Track.new(@client, :rollout).rollout_fraction
44
+ end
45
+
42
46
  def upload_apk(path_to_apk)
43
47
  apks.upload(path_to_apk)
44
48
  end
@@ -11,6 +11,10 @@ module Android
11
11
  list['versionCodes'].size > 0
12
12
  end
13
13
 
14
+ def rollout_fraction
15
+ list['userFraction']
16
+ end
17
+
14
18
  def update(version_code, user_fraction=nil)
15
19
  params = {
16
20
  :headers => { "Content-Type" => 'application/json' },
@@ -36,7 +40,7 @@ module Android
36
40
  begin
37
41
  Response.parse(@client.get())
38
42
  rescue OAuth2::Error
39
- {'versionCodes' => []}
43
+ {'versionCodes' => [], 'userFraction' => -1}
40
44
  end
41
45
  end
42
46
  end
@@ -1,5 +1,5 @@
1
1
  module Android
2
2
  class Publisher
3
- VERSION = "0.0.13"
3
+ VERSION = "0.0.14"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: android-publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slawomir Smiechura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-26 00:00:00.000000000 Z
11
+ date: 2015-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler