fastlane-plugin-versioning 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60454c71e3a3495d65c1c09bc4d5a702032c542c75458cfb8ffd64fdd60652cd
4
- data.tar.gz: e98badc1157215b40788f2d334079705b55ba019ce5898908303dbfdeaa9c913
3
+ metadata.gz: 7d6e946a7af0f37a1e55e32d15c79b0541366f81f945c22f6f068ef132fe7f56
4
+ data.tar.gz: cbf20e1fe14cb48f14584f64cd6540642b31f979d90d43475e35db6cc29de332
5
5
  SHA512:
6
- metadata.gz: b533a88078e909fe883b6bb8eeaf267d10c23838cb72373c898d446349ecbb9f7e320905b1c28037de3d11dd624bd1810ea6945c036812ba4d06b9db13845b78
7
- data.tar.gz: 92c8f3f45fe632e12d0fcfbd67e41f9a95dfcf88d4b127ed9e8b40c16ac34ddc921de3fa549a40b2cfca2ba34dcf5eeed30048ff279d5b30bd7f7efae5d73bd2
6
+ metadata.gz: b8ebc04d0360615c67dc31a58525228ed5aeeffa7cd829e87cb9e2efd934d174e95b38be80bf2533d8ef836a43125864befc4eb30e72f5619574265653eefe36
7
+ data.tar.gz: a170165ee4518cdcd98422e6cbf7e6b1743a857d947045ed08bfdb9f38c2f1c2dfa539a4b64c626c79d7387a141c93c22d202ad8ec6044429afe519663705aa2
@@ -20,15 +20,28 @@ module Fastlane
20
20
  random = Helper.test? ? "123" : SecureRandom.uuid
21
21
 
22
22
  if params[:country]
23
- uri = URI("http://itunes.apple.com/lookup?bundleId=#{bundle_id}&country=#{params[:country]}&rand=#{random}")
23
+ uri = URI("https://itunes.apple.com/lookup?bundleId=#{bundle_id}&country=#{params[:country]}&rand=#{random}")
24
24
  else
25
- uri = URI("http://itunes.apple.com/lookup?bundleId=#{bundle_id}&rand=#{random}")
25
+ uri = URI("https://itunes.apple.com/lookup?bundleId=#{bundle_id}&rand=#{random}")
26
26
  end
27
27
  Net::HTTP.get(uri)
28
28
 
29
29
  response = Net::HTTP.get_response(uri)
30
- UI.crash!("Unexpected status code from iTunes Search API") unless response.kind_of?(Net::HTTPSuccess)
31
- response_body = JSON.parse(response.body)
30
+ case response
31
+ when Net::HTTPSuccess
32
+ response_body = JSON.parse(response.body)
33
+ when Net::HTTPRedirection
34
+ UI.crash!("iTunes Search API resolved with status code 302, but no redirect url has been received") unless response['location']
35
+ UI.important("iTunes Search API resolved with status code 302, redirecting to new url")
36
+
37
+ new_url = response['location']
38
+ response = Net::HTTP.get_response(URI(new_url))
39
+ UI.crash!("Unexpected status code from iTunes Search API") unless response.kind_of?(Net::HTTPSuccess)
40
+
41
+ response_body = JSON.parse(response.body)
42
+ else
43
+ UI.crash!("Unexpected status code from iTunes Search API")
44
+ end
32
45
 
33
46
  UI.user_error!("Cannot find app with #{bundle_id} bundle ID in the App Store") if response_body["resultCount"] == 0
34
47
 
@@ -78,7 +78,7 @@ module Fastlane
78
78
  project.select_scheme
79
79
 
80
80
  build_number = project.build_settings(key: 'CURRENT_PROJECT_VERSION')
81
- UI.user_error! "Cannot resolve $(CURRENT_PROJECT_VERSION) in for the scheme #{config.scheme} with the name #{params.configuration}" if build_number.nil? || build_number.empty?
81
+ UI.user_error! "Cannot resolve $(CURRENT_PROJECT_VERSION) in for the scheme #{config[:scheme]} with the name #{config[:configuration]}" if build_number.nil? || build_number.empty?
82
82
  build_number
83
83
  end
84
84
 
@@ -62,7 +62,7 @@ module Fastlane
62
62
  project.select_scheme
63
63
 
64
64
  build_number = project.build_settings(key: 'MARKETING_VERSION')
65
- UI.user_error! "Cannot resolve $(MARKETING_VERSION) in for the scheme #{config.scheme} with the name #{params.configuration}" if build_number.nil? || build_number.empty?
65
+ UI.user_error! "Cannot resolve $(MARKETING_VERSION) in for the scheme #{config[:scheme]} with the name #{config[:configuration]}" if build_number.nil? || build_number.empty?
66
66
  build_number
67
67
  end
68
68
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Versioning
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-versioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siarhei Fiedartsou
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-08-19 00:00:00.000000000 Z
12
+ date: 2024-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry