fastlane_core 0.1.3 → 0.1.4
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 +4 -4
- data/README.md +2 -1
- data/lib/fastlane_core.rb +1 -0
- data/lib/fastlane_core/developer_center/developer_center.rb +0 -1
- data/lib/fastlane_core/developer_center/developer_center_helper.rb +8 -0
- data/lib/fastlane_core/itunes_search_api.rb +48 -0
- data/lib/fastlane_core/update_checker.rb +1 -1
- data/lib/fastlane_core/version.rb +1 -1
- metadata +17 -3
- data/lib/fastlane_core/developer_center/developer_center_signing_certificates.rb +0 -76
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5befbdb7c8a4fd081865b47b533a4052731fe20
|
4
|
+
data.tar.gz: f397242998ea977e8b85381a815df52daaf78f2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0b020730bf64ec61d05b774e290be5e2d9cdf791806875048f53ac52e69e048090e91c9dabe05b46ef45f449423c3faaffe738b2f39905732be8a5330e42418
|
7
|
+
data.tar.gz: 69d00abe34da013cd4681cb228d3d4eab5e3b4f60d4a87c11dabad85de93f609438c03cc79f7797013faca8af211cb5a01924cbf7f1eb09cd1a40bbc83285b72
|
data/README.md
CHANGED
@@ -11,7 +11,8 @@
|
|
11
11
|
<a href="https://github.com/KrauseFx/frameit">frameit</a> •
|
12
12
|
<a href="https://github.com/KrauseFx/PEM">PEM</a> •
|
13
13
|
<a href="https://github.com/KrauseFx/sigh">sigh</a> •
|
14
|
-
<a href="https://github.com/KrauseFx/produce">produce</a>
|
14
|
+
<a href="https://github.com/KrauseFx/produce">produce</a> •
|
15
|
+
<a href="https://github.com/KrauseFx/cert">cert</a>
|
15
16
|
</p>
|
16
17
|
-------
|
17
18
|
|
data/lib/fastlane_core.rb
CHANGED
@@ -7,7 +7,6 @@ require 'phantomjs/poltergeist'
|
|
7
7
|
|
8
8
|
require 'fastlane_core/developer_center/developer_center_login'
|
9
9
|
require 'fastlane_core/developer_center/developer_center_helper'
|
10
|
-
require 'fastlane_core/developer_center/developer_center_signing_certificates'
|
11
10
|
|
12
11
|
module FastlaneCore
|
13
12
|
class DeveloperCenter
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'babosa'
|
2
|
+
|
1
3
|
module FastlaneCore
|
2
4
|
class DeveloperCenter
|
3
5
|
# Download a file from the dev center, by using a HTTP client. This will return the content of the file
|
@@ -69,5 +71,11 @@ module FastlaneCore
|
|
69
71
|
success = Proc.new { |r| r != nil }
|
70
72
|
return wait_for(method, name, success)
|
71
73
|
end
|
74
|
+
|
75
|
+
def valid_name_for(input)
|
76
|
+
latinazed = input.to_slug.transliterate.to_s # remove accents
|
77
|
+
latinazed.gsub!(/[^0-9A-Za-z\d\s]/, '') # remove non-valid characters
|
78
|
+
latinazed.squeeze # squeeze whitespaces
|
79
|
+
end
|
72
80
|
end
|
73
81
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
|
3
|
+
module FastlaneCore
|
4
|
+
# A wrapper around the Apple iTunes Search API to access app information like
|
5
|
+
# the app identifier of an app.
|
6
|
+
class ItunesSearchApi
|
7
|
+
|
8
|
+
# Fetch all information you can get from a specific AppleID of an app
|
9
|
+
# @param id (int) The AppleID of the given app. This usually consists of 9 digits.
|
10
|
+
# @return (Hash) the response of the first result from Apple (https://itunes.apple.com/lookup?id=284882215)
|
11
|
+
# @example Response of Facebook App: https://itunes.apple.com/lookup?id=284882215
|
12
|
+
# {
|
13
|
+
# ...
|
14
|
+
# artistName: "Facebook, Inc.",
|
15
|
+
# price: 0,
|
16
|
+
# version: "14.9",
|
17
|
+
# ...
|
18
|
+
# }
|
19
|
+
def self.fetch(id)
|
20
|
+
# Example: https://itunes.apple.com/lookup?id=284882215
|
21
|
+
fetch_url("https://itunes.apple.com/lookup?id=#{id.to_s}")
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.fetch_by_identifier(app_identifier)
|
25
|
+
# Example: http://itunes.apple.com/lookup?bundleId=net.sunapps.1
|
26
|
+
fetch_url("https://itunes.apple.com/lookup?bundleId=#{app_identifier}")
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
# This method only fetches the bundle identifier of a given app
|
31
|
+
# @param id (int) The AppleID of the given app. This usually consists of 9 digits.
|
32
|
+
# @return (String) the Bundle identifier of the app
|
33
|
+
def self.fetch_bundle_identifier(id)
|
34
|
+
self.fetch(id)['bundleId']
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
def self.fetch_url(url)
|
39
|
+
response = JSON.parse(open(url).read)
|
40
|
+
return nil if response['resultCount'] == 0
|
41
|
+
|
42
|
+
return response['results'].first
|
43
|
+
rescue
|
44
|
+
Helper.log.error "Could not find object '#{url}' using the iTunes API"
|
45
|
+
nil
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -11,7 +11,7 @@ module FastlaneCore
|
|
11
11
|
puts '#######################################################################'.green
|
12
12
|
puts "# #{gem_name} #{v} is available. You are on #{current_version}.".green
|
13
13
|
puts "# It is recommended to use the latest version.".green
|
14
|
-
puts "# Update using 'sudo gem update #{gem_name}'.".green
|
14
|
+
puts "# Update using 'sudo gem update #{gem_name.downcase}'.".green
|
15
15
|
puts "# To see what's new, open https://github.com/KrauseFx/#{gem_name}/releases.".green
|
16
16
|
puts '#######################################################################'.green
|
17
17
|
false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 4.1.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: babosa
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: credentials_manager
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -247,11 +261,11 @@ files:
|
|
247
261
|
- lib/fastlane_core/developer_center/developer_center.rb
|
248
262
|
- lib/fastlane_core/developer_center/developer_center_helper.rb
|
249
263
|
- lib/fastlane_core/developer_center/developer_center_login.rb
|
250
|
-
- lib/fastlane_core/developer_center/developer_center_signing_certificates.rb
|
251
264
|
- lib/fastlane_core/helper.rb
|
252
265
|
- lib/fastlane_core/itunes_connect/itunes_connect.rb
|
253
266
|
- lib/fastlane_core/itunes_connect/itunes_connect_helper.rb
|
254
267
|
- lib/fastlane_core/itunes_connect/itunes_connect_login.rb
|
268
|
+
- lib/fastlane_core/itunes_search_api.rb
|
255
269
|
- lib/fastlane_core/languages.rb
|
256
270
|
- lib/fastlane_core/update_checker.rb
|
257
271
|
- lib/fastlane_core/version.rb
|
@@ -1,76 +0,0 @@
|
|
1
|
-
module FastlaneCore
|
2
|
-
class DeveloperCenter
|
3
|
-
# Returns a array of hashes, that contains information about the iOS certificate
|
4
|
-
# @example
|
5
|
-
# [{"certRequestId"=>"B23Q2P396B",
|
6
|
-
# "name"=>"SunApps GmbH",
|
7
|
-
# "statusString"=>"Issued",
|
8
|
-
# "expirationDate"=>"2015-11-25T22:45:50Z",
|
9
|
-
# "expirationDateString"=>"Nov 25, 2015",
|
10
|
-
# "ownerType"=>"team",
|
11
|
-
# "ownerName"=>"SunApps GmbH",
|
12
|
-
# "ownerId"=>"....",
|
13
|
-
# "canDownload"=>true,
|
14
|
-
# "canRevoke"=>true,
|
15
|
-
# "certificateId"=>"....",
|
16
|
-
# "certificateStatusCode"=>0,
|
17
|
-
# "certRequestStatusCode"=>4,
|
18
|
-
# "certificateTypeDisplayId"=>"...",
|
19
|
-
# "serialNum"=>"....",
|
20
|
-
# "typeString"=>"iOS Distribution"},
|
21
|
-
# {another sertificate...}]
|
22
|
-
def code_signing_certificates(type, cert_date)
|
23
|
-
certs_url = "https://developer.apple.com/account/ios/certificate/certificateList.action?type="
|
24
|
-
certs_url << (type == DEVELOPMENT ? 'development' : 'distribution')
|
25
|
-
visit certs_url
|
26
|
-
|
27
|
-
certificateDataURL = wait_for_variable('certificateDataURL')
|
28
|
-
certificateRequestTypes = wait_for_variable('certificateRequestTypes')
|
29
|
-
certificateStatuses = wait_for_variable('certificateStatuses')
|
30
|
-
|
31
|
-
url = [certificateDataURL, certificateRequestTypes, certificateStatuses].join('')
|
32
|
-
|
33
|
-
# https://developer.apple.com/services-account/.../account/ios/certificate/listCertRequests.action?content-type=application/x-www-form-urlencoded&accept=application/json&requestId=...&userLocale=en_US&teamId=...&types=...&status=4&certificateStatus=0&type=distribution
|
34
|
-
|
35
|
-
certs = post_ajax(url)['certRequests']
|
36
|
-
|
37
|
-
ret_certs = []
|
38
|
-
certificate_name = ENV['SIGH_CERTIFICATE']
|
39
|
-
|
40
|
-
# The other profiles are push profiles
|
41
|
-
certificate_type = type == DEVELOPMENT ? 'iOS Development' : 'iOS Distribution'
|
42
|
-
|
43
|
-
# New profiles first
|
44
|
-
certs.sort! do |a, b|
|
45
|
-
Time.parse(b['expirationDate']) <=> Time.parse(a['expirationDate'])
|
46
|
-
end
|
47
|
-
|
48
|
-
certs.each do |current_cert|
|
49
|
-
next unless current_cert['typeString'] == certificate_type
|
50
|
-
|
51
|
-
if cert_date || certificate_name
|
52
|
-
if current_cert['expirationDateString'] == cert_date
|
53
|
-
Helper.log.info "Certificate ID '#{current_cert['certificateId']}' with expiry date '#{current_cert['expirationDateString']}' located"
|
54
|
-
ret_certs << current_cert
|
55
|
-
end
|
56
|
-
if current_cert['name'] == certificate_name
|
57
|
-
Helper.log.info "Certificate ID '#{current_cert['certificateId']}' with name '#{certificate_name}' located"
|
58
|
-
ret_certs << current_cert
|
59
|
-
end
|
60
|
-
else
|
61
|
-
ret_certs << current_cert
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
return ret_certs unless ret_certs.empty?
|
66
|
-
|
67
|
-
predicates = []
|
68
|
-
predicates << "name: #{certificate_name}" if certificate_name
|
69
|
-
predicates << "expiry date: #{cert_date}" if cert_date
|
70
|
-
|
71
|
-
predicates_str = " with #{predicates.join(' or ')}"
|
72
|
-
|
73
|
-
raise "Could not find a Certificate#{predicates_str}. Please open #{current_url} and make sure you have a signing profile created.".red
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|