fastlane 2.32.0.beta.20170518010031 → 2.32.0

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: 628fb80a7557e8bd6a3977c975fd74490bb9cf8f
4
- data.tar.gz: 34f0bd675989ddbdc1817c67309216f0f4b3fe4e
3
+ metadata.gz: b4d571b0849ea335ab1184f3436547b7386cbd58
4
+ data.tar.gz: f75a49396c4482f4b4b99c82716252f1f3d6630d
5
5
  SHA512:
6
- metadata.gz: 9c4bc5a524402ec12cba3017e79f017af6d1f04a49a3b123d82cdb7452b1ab8e8602cae67b0a25e9030754ce189366bebd33c911f1b004db7336c243048ac248
7
- data.tar.gz: af7ae644c8198aea84c2109777b160db06682a081b8e84d1543feaef20a11aac1e458c3ee508a9fedf488583e65b48cbfb142678f8f3d343afe32101dd02be95
6
+ metadata.gz: aef8f31380fc8ad25c5df0f3200d703b31e004bf0f0d4b8c54aad4501c7df6f25e4b208d6c273e2e53d150d64f1aa934efc84324b1eef66106b7289b3b306890
7
+ data.tar.gz: 11f6357a4d06b3e37dee4aad05f8e74b36f3476af7a8944cf2c335ce6284309a14dbd6d82f3775c92008736c84845668a8a594dd4a46a1b68478dd7c1849640c
@@ -252,9 +252,9 @@ module Fastlane
252
252
  class_ref.run(arguments)
253
253
  end
254
254
  end
255
- rescue \
256
- FastlaneCore::Interface::FastlaneBuildFailure, # build_failure!
257
- FastlaneCore::Interface::FastlaneTestFailure => e # test_failure!
255
+ rescue Interrupt => e
256
+ raise e # reraise the interruption to avoid logging this as a crash
257
+ rescue FastlaneCore::Interface::FastlaneCommonException => e # these are exceptions that we dont count as crashes
258
258
  raise e
259
259
  rescue FastlaneCore::Interface::FastlaneError => e # user_error!
260
260
  FastlaneCore::CrashReporter.report_crash(exception: e, action: method_sym)
@@ -1,4 +1,4 @@
1
1
  module Fastlane
2
- VERSION = '2.32.0.beta.20170518010031'.freeze
2
+ VERSION = '2.32.0'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  end
@@ -38,6 +38,7 @@ require 'fastlane_core/ui/errors/fastlane_exception'
38
38
  require 'fastlane_core/ui/errors/fastlane_error'
39
39
  require 'fastlane_core/ui/errors/fastlane_crash'
40
40
  require 'fastlane_core/ui/errors/fastlane_shell_error'
41
+ require 'fastlane_core/ui/errors/fastlane_not_counted_error'
41
42
 
42
43
  # Third Party code
43
44
  require 'colored'
@@ -314,9 +314,9 @@ module FastlaneCore
314
314
  UI.error("Could not read build settings. Make sure that the scheme \"#{options[:scheme]}\" is configured for running by going to Product → Scheme → Edit Scheme…, selecting the \"Build\" section, checking the \"Run\" checkbox and closing the scheme window.")
315
315
  end
316
316
  rescue Timeout::Error
317
- UI.crash!("xcodebuild -showBuildSettings timed-out after #{timeout} seconds and #{retries} retries." \
317
+ raise FastlaneCore::Interface::FastlaneDependencyCausedException.new, "xcodebuild -showBuildSettings timed-out after #{timeout} seconds and #{retries} retries." \
318
318
  " You can override the timeout value with the environment variable FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT," \
319
- " and the number of retries with the environment variable FASTLANE_XCODEBUILD_SETTINGS_RETRIES ")
319
+ " and the number of retries with the environment variable FASTLANE_XCODEBUILD_SETTINGS_RETRIES ".red
320
320
  end
321
321
  end
322
322
 
@@ -32,10 +32,5 @@ module FastlaneCore
32
32
  exception.message
33
33
  end
34
34
  end
35
- class FastlaneBuildFailure < FastlaneException
36
- end
37
-
38
- class FastlaneTestFailure < FastlaneException
39
- end
40
35
  end
41
36
  end
@@ -0,0 +1,17 @@
1
+ module FastlaneCore
2
+ class Interface
3
+ # Super class for exception types that we do not want to record
4
+ # explictly as crashes or user errors
5
+ class FastlaneCommonException < FastlaneException; end
6
+
7
+ # Raised when there is a build failure in xcodebuild
8
+ class FastlaneBuildFailure < FastlaneCommonException; end
9
+
10
+ # Raised when a test fails when being run by tools such as scan or snapshot
11
+ class FastlaneTestFailure < FastlaneCommonException; end
12
+
13
+ # Raise this type of exception when a failure caused by a third party
14
+ # dependency (i.e. xcodebuild, gradle, slather) happens.
15
+ class FastlaneDependencyCausedException < FastlaneCommonException; end
16
+ end
17
+ end
@@ -64,9 +64,7 @@ module Commander
64
64
  FastlaneCore::CrashReporter.report_crash(exception: e, action: @program[:name])
65
65
  abort e.to_s
66
66
  end
67
- rescue \
68
- FastlaneCore::Interface::FastlaneBuildFailure, # build_failure!
69
- FastlaneCore::Interface::FastlaneTestFailure => e # test_failure!
67
+ rescue FastlaneCore::Interface::FastlaneCommonException => e # these are exceptions that we dont count as crashes
70
68
  display_user_error!(e, e.to_s)
71
69
  rescue FastlaneCore::Interface::FastlaneError => e # user_error!
72
70
  collector.did_raise_error(@program[:name])
@@ -6,6 +6,7 @@ require 'spaceship/tunes/iap_family_list'
6
6
  require 'spaceship/tunes/iap_families'
7
7
  require 'spaceship/tunes/iap_family_details'
8
8
  require 'spaceship/tunes/iap_families'
9
+ require 'spaceship/tunes/iap_subscription_pricing_tier'
9
10
 
10
11
  module Spaceship
11
12
  module Tunes
@@ -118,9 +118,8 @@ module Spaceship
118
118
  # }
119
119
  # ]
120
120
  def pricing_intervals
