fastlane 2.37.0.beta.20170601010043 → 2.37.0.beta.20170602010027

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: b3cb7b7fb4a4bfc18f7e73e2aec50f4c956326f9
4
- data.tar.gz: 977106738fa32888cc772b6844ec7433747a24f2
3
+ metadata.gz: a4b511987043d3ffedff763ec2e2e5fce1f7c457
4
+ data.tar.gz: 5700e2b138071d18dd80bff0789e935e111cf859
5
5
  SHA512:
6
- metadata.gz: b99d57aaa6bb015338d7d5c1d2a0385b469273665eb077004cdc9acee137e06be82945f29cff4c8beb97017f24828d2d42518a47a272d5f4cf040bc1ff607610
7
- data.tar.gz: bbfcb73c1eef73ecba7bb3b095f6d08c373cde6465aa924d5fa6beba693839096b372a0f89231c6acd904c227b133564c2d071a61d46a37a4caffbbe32b24004
6
+ metadata.gz: c2d420b538d240e89ff01005cf15aeb02ceb982ab27d74a9a5fb25ab9c48ec4c76b714227038754f99cb7a16d7b5f49383fadc3851debf915e669d9f4b2b2f59
7
+ data.tar.gz: e12c6dce1ef0bc9b20014ac8b30d843e5c240b52ce4982a4e26beee40e911b509569fae6aa3386376c9519f9e3c45d47bcd1029fdab189d565d12f2731689792
@@ -29,9 +29,7 @@ module Fastlane
29
29
  UI.command(command) if print_command
30
30
 
31
31
  result = ''
32
- if Helper.test?
33
- result << command # only for the tests
34
- else
32
+ if Helper.sh_enabled?
35
33
  exit_status = nil
36
34
  IO.popen(command, err: [:child, :out]) do |io|
37
35
  io.sync = true
@@ -51,9 +49,15 @@ module Fastlane
51
49
  end
52
50
  message += "\n#{result}" if print_command_output
53
51
 
54
- error_callback.call(result) if error_callback
55
- UI.shell_error!(message)
52
+ if error_callback
53
+ UI.error(message)
54
+ error_callback.call(result)
55
+ else
56
+ UI.shell_error!(message)
57
+ end
56
58
  end
59
+ else
60
+ result << command # only for the tests
57
61
  end
58
62
 
59
63
  result
@@ -1,4 +1,4 @@
1
1
  module Fastlane
2
- VERSION = '2.37.0.beta.20170601010043'.freeze
2
+ VERSION = '2.37.0.beta.20170602010027'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  end
@@ -24,6 +24,11 @@ module FastlaneCore
24
24
  defined? SpecHelper
25
25
  end
26
26
 
27
+ # @return true if it is enabled to execute external commands
28
+ def self.sh_enabled?
29
+ !self.test?
30
+ end
31
+
27
32
  # removes ANSI colors from string
28
33
  def self.strip_ansi_colors(str)
29
34
  str.gsub(/\e\[([;\d]+)?m/, '')
@@ -6,45 +6,41 @@ module Spaceship
6
6
  # this version is for
7
7
  attr_accessor :application
8
8
 
9
- # @return (Spaceship::Tunes::AppRatingSummary) A summary of the overall ratings for the application
10
- attr_accessor :rating_summary
11
-
12
- # @return (Hash) mapping country codes to a (Spaceship::Tunes::AppRatingSummary) summary of ratings for that country
13
- attr_reader :store_fronts
14
-
15
- # @return (Hash) of iTunesConnect version id's to readable version numbers
16
- attr_reader :versions
17
-
18
- attr_mapping({
19
- 'versions' => :versions
20
- })
9
+ # @return (Integer) total number of ratings recevied
10
+ attr_accessor :rating_count
21
11
 
22
- class << self
23
- # Create a new object based on a hash.
24
- # This is used to create a new object based on the server response.
25
- def factory(attrs)
26
- obj = self.new(attrs)
12
+ # @return (Integer) total number of one star ratings recevied
13
+ attr_accessor :one_star_rating_count
27
14
 
28
- obj.unfold_rating_summary(attrs['ratings'])
29
- obj.unfold_store_fronts(attrs['storeFronts'])
15
+ # @return (Integer) total number of two star ratings recevied
16
+ attr_accessor :two_star_rating_count
30
17
 
31
- return obj
32
- end
33
- end
18
+ # @return (Integer) total number of three star ratings recevied
19
+ attr_accessor :three_star_rating_count
34
20
 
35
- def unfold_rating_summary(attrs)
36
- unfolded_rating_summary = AppRatingSummary.new(attrs)
37
- instance_variable_set(:@rating_summary, unfolded_rating_summary)
38
- end
21
+ # @return (Integer) total number of four star ratings recevied
22
+ attr_accessor :four_star_rating_count
39
23
 
40
- def unfold_store_fronts(attrs)
41
- unfolded_store_fronts = {}
24
+ # @return (Integer) total number of five star ratings recevied
25
+ attr_accessor :five_star_rating_count
42
26
 
43
- attrs.each do |info|
44
- unfolded_store_fronts[info['countryCode']] = AppRatingSummary.new(info['ratings'])
45
- end
27
+ attr_mapping({
28
+ 'reviewCount' => :review_count,
29
+ 'ratingCount' => :rating_count,
30
+ 'ratingOneCount' => :one_star_rating_count,
31
+ 'ratingTwoCount' => :two_star_rating_count,
32
+ 'ratingThreeCount' => :three_star_rating_count,
33
+ 'ratingFourCount' => :four_star_rating_count,
34
+ 'ratingFiveCount' => :five_star_rating_count
35
+ })
46
36
 
47
- instance_variable_set(:@store_fronts, unfolded_store_fronts)
37
+ # @return (Float) the average rating for this summary (rounded to 2 decimal places)
38
+ def average_rating
39
+ ((one_star_rating_count +
40
+ (two_star_rating_count * 2) +
41
+ (three_star_rating_count * 3) +
42
+ (four_star_rating_count * 4) +
43
+ (five_star_rating_count * 5)) / rating_count.to_f).round(2)
48
44
  end
49
45
 
50
46
  # @return (Array) of Review Objects
@@ -124,47 +120,5 @@ module Spaceship
124
120
  false
125
121
  end
126
122
  end
127
-
128
- class AppRatingSummary < TunesBase
129
- # @return (Integer) total number of reviews recevied
130
- attr_reader :review_count
131
-
132
- # @return (Integer) total number of ratings recevied
133
- attr_reader :rating_count
134
-
135
- # @return (Integer) total number of one star ratings recevied
136
- attr_reader :one_star_rating_count
137
-
138
- # @return (Integer) total number of two star ratings recevied
139
- attr_reader :two_star_rating_count
140
-
141
- # @return (Integer) total number of three star ratings recevied
142
- attr_reader :three_star_rating_count
143
-
144
- # @return (Integer) total number of four star ratings recevied
145
- attr_reader :four_star_rating_count
146
-
147
- # @return (Integer) total number of five star ratings recevied
148
- attr_reader :five_star_rating_count
149
-
150
- attr_mapping({
151
- 'reviewCount' => :review_count,
152
- 'ratingCount' => :rating_count,
153
- 'ratingOneCount' => :one_star_rating_count,
154
- 'ratingTwoCount' => :two_star_rating_count,
155
- 'ratingThreeCount' => :three_star_rating_count,
156
- 'ratingFourCount' => :four_star_rating_count,
157
- 'ratingFiveCount' => :five_star_rating_count
158
- })
159
-
160
- # @return (Float) the average rating for this summary (rounded to 2 decimal places)
161
- def average_rating
162
- ((self.one_star_rating_count +
163
- (self.two_star_rating_count * 2) +
164
- (self.three_star_rating_count * 3) +
165
- (self.four_star_rating_count * 4) +
166
- (self.five_star_rating_count * 5)) / self.rating_count.to_f).round(2)
167
- end
168
- end
169
123
  end
170
124
  end
@@ -129,10 +129,10 @@ module Spaceship
129
129
  client.get_resolution_center(apple_id, platform)
130
130
  end
131
131
 
132
- def ratings
133
- attrs = client.get_rating_summary(apple_id, platform)
132
+ def ratings(version_id: '', storefront: '')
133
+ attrs = client.get_ratings(apple_id, platform, version_id, storefront)
134
134
  attrs[:application] = self
135
- Tunes::AppRatings.factory(attrs)
135
+ Tunes::AppRatings.new(attrs)
136
136
  end
137
137
 
138
138
  def platforms
@@ -258,8 +258,13 @@ module Spaceship
258
258
  parse_response(r, 'data')
259
259
  end
260
260
 
261
- def get_rating_summary(app_id, platform, versionId = '')
262
- r = request(:get, "ra/apps/#{app_id}/reviews/summary?platform=#{platform}&versionId=#{versionId}")
261
+ def get_ratings(app_id, platform, versionId = '', storefront = '')
262
+ # if storefront or versionId is empty api fails
263
+ rating_url = "ra/apps/#{app_id}/platforms/#{platform}/reviews/summary?"
264
+ rating_url << "storefront=#{storefront}" unless storefront.empty?
265
+ rating_url << "versionId=#{versionId}" unless versionId.empty?
266
+
267
+ r = request(:get, rating_url)
263
268
  parse_response(r, 'data')
264
269
  end
265
270
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.37.0.beta.20170601010043
4
+ version: 2.37.0.beta.20170602010027
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2017-06-01 00:00:00.000000000 Z
18
+ date: 2017-06-02 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: slack-notifier
@@ -1368,22 +1368,22 @@ metadata:
1368
1368
  post_install_message:
1369
1369
  rdoc_options: []
1370
1370
  require_paths:
1371
+ - frameit/lib
1371
1372
  - spaceship/lib
1372
- - scan/lib
1373
- - supply/lib
1374
- - cert/lib
1373
+ - screengrab/lib
1374
+ - deliver/lib
1375
+ - credentials_manager/lib
1375
1376
  - sigh/lib
1377
+ - supply/lib
1376
1378
  - produce/lib
1377
- - fastlane/lib
1378
- - screengrab/lib
1379
+ - scan/lib
1380
+ - gym/lib
1379
1381
  - pem/lib
1380
- - credentials_manager/lib
1381
- - deliver/lib
1382
- - frameit/lib
1383
- - match/lib
1382
+ - cert/lib
1383
+ - fastlane/lib
1384
1384
  - snapshot/lib
1385
- - gym/lib
1386
1385
  - fastlane_core/lib
1386
+ - match/lib
1387
1387
  - pilot/lib
1388
1388
  required_ruby_version: !ruby/object:Gem::Requirement
1389
1389
  requirements: