deliver 0.7.9 → 0.7.10

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: 1b07a0ee400eb4f0fd787f89dcd82cdae154f9b0
4
- data.tar.gz: 1f193523b0161ce57a961a6bb3ec2dc91ff82d7b
3
+ metadata.gz: 945773ee223c9e92da550da88cb48c5c7e4ae892
4
+ data.tar.gz: 2916e3bab546cba726de17b9f0c16ef0f950096f
5
5
  SHA512:
6
- metadata.gz: 737471e5d7eddf7421824f083c22328f8dd9cc92df4d310129cbb051e77f275f66c37e415fb34b901421e2992c26537f5be92fe7c66dd9de5230a1531288e499
7
- data.tar.gz: ec1ac3527e4bdffe336ea763dc9140f14babc87bf937c4cfaa908e5c87271087a7a349d9b0cc9cb20bc56085fabbf8c2b01c6a57789c0d741ad48ebf88e4392c
6
+ metadata.gz: bfe66033b9b3da8127c2b5b6e0be30c7865550b0abdaf8abf8662663b7555d41f37cc103ae51500e032f553b00be67ce0f2d27f5d432d5057d8d13870e7f4b91
7
+ data.tar.gz: 54d4f2f0ef25b1e8ce95755ce42bc230bef70f53be5396f643b5d18902fa6cd1a730bfbf7985e68a2036fd426f52d999cab119b622cfe80f1361ba82fcba4498
data/lib/deliver.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'json'
2
2
  require 'deliver/version'
3
- require 'deliver/helper'
4
3
  require 'deliver/app'
5
4
  require 'deliver/app_metadata'
6
5
  require 'deliver/metadata_item'
@@ -12,18 +11,17 @@ require 'deliver/deliverfile/deliverfile'
12
11
  require 'deliver/deliverfile/deliverfile_creator'
13
12
  require 'deliver/deliverer'
14
13
  require 'deliver/ipa_uploader'
15
- require 'deliver/languages'
16
14
  require 'deliver/pdf_generator'
17
15
  require 'deliver/deliver_process'
18
16
  require 'deliver/dependency_checker'
19
- require 'deliver/update_checker'
20
17
  require 'deliver/ipa_file_analyser'
21
18
  require 'deliver/testflight'
22
19
 
23
- # Third Party code
24
- require 'colored'
20
+ require 'fastlane_core'
25
21
 
26
22
  module Deliver
27
- Deliver::UpdateChecker.verify_latest_version
23
+ Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
24
+
25
+ FastlaneCore::UpdateChecker.verify_latest_version('deliver', Deliver::VERSION)
28
26
  Deliver::DependencyChecker.check_dependencies
29
27
  end
@@ -36,7 +36,7 @@ module Deliver
36
36
 
37
37
  private_constant :METADATA_FILE_NAME, :MAXIMUM_NUMBER_OF_SCREENSHOTS
38
38
 
39
- INVALID_LANGUAGE_ERROR = "The specified language could not be found. Make sure it is available in Deliver::Languages::ALL_LANGUAGES"
39
+ INVALID_LANGUAGE_ERROR = "The specified language could not be found. Make sure it is available in FastlaneCore::Languages::ALL_LANGUAGES"
40
40
 
41
41
  # You don't have to manually create an AppMetadata object. It will
42
42
  # be created when you access the app's metadata ({Deliver::App#metadata})
@@ -83,13 +83,13 @@ module Deliver
83
83
  end
84
84
 
85
85
  # Adds a new locale (language) to the given app
86
- # @param language (Deliver::Languages::ALL_LANGUAGES) the language you want to
86
+ # @param language (FastlaneCore::Languages::ALL_LANGUAGES) the language you want to
87
87
  # this app
88
88
  # @raise (AppMetadataParameterError) Is thrown when don't pass a correct hash with correct language codes.
89
89
  # @return (Bool) Is true, if the language was created. False, when the language alreade existed
90
90
  def add_new_locale(language)
91
- unless Deliver::Languages::ALL_LANGUAGES.include?language
92
- raise "Language '#{language}' is invalid. It must be in #{Deliver::Languages::ALL_LANGUAGES}."
91
+ unless FastlaneCore::Languages::ALL_LANGUAGES.include?language
92
+ raise "Language '#{language}' is invalid. It must be in #{FastlaneCore::Languages::ALL_LANGUAGES}."
93
93
  end
94
94
 
95
95
  if information[language] != nil
@@ -126,7 +126,7 @@ module Deliver
126
126
  #####################################################
127
127
 
128
128
  # Updates the app title
129
- # @param (Hash) hash The hash should contain the correct language codes ({Deliver::Languages})
129
+ # @param (Hash) hash The hash should contain the correct language codes ({FastlaneCore::Languages})
130
130
  # as keys.
131
131
  # @raise (AppMetadataParameterError) Is thrown when don't pass a correct hash with correct language codes.
132
132
  def update_title(hash)
@@ -134,7 +134,7 @@ module Deliver
134
134
  end
135
135
 
136
136
  # Updates the app description which is shown in the AppStore
137
- # @param (Hash) hash The hash should contain the correct language codes ({Deliver::Languages})
137
+ # @param (Hash) hash The hash should contain the correct language codes ({FastlaneCore::Languages})
138
138
  # as keys.
139
139
  # @raise (AppMetadataParameterError) Is thrown when don't pass a correct hash with correct language codes.
140
140
  def update_description(hash)
@@ -142,7 +142,7 @@ module Deliver
142
142
  end
143
143
 
144
144
  # Updates the app changelog of the latest version
145
- # @param (Hash) hash The hash should contain the correct language codes ({Deliver::Languages})
145
+ # @param (Hash) hash The hash should contain the correct language codes ({FastlaneCore::Languages})
146
146
  # as keys.
147
147
  # @raise (AppMetadataParameterError) Is thrown when don't pass a correct hash with correct language codes.
148
148
  def update_changelog(hash)
@@ -150,7 +150,7 @@ module Deliver
150
150
  end
151
151
 
152
152
  # Updates the Marketing URL
153
- # @param (Hash) hash The hash should contain the correct language codes ({Deliver::Languages})
153
+ # @param (Hash) hash The hash should contain the correct language codes ({FastlaneCore::Languages})
154
154
  # as keys.
155
155
  # @raise (AppMetadataParameterError) Is thrown when don't pass a correct hash with correct language codes.
156
156
  def update_marketing_url(hash)
@@ -158,7 +158,7 @@ module Deliver
158
158
  end
159
159
 
160
160
  # Updates the Support URL
161
- # @param (Hash) hash The hash should contain the correct language codes ({Deliver::Languages})
161
+ # @param (Hash) hash The hash should contain the correct language codes ({FastlaneCore::Languages})
162
162
  # as keys.
163
163
  # @raise (AppMetadataParameterError) Is thrown when don't pass a correct hash with correct language codes.
164
164
  def update_support_url(hash)
@@ -166,7 +166,7 @@ module Deliver
166
166
  end
167
167
 
168
168
  # Updates the Privacy URL
169
- # @param (Hash) hash The hash should contain the correct language codes ({Deliver::Languages})
169
+ # @param (Hash) hash The hash should contain the correct language codes ({FastlaneCore::Languages})
170
170
  # as keys.
171
171
  # @raise (AppMetadataParameterError) Is thrown when don't pass a correct hash with correct language codes.
172
172
  def update_privacy_url(hash)
@@ -174,7 +174,7 @@ module Deliver
174
174
  end
175
175
 
176
176
  # Updates the app keywords
177
- # @param (Hash) hash The hash should contain the correct language codes ({Deliver::Languages})
177
+ # @param (Hash) hash The hash should contain the correct language codes ({FastlaneCore::Languages})
178
178
  # as keys. The value should be an array of keywords (each keyword is a string)
179
179
  # @raise (AppMetadataParameterError) Is thrown when don't pass a correct hash with correct language codes.
180
180
  def update_keywords(hash)
@@ -272,7 +272,7 @@ module Deliver
272
272
 
273
273
  locale = fetch_value("//x:locale[@name='#{language}']").first
274
274
 
275
- raise AppMetadataParameterError.new("#{INVALID_LANGUAGE_ERROR} (#{language})") unless Languages::ALL_LANGUAGES.include?language
275
+ raise AppMetadataParameterError.new("#{INVALID_LANGUAGE_ERROR} (#{language})") unless FastlaneCore::Languages::ALL_LANGUAGES.include?language
276
276
 
277
277
 
278
278
  field = locale.search(xpath_name).first
@@ -5,9 +5,9 @@ module Deliver
5
5
  #####################################################
6
6
 
7
7
  # Removes all currently enabled screenshots for the given language.
8
- # @param (String) language The language, which has to be in this list: {Deliver::Languages}.
8
+ # @param (String) language The language, which has to be in this list: {FastlaneCore::Languages}.
9
9
  def clear_all_screenshots(language)
10
- raise AppMetadataParameterError.new(INVALID_LANGUAGE_ERROR) unless Languages::ALL_LANGUAGES.include?language
10
+ raise AppMetadataParameterError.new(INVALID_LANGUAGE_ERROR) unless FastlaneCore::Languages::ALL_LANGUAGES.include?language
11
11
 
12
12
  update_localized_value('software_screenshots', {language => {}}) do |field, useless, language|
13
13
  field.children.remove # remove all the screenshots
@@ -17,12 +17,12 @@ module Deliver
17
17
  end
18
18
 
19
19
  # Appends another screenshot to the already existing ones
20
- # @param (String) language The language, which has to be in this list: {Deliver::Languages}.
20
+ # @param (String) language The language, which has to be in this list: {FastlaneCore::Languages}.
21
21
  # @param (Deliver::AppScreenshot) app_screenshot The screenshot you want to add to the app metadata.
22
22
  # @raise (AppMetadataTooManyScreenshotsError) When there are already 5 screenshots (MAXIMUM_NUMBER_OF_SCREENSHOTS).
23
23
 
24
24
  def add_screenshot(language, app_screenshot)
25
- raise AppMetadataParameterError.new(INVALID_LANGUAGE_ERROR) unless Languages::ALL_LANGUAGES.include?language
25
+ raise AppMetadataParameterError.new(INVALID_LANGUAGE_ERROR) unless FastlaneCore::Languages::ALL_LANGUAGES.include?language
26
26
 
27
27
  create_locale_if_not_exists(language)
28
28
 
@@ -100,14 +100,14 @@ module Deliver
100
100
  # This method will automatically detect which device type each screenshot is.
101
101
  #
102
102
  # This will also clear all existing screenshots before setting the new ones.
103
- # @param (Hash) hash A hash containing a different path for each locale ({Deliver::Languages::ALL_LANGUAGES})
103
+ # @param (Hash) hash A hash containing a different path for each locale ({FastlaneCore::Languages::ALL_LANGUAGES})
104
104
  def set_screenshots_for_each_language(hash)
105
105
  raise AppMetadataParameterError.new("Parameter needs to be an hash, containg strings with the new description") unless hash.kind_of?Hash
106
106
 
107
107
  hash.each do |language, current_path|
108
108
  resulting_path = "#{current_path}/**/*.{png,jpg,jpeg}"
109
109
 
110
- raise AppMetadataParameterError.new(INVALID_LANGUAGE_ERROR) unless Languages::ALL_LANGUAGES.include?language
110
+ raise AppMetadataParameterError.new(INVALID_LANGUAGE_ERROR) unless FastlaneCore::Languages::ALL_LANGUAGES.include?language
111
111
 
112
112
  # https://stackoverflow.com/questions/21688855/
113
113
  # File::FNM_CASEFOLD = ignore case
@@ -138,7 +138,7 @@ module Deliver
138
138
  raise AppMetadataParameterError.new("Parameter needs to be a path (string)") unless path.kind_of?String
139
139
 
140
140
  found = false
141
- Deliver::Languages::ALL_LANGUAGES.each do |language|
141
+ FastlaneCore::Languages::ALL_LANGUAGES.each do |language|
142
142
  full_path = path + "/#{language}"
143
143
  if File.directory?(full_path)
144
144
  found = true
@@ -40,6 +40,7 @@ module Deliver
40
40
  # @param path (String) The exact path (including the file name) in which the Deliverfile should be created
41
41
  # @param project_name (String) The default name of the project, which is used in the generated Deliverfile
42
42
  def self.create_example_deliver_file(path, project_name)
43
+ gem_path = Helper.gem_path('deliver')
43
44
  example = File.read("#{gem_path}/lib/assets/DeliverfileExample")
44
45
  example.gsub!("[[APP_NAME]]", project_name)
45
46
  File.write(path, example)
@@ -66,14 +67,6 @@ module Deliver
66
67
  end
67
68
 
68
69
  private
69
- def self.gem_path
70
- if not Helper.is_test? and Gem::Specification::find_all_by_name('deliver').any?
71
- return Gem::Specification.find_by_name('deliver').gem_dir
72
- else
73
- return './'
74
- end
75
- end
76
-
77
70
  # This method takes care of creating a new 'deliver' folder, containg the app metadata
78
71
  # and screenshots folders
79
72
  def self.generate_deliver_file(app, path, project_name)
@@ -90,6 +83,8 @@ module Deliver
90
83
  File.write(meta_path, JSON.pretty_generate(json))
91
84
  puts "Successfully created new metadata JSON file at '#{meta_path}'".green
92
85
 
86
+ gem_path = Helper.gem_path('deliver')
87
+
93
88
  # Add a README to the screenshots folder
94
89
  File.write("#{metadata_path}screenshots/README.txt", File.read("#{gem_path}/lib/assets/ScreenshotsHelp"))
95
90
 
@@ -66,7 +66,7 @@ module Deliver
66
66
  # This is approach only is recommend for deployments where you are only
67
67
  # supporting one language.
68
68
  #
69
- # The language itself must be included in {Deliver::Languages::ALL_LANGUAGES}.
69
+ # The language itself must be included in {FastlaneCore::Languages::ALL_LANGUAGES}.
70
70
  # @example
71
71
  # default_language 'en-US'
72
72
  # @example
@@ -1,74 +1,13 @@
1
- require 'capybara'
2
- require 'capybara/poltergeist'
3
- require 'fastimage'
4
- require 'credentials_manager/password_manager'
5
- require 'phantomjs/poltergeist'
1
+ require 'fastlane_core/itunes_connect/itunes_connect'
6
2
 
7
3
  # Import all the actions
8
4
  require 'deliver/itunes_connect/itunes_connect_submission'
9
5
  require 'deliver/itunes_connect/itunes_connect_reader'
10
- require 'deliver/itunes_connect/itunes_connect_helper'
11
6
  require 'deliver/itunes_connect/itunes_connect_new_version'
12
- require 'deliver/itunes_connect/itunes_connect_login'
13
7
  require 'deliver/itunes_connect/itunes_connect_app_icon'
14
8
  require 'deliver/itunes_connect/itunes_connect_app_rating'
15
9
  require 'deliver/itunes_connect/itunes_connect_additional'
16
10
 
17
11
  module Deliver
18
- # Everything that can't be achived using the {Deliver::ItunesTransporter}
19
- # will be scripted using the iTunesConnect frontend.
20
- #
21
- # Every method you call here, might take a time
22
- class ItunesConnect
23
- # This error occurs only if there is something wrong with the given login data
24
- class ItunesConnectLoginError < StandardError
25
- end
26
-
27
- # This error can occur for many reaons. It is
28
- # usually raised when a UI element could not be found
29
- class ItunesConnectGeneralError < StandardError
30
- end
31
-
32
- include Capybara::DSL
33
-
34
- ITUNESCONNECT_URL = "https://itunesconnect.apple.com/"
35
- APP_DETAILS_URL = "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/[[app_id]]"
36
-
37
- BUTTON_STRING_NEW_VERSION = "New Version"
38
- BUTTON_STRING_SUBMIT_FOR_REVIEW = "Submit for Review"
39
- BUTTON_ADD_NEW_BUILD = 'Click + to add a build before you submit your app.'
40
-
41
- WAITING_FOR_REVIEW = "Waiting For Review"
42
- PROCESSING_TEXT = "Processing"
43
-
44
- def initialize
45
- super
46
-
47
- return if Helper.is_test?
48
-
49
- DependencyChecker.check_dependencies
50
-
51
- Capybara.run_server = false
52
- Capybara.default_driver = :poltergeist
53
- Capybara.javascript_driver = :poltergeist
54
- Capybara.current_driver = :poltergeist
55
- Capybara.app_host = ITUNESCONNECT_URL
56
-
57
- # Since Apple has some SSL errors, we have to configure the client properly:
58
- # https://github.com/ariya/phantomjs/issues/11239
59
- Capybara.register_driver :poltergeist do |a|
60
- conf = ['--debug=no', '--ignore-ssl-errors=yes', '--ssl-protocol=TLSv1']
61
- Capybara::Poltergeist::Driver.new(a, {
62
- phantomjs: Phantomjs.path,
63
- phantomjs_options: conf,
64
- phantomjs_logger: File.open("/tmp/poltergeist_log.txt", "a"),
65
- js_errors: false
66
- })
67
- end
68
-
69
- page.driver.headers = { "Accept-Language" => "en" }
70
-
71
- login
72
- end
73
- end
74
- end
12
+ ItunesConnect = FastlaneCore::ItunesConnect
13
+ end
@@ -1,4 +1,4 @@
1
- module Deliver
1
+ module FastlaneCore
2
2
  class ItunesConnect
3
3
  # This file sets additional information like copyright and age rating
4
4
 
@@ -1,6 +1,6 @@
1
1
  require 'fastimage'
2
2
 
3
- module Deliver
3
+ module FastlaneCore
4
4
  class ItunesConnect
5
5
  # Uploading a new full size app icon
6
6
 
@@ -14,7 +14,7 @@ module Deliver
14
14
  # Remove alpha channel
15
15
  Helper.log.info "Removing alpha channel from provided App Icon (iTunes Connect requirement)".green
16
16
 
17
- `sips -s format bmp '#{path}' &> /dev/null ` # &> /dev/null because there is warning because of the extension
17
+ `sips -s format bmp '#{path}' &> /dev/null ` # &> /dev/null since there is warning because of the extension
18
18
  `sips -s format png '#{path}'`
19
19
 
20
20
  begin
@@ -1,6 +1,6 @@
1
1
  require 'json'
2
2
 
3
- module Deliver
3
+ module FastlaneCore
4
4
  class ItunesConnect
5
5
  # Setting the app's age restrictions
6
6
 
@@ -1,4 +1,4 @@
1
- module Deliver
1
+ module FastlaneCore
2
2
  class ItunesConnect
3
3
  # This method creates a new version of your app using the
4
4
  # iTunesConnect frontend. This will happen directly after calling
@@ -1,4 +1,4 @@
1
- module Deliver
1
+ module FastlaneCore
2
2
  # For all the information reading (e.g. version number)
3
3
  class ItunesConnect
4
4
  # This method will fetch the current status ({Deliver::App::AppStatus})
@@ -17,14 +17,14 @@ module Deliver
17
17
  if page.has_content?WAITING_FOR_REVIEW
18
18
  # That's either Upload Received or Waiting for Review
19
19
  if page.has_content?"To submit a new build, you must remove this version from review"
20
- return App::AppStatus::WAITING_FOR_REVIEW
20
+ return Deliver::App::AppStatus::WAITING_FOR_REVIEW
21
21
  else
22
- return App::AppStatus::UPLOAD_RECEIVED
22
+ return Deliver::App::AppStatus::UPLOAD_RECEIVED
23
23
  end
24
24
  elsif page.has_content?BUTTON_STRING_NEW_VERSION
25
- return App::AppStatus::READY_FOR_SALE
25
+ return Deliver::App::AppStatus::READY_FOR_SALE
26
26
  elsif page.has_content?BUTTON_STRING_SUBMIT_FOR_REVIEW
27
- return App::AppStatus::PREPARE_FOR_SUBMISSION
27
+ return Deliver::App::AppStatus::PREPARE_FOR_SUBMISSION
28
28
  else
29
29
  raise "App status not yet implemented"
30
30
  end
@@ -1,6 +1,7 @@
1
- module Deliver
1
+ module FastlaneCore
2
2
  # Everything related to submitting the app
3
3
  class ItunesConnect
4
+ BUTTON_ADD_NEW_BUILD = 'Click + to add a build before you submit your app.'
4
5
 
5
6
  # This will put the latest uploaded build as a new beta build
6
7
  def put_build_into_beta_testing!(app, version_number)
@@ -1,3 +1,3 @@
1
1
  module Deliver
2
- VERSION = "0.7.9"
2
+ VERSION = "0.7.10"
3
3
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deliver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.9
4
+ version: 0.7.10
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-12 00:00:00.000000000 Z
11
+ date: 2015-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: json
14
+ name: fastlane_core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - '>='
@@ -24,34 +24,6 @@ dependencies:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: multi_json
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: highline
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: 1.6.21
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: 1.6.21
55
27
  - !ruby/object:Gem::Dependency
56
28
  name: nokogiri
57
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,34 +80,6 @@ dependencies:
108
80
  - - ~>
109
81
  - !ruby/object:Gem::Version
110
82
  version: 3.1.0
111
- - !ruby/object:Gem::Dependency
112
- name: colored
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - '>='
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - '>='
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: commander
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ~>
130
- - !ruby/object:Gem::Version
131
- version: '4'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ~>
137
- - !ruby/object:Gem::Version
138
- version: '4'
139
83
  - !ruby/object:Gem::Dependency
140
84
  name: prawn
141
85
  requirement: !ruby/object:Gem::Requirement
@@ -150,62 +94,6 @@ dependencies:
150
94
  - - '>='
151
95
  - !ruby/object:Gem::Version
152
96
  version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: credentials_manager
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - '>='
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :runtime
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - '>='
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: phantomjs
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ~>
172
- - !ruby/object:Gem::Version
173
- version: 1.9.8
174
- type: :runtime
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ~>
179
- - !ruby/object:Gem::Version
180
- version: 1.9.8
181
- - !ruby/object:Gem::Dependency
182
- name: capybara
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ~>
186
- - !ruby/object:Gem::Version
187
- version: 2.4.3
188
- type: :runtime
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ~>
193
- - !ruby/object:Gem::Version
194
- version: 2.4.3
195
- - !ruby/object:Gem::Dependency
196
- name: poltergeist
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ~>
200
- - !ruby/object:Gem::Version
201
- version: 1.5.1
202
- type: :runtime
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ~>
207
- - !ruby/object:Gem::Version
208
- version: 1.5.1
209
97
  - !ruby/object:Gem::Dependency
210
98
  name: bundler
211
99
  requirement: !ruby/object:Gem::Requirement
@@ -332,25 +220,20 @@ files:
332
220
  - lib/deliver/deliverfile/deliverfile_creator.rb
333
221
  - lib/deliver/deliverfile/dsl.rb
334
222
  - lib/deliver/dependency_checker.rb
335
- - lib/deliver/helper.rb
336
223
  - lib/deliver/ipa_file_analyser.rb
337
224
  - lib/deliver/ipa_uploader.rb
338
225
  - lib/deliver/itunes_connect/itunes_connect.rb
339
226
  - lib/deliver/itunes_connect/itunes_connect_additional.rb
340
227
  - lib/deliver/itunes_connect/itunes_connect_app_icon.rb
341
228
  - lib/deliver/itunes_connect/itunes_connect_app_rating.rb
342
- - lib/deliver/itunes_connect/itunes_connect_helper.rb
343
- - lib/deliver/itunes_connect/itunes_connect_login.rb
344
229
  - lib/deliver/itunes_connect/itunes_connect_new_version.rb
345
230
  - lib/deliver/itunes_connect/itunes_connect_reader.rb
346
231
  - lib/deliver/itunes_connect/itunes_connect_submission.rb
347
232
  - lib/deliver/itunes_search_api.rb
348
233
  - lib/deliver/itunes_transporter.rb
349
- - lib/deliver/languages.rb
350
234
  - lib/deliver/metadata_item.rb
351
235
  - lib/deliver/pdf_generator.rb
352
236
  - lib/deliver/testflight.rb
353
- - lib/deliver/update_checker.rb
354
237
  - lib/deliver/version.rb
355
238
  homepage: http://fastlane.tools
356
239
  licenses:
@@ -1,60 +0,0 @@
1
- require 'logger'
2
-
3
- module Deliver
4
- module Helper
5
-
6
- # Logging happens using this method
7
- def self.log
8
- if is_test?
9
- @@log ||= Logger.new(nil) # don't show any logs when running tests
10
- else
11
- @@log ||= Logger.new(STDOUT)
12
- end
13
-
14
- @@log.formatter = proc do |severity, datetime, progname, msg|
15
- string = "#{severity} [#{datetime.strftime('%Y-%m-%d %H:%M:%S.%2N')}]: "
16
- second = "#{msg}\n"
17
-
18
- if severity == "DEBUG"
19
- string = string.magenta
20
- elsif severity == "INFO"
21
- string = string.white
22
- elsif severity == "WARN"
23
- string = string.yellow
24
- elsif severity == "ERROR"
25
- string = string.red
26
- elsif severity == "FATAL"
27
- string = string.red.bold
28
- end
29
-
30
-
31
- [string, second].join("")
32
- end
33
-
34
- @@log
35
- end
36
-
37
- # @return true if the currently running program is a unit test
38
- def self.is_test?
39
- defined?SpecHelper
40
- end
41
-
42
- # @return the full path to the Xcode developer tools of the currently
43
- # running system
44
- def self.xcode_path
45
- return "" if self.is_test? and not OS.mac?
46
- `xcode-select -p`.gsub("\n", '') + "/"
47
- end
48
-
49
- # @return the full path to the iTMSTransporter executable
50
- def self.transporter_path
51
- self.xcode_path + '../Applications/Application\ Loader.app/Contents/MacOS/itms/bin/iTMSTransporter'
52
- end
53
-
54
- def self.fastlane_enabled?
55
- # This is called from the root context on the first start
56
- @@enabled ||= File.directory?"./fastlane"
57
- end
58
-
59
- end
60
- end
@@ -1,82 +0,0 @@
1
- module Deliver
2
- class ItunesConnect
3
- # All the private helpers
4
- private
5
- # Opens the app details page of the given app.
6
- # @param app (Deliver::App) the app that should be opened
7
- # @return (bool) true if everything worked fine
8
- # @raise [ItunesConnectGeneralError] General error while executing
9
- # this action
10
- # @raise [ItunesConnectLoginError] Login data is wrong
11
- def open_app_page(app)
12
- verify_app(app)
13
-
14
- Helper.log.info "Opening detail page for app #{app}"
15
-
16
- visit APP_DETAILS_URL.gsub("[[app_id]]", app.apple_id.to_s)
17
-
18
- wait_for_elements('.page-subnav')
19
- sleep 5
20
-
21
- if current_url.include?"wa/defaultError" # app could not be found
22
- raise "Could not open app details for app '#{app}'. Make sure you're using the correct Apple ID and the correct Apple developer account (#{CredentialsManager::PasswordManager.shared_manager.username}).".red
23
- end
24
-
25
- true
26
- rescue => ex
27
- error_occured(ex)
28
- end
29
-
30
-
31
- def verify_app(app)
32
- raise ItunesConnectGeneralError.new("No valid Deliver::App given") unless app.kind_of?Deliver::App
33
- raise ItunesConnectGeneralError.new("App is missing information (apple_id not given)") unless (app.apple_id || '').to_s.length > 5
34
- end
35
-
36
- def error_occured(ex)
37
- snap
38
- raise ex # re-raise the error after saving the snapshot
39
- end
40
-
41
- def snap
42
- path = "Error#{Time.now.to_i}.png"
43
- save_screenshot(path, :full => true)
44
- system("open '#{path}'")
45
- end
46
-
47
- # Since Apple takes for ages, after the upload is properly processed, we have to wait here
48
- def wait_for_preprocessing
49
- started = Time.now
50
-
51
- # Wait, while iTunesConnect is processing the uploaded file
52
- while (page.has_content?"Uploaded")
53
- # iTunesConnect is super slow... so we have to wait...
54
- Helper.log.info("Sorry, we have to wait for iTunesConnect, since it's still processing the uploaded ipa file\n" +
55
- "If this takes longer than 45 minutes, you have to re-upload the ipa file again.\n" +
56
- "You can always open the browser page yourself: '#{current_url}'\n" +
57
- "Passed time: ~#{((Time.now - started) / 60.0).to_i} minute(s)")
58
- sleep 60
59
- visit current_url
60
- sleep 10
61
- end
62
- end
63
-
64
- def wait_for_elements(name)
65
- counter = 0
66
- results = all(name)
67
- while results.count == 0
68
- # Helper.log.debug "Waiting for #{name}"
69
- sleep 0.2
70
-
71
- results = all(name)
72
-
73
- counter += 1
74
- if counter > 100
75
- Helper.log.debug caller
76
- raise ItunesConnectGeneralError.new("Couldn't find element '#{name}' after waiting for quite some time")
77
- end
78
- end
79
- return results
80
- end
81
- end
82
- end
@@ -1,61 +0,0 @@
1
- module Deliver
2
- # Login code
3
- class ItunesConnect
4
- # Loggs in a user with the given login data on the iTC Frontend.
5
- # You don't need to pass a username and password. It will
6
- # Automatically be fetched using the {CredentialsManager::PasswordManager}.
7
- # This method will also automatically be called when triggering other
8
- # actions like {#open_app_page}
9
- # @param user (String) (optional) The username/email address
10
- # @param password (String) (optional) The password
11
- # @return (bool) true if everything worked fine
12
- # @raise [ItunesConnectGeneralError] General error while executing
13
- # this action
14
- # @raise [ItunesConnectLoginError] Login data is wrong
15
- def login(user = nil, password = nil)
16
- Helper.log.info "Logging into iTunesConnect"
17
-
18
- user ||= CredentialsManager::PasswordManager.shared_manager.username
19
- password ||= CredentialsManager::PasswordManager.shared_manager.password
20
-
21
- result = visit ITUNESCONNECT_URL
22
- raise "Could not open iTunesConnect" unless result['status'] == 'success'
23
-
24
- sleep 3
25
-
26
- if page.has_content?"My Apps"
27
- # Already logged in
28
- return true
29
- end
30
-
31
- begin
32
- wait_for_elements('#accountpassword')
33
- rescue => ex
34
- # when the user is already logged in, this will raise an exception
35
- end
36
-
37
- fill_in "accountname", with: user
38
- fill_in "accountpassword", with: password
39
-
40
- begin
41
- (wait_for_elements(".enabled").first.click rescue nil) # Login Button
42
- wait_for_elements('.homepageWrapper.ng-scope')
43
-
44
- if page.has_content?"My Apps"
45
- # Everything looks good
46
- else
47
- raise ItunesConnectLoginError.new("Looks like your login data was correct, but you do not have access to the apps.")
48
- end
49
- rescue => ex
50
- Helper.log.debug(ex)
51
- raise ItunesConnectLoginError.new("Error logging in user #{user} with the given password. Make sure you entered them correctly.")
52
- end
53
-
54
- Helper.log.info "Successfully logged into iTunesConnect"
55
-
56
- true
57
- rescue => ex
58
- error_occured(ex)
59
- end
60
- end
61
- end
@@ -1,6 +0,0 @@
1
- module Deliver
2
- module Languages
3
- # These are all the languages which are available to use to upload app metadata and screenshots
4
- ALL_LANGUAGES = ["da-DK", "de-DE", "el-GR", "en-AU", "en-CA", "en-GB", "en-US", "es-ES", "es-MX", "fi-FI", "fr-CA", "fr-FR", "id-ID", "it-IT", "ja-JP", "ko-KR", "ms-MY", "nl-NL", "no-NO", "pt-BR", "pt-PT", "ru-RU", "sv-SE", "th-TH", "tr-TR", "vi-VI", "cmn-Hans", "zh_CN", "cmn-Hant"]
5
- end
6
- end
@@ -1,44 +0,0 @@
1
- require 'open-uri'
2
-
3
- module Deliver
4
- # Verifies, the user runs the latest version of this gem
5
- class UpdateChecker
6
- # This method will check if the latest version is installed and show a warning if that's not the case
7
- def self.verify_latest_version
8
- if self.update_available?
9
- v = fetch_latest
10
- puts '#######################################################################'.green
11
- puts "# Deliver #{v} is available.".green
12
- puts "# It is recommended to use the latest version.".green
13
- puts "# Update using '(sudo) gem update deliver'.".green
14
- puts "# To see what's new, open https://github.com/KrauseFx/deliver/releases.".green
15
- puts '#######################################################################'.green
16
- return true
17
- end
18
- false
19
- end
20
-
21
- # Is a new official release available (this does not include pre-releases)
22
- def self.update_available?
23
- begin
24
- latest = fetch_latest
25
- if latest and Gem::Version.new(latest) > Gem::Version.new(current_version)
26
- return true
27
- end
28
- rescue => ex
29
- Helper.log.error("Could not check if 'deliver' is up to date.")
30
- end
31
- return false
32
- end
33
-
34
- # The currently used version of this gem
35
- def self.current_version
36
- Deliver::VERSION
37
- end
38
-
39
- private
40
- def self.fetch_latest
41
- JSON.parse(open("http://rubygems.org/api/v1/gems/deliver.json").read)["version"]
42
- end
43
- end
44
- end