121
- parsed_intervals = []
122
- raw_data["pricingIntervals"].each do |interval|
123
- parsed_intervals << {
121
+ @pricing_intervals ||= raw_data["pricingIntervals"].map do |interval|
122
+ {
124
123
  tier: interval["value"]["tierStem"].to_i,
125
124
  begin_date: interval["value"]["priceTierEffectiveDate"],
126
125
  end_date: interval["value"]["priceTierEndDate"],
@@ -128,7 +127,6 @@ module Spaceship
128
127
  country: interval["value"]["country"]
129
128
  }
130
129
  end
131
- return parsed_intervals
132
130
  end
133
131
 
134
132
  # @return (String) Human Readable type of the purchase
@@ -217,6 +215,52 @@ module Spaceship
217
215
  def delete!
218
216
  client.delete_iap!(app_id: application.apple_id, purchase_id: self.purchase_id)
219
217
  end
218
+
219
+ # Retrieves the actual prices for an iap.
220
+ #
221
+ # @return ([]) An empty array
222
+ # if the iap is not yet cleared for sale
223
+ # @return ([Spaceship::Tunes::PricingInfo]) An array of pricing infos from the same pricing tier
224
+ # if the iap uses world wide pricing
225
+ # @return ([Spaceship::Tunes::IAPSubscriptionPricingInfo]) An array of pricing infos from multple subscription pricing tiers
226
+ # if the iap uses territorial pricing
227
+ def pricing_info
228
+ return [] unless cleared_for_sale
229
+ return world_wide_pricing_info if world_wide_pricing?
230
+ territorial_pricing_info
231
+ end
232
+
233
+ private
234
+
235
+ # Checks wheather an iap uses world wide or territorial pricing.
236
+ #
237
+ # @return (true, false)
238
+ def world_wide_pricing?
239
+ pricing_intervals.fetch(0, {})[:country] == "WW"
240
+ end
241
+
242
+ # Maps a single pricing interval to pricing infos.
243
+ #
244
+ # @return ([Spaceship::Tunes::PricingInfo]) An array of pricing infos from the same tier
245
+ def world_wide_pricing_info
246
+ client
247
+ .pricing_tiers
248
+ .find { |p| p.tier_stem == pricing_intervals.first[:tier].to_s }
249
+ .pricing_info
250
+ end
251
+
252
+ # Maps pricing intervals to their respective subscription pricing infos.
253
+ #
254
+ # @return ([Spaceship::Tunes::IAPSubscriptionPricingInfo]) An array of subscription pricing infos
255
+ def territorial_pricing_info
256
+ pricing_matrix = client.subscription_pricing_tiers(application.apple_id)
257
+ pricing_intervals.map do |interval|
258
+ pricing_matrix
259
+ .find { |p| p.tier_stem == interval[:tier].to_s }
260
+ .pricing_info
261
+ .find { |i| i.country_code == interval[:country] }
262
+ end
263
+ end
220
264
  end
221
265
  end
222
266
  end
@@ -0,0 +1,76 @@
1
+ module Spaceship
2
+ module Tunes
3
+ class IAPSubscriptionPricingTier < TunesBase
4
+ # @return (String) Number of the subscription price tier (e.g. "1" for Tier 1 )
5
+ attr_accessor :tier_stem
6
+
7
+ # @return (String) Name of the tier (e.g. "ITC.addons.pricing.tier.1" for Tier 1)
8
+ attr_accessor :tier_name
9
+
10
+ # @return ([Spaceship::Tunes::IAPSubscriptionPricingInfo]) A list of all prices for the respective countries
11
+ attr_accessor :pricing_info
12
+
13
+ attr_mapping(
14
+ "tierStem" => :tier_stem,
15
+ "tierName" => :tier_name
16
+ )
17
+
18
+ class << self
19
+ # Create a new object based on a hash.
20
+ # This is used to create a new object based on the server response.
21
+ def factory(attrs)
22
+ obj = self.new(attrs)
23
+ obj.unfold_pricing_info(attrs["pricingInfo"])
24
+
25
+ return obj
26
+ end
27
+ end
28
+
29
+ def unfold_pricing_info(attrs)
30
+ unfolded_pricing_info = attrs.map { |info| IAPSubscriptionPricingInfo.new(info) }
31
+ instance_variable_set(:@pricing_info, unfolded_pricing_info)
32
+ end
33
+ end
34
+
35
+ class IAPSubscriptionPricingInfo < TunesBase
36
+ # @return (String) country code, e.g. "US"
37
+ attr_accessor :country_code
38
+
39
+ # @return (String) currency symbol, e.g. "$"
40
+ attr_accessor :currency_symbol
41
+
42
+ # @return (String) currency code, e.g. "USD"
43
+ attr_accessor :currency_code
44
+
45
+ # @return (Number) net proceedings for the developer in the first year
46
+ attr_accessor :wholesale_price
47
+
48
+ # @return (Number) net proceedings for the developer after the first year
49
+ attr_accessor :wholesale_price2
50
+
51
+ # @return (Number) customer price
52
+ attr_accessor :retail_price
53
+
54
+ # @return (String) formatted customer price, e.g. "$0.00"
55
+ attr_accessor :f_retail_price
56
+
57
+ # @return (String) formatted net proceedings in the first year, e.g. "$0.00"
58
+ attr_accessor :f_wholesale_price
59
+
60
+ # @return (String) formatted net proceedings after the first year, e.g. "$0.00"
61
+ attr_accessor :f_wholesale_price2
62
+
63
+ attr_mapping(
64
+ "countryCode" => :country_code,
65
+ "currencySymbol" => :currency_symbol,
66
+ "currencyCode" => :currency_code,
67
+ "wholesalePrice" => :wholesale_price,
68
+ "wholesalePrice2" => :wholesale_price2,
69
+ "retailPrice" => :retail_price,
70
+ "fRetailPrice" => :f_retail_price,
71
+ "fWholesalePrice" => :f_wholesale_price,
72
+ "fWholesalePrice2" => :f_wholesale_price2
73
+ )
74
+ end
75
+ end
76
+ end
@@ -514,9 +514,11 @@ module Spaceship
514
514
  # }, {
515
515
  # ...
516
516
  def pricing_tiers
517
- r = request(:get, 'ra/apps/pricing/matrix')
518
- data = parse_response(r, 'data')['pricingTiers']
519
- data.map { |tier| Spaceship::Tunes::PricingTier.factory(tier) }
517
+ @pricing_tiers ||= begin
518
+ r = request(:get, 'ra/apps/pricing/matrix')
519
+ data = parse_response(r, 'data')['pricingTiers']
520
+ data.map { |tier| Spaceship::Tunes::PricingTier.factory(tier) }
521
+ end
520
522
  end
521
523
 
522
524
  #####################################################
@@ -1011,18 +1013,31 @@ module Spaceship
1011
1013
  handle_itc_response(r)
1012
1014
  end
1013
1015
 
1014
- # loads the full In-App-Purchases
1016
+ # Loads the full In-App-Purchases
1015
1017
  def load_iap(app_id: nil, purchase_id: nil)
1016
1018
  r = request(:get, "ra/apps/#{app_id}/iaps/#{purchase_id}")
1017
1019
  parse_response(r, 'data')
1018
1020
  end
1019
1021
 
1020
- # loads the full In-App-Purchases-Family
1022
+ # Loads the full In-App-Purchases-Family
1021
1023
  def load_iap_family(app_id: nil, family_id: nil)
1022
1024
  r = request(:get, "ra/apps/#{app_id}/iaps/family/#{family_id}")
1023
1025
  parse_response(r, 'data')
1024
1026
  end
1025
1027
 
1028
+ # Loads the full In-App-Purchases-Pricing-Matrix
1029
+ # note: the matrix is the same for any app_id
1030
+ #
1031
+ # @param app_id (String) The Apple ID of any app
1032
+ # @return ([Spaceship::Tunes::IAPSubscriptionPricingTier]) An array of pricing tiers
1033
+ def subscription_pricing_tiers(app_id)
1034
+ @subscription_pricing_tiers ||= begin
1035
+ r = request(:get, "ra/apps/#{app_id}/iaps/pricing/matrix/recurring")
1036
+ data = parse_response(r, "data")["pricingTiers"]
1037
+ data.map { |tier| Spaceship::Tunes::IAPSubscriptionPricingTier.factory(tier) }
1038
+ end
1039
+ end
1040
+
1026
1041
  # updates an In-App-Purchases-Family
1027
1042
  def update_iap_family!(app_id: nil, family_id: nil, data: nil)
1028
1043
  with_tunes_retry do
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.32.0.beta.20170518010031
4
+ version: 2.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -1111,6 +1111,7 @@ files:
1111
1111
  - fastlane_core/lib/fastlane_core/ui/errors/fastlane_crash.rb
1112
1112
  - fastlane_core/lib/fastlane_core/ui/errors/fastlane_error.rb
1113
1113
  - fastlane_core/lib/fastlane_core/ui/errors/fastlane_exception.rb
1114
+ - fastlane_core/lib/fastlane_core/ui/errors/fastlane_not_counted_error.rb
1114
1115
  - fastlane_core/lib/fastlane_core/ui/errors/fastlane_shell_error.rb
1115
1116
  - fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb
1116
1117
  - fastlane_core/lib/fastlane_core/ui/github_issue_inspector_reporter.rb
@@ -1330,6 +1331,7 @@ files:
1330
1331
  - spaceship/lib/spaceship/tunes/iap_family_list.rb
1331
1332
  - spaceship/lib/spaceship/tunes/iap_list.rb
1332
1333
  - spaceship/lib/spaceship/tunes/iap_status.rb
1334
+ - spaceship/lib/spaceship/tunes/iap_subscription_pricing_tier.rb
1333
1335
  - spaceship/lib/spaceship/tunes/iap_type.rb
1334
1336
  - spaceship/lib/spaceship/tunes/language_converter.rb
1335
1337
  - spaceship/lib/spaceship/tunes/language_item.rb
@@ -1365,23 +1367,23 @@ metadata:
1365
1367
  post_install_message:
1366
1368
  rdoc_options: []
1367
1369
  require_paths:
1370
+ - cert/lib
1371
+ - credentials_manager/lib
1368
1372
  - deliver/lib
1369
- - spaceship/lib
1370
- - screengrab/lib
1373
+ - fastlane/lib
1374
+ - fastlane_core/lib
1371
1375
  - frameit/lib
1372
- - scan/lib
1376
+ - gym/lib
1373
1377
  - match/lib
1378
+ - pem/lib
1379
+ - pilot/lib
1374
1380
  - produce/lib
1375
- - fastlane/lib
1376
- - snapshot/lib
1381
+ - scan/lib
1382
+ - screengrab/lib
1377
1383
  - sigh/lib
1384
+ - snapshot/lib
1385
+ - spaceship/lib
1378
1386
  - supply/lib
1379
- - pilot/lib
1380
- - credentials_manager/lib
1381
- - pem/lib
1382
- - cert/lib
1383
- - gym/lib
1384
- - fastlane_core/lib
1385
1387
  required_ruby_version: !ruby/object:Gem::Requirement
1386
1388
  requirements:
1387
1389
  - - ">="
@@ -1389,14 +1391,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
1389
1391
  version: 2.0.0
1390
1392
  required_rubygems_version: !ruby/object:Gem::Requirement
1391
1393
  requirements:
1392
- - - ">"
1394
+ - - ">="
1393
1395
  - !ruby/object:Gem::Version
1394
- version: 1.3.1
1396
+ version: '0'
1395
1397
  requirements: []
1396
1398
  rubyforge_project:
1397
- rubygems_version: 2.4.5.2
1399
+ rubygems_version: 2.5.2
1398
1400
  signing_key:
1399
1401
  specification_version: 4
1400
1402
  summary: The easiest way to automate beta deployments and releases for your iOS and
1401
1403
  Android apps
1402
1404
  test_files: []
1405
+ has_rdoc: