deliver 0.3.6 → 0.3.7.beta1

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: 29a8cd17091cc3b85709b9dce0f5b0ea6457320c
4
- data.tar.gz: 6d361bbaba3f7908fc1e15fe8547853f53060461
3
+ metadata.gz: c0c8e78d1a6ebb13df0846c007e5451ceea0ab83
4
+ data.tar.gz: c52cb37533409e84d2aa002a2b0a7e20efc4396b
5
5
  SHA512:
6
- metadata.gz: aed7ccb0a4cf68b1f272bcff55d8ac21bc9a88c6d974537af8db171901f4a8f1f54cf973036182cea730d926df634a7f962acf7af9977546c1f272ff815b0450
7
- data.tar.gz: 4bab9b894e31591d2a4ed1bda8c12a3df733203f82d6453a8076ec7aa6b8fa478a537ba6c05200cb5943c21ff4930aa8a4ba204e0b5329e2df402974bc768cd4
6
+ metadata.gz: 492eca241565072da82291e80c1f22450b29494db1c36955600195dfd2efbac7d6dfe8575fb4868bb71930afe5c853bf9f8ec620121efa0aa753a5b395a7e778
7
+ data.tar.gz: 3e02ab4bdfdf9bf014a1a11ff37c9a3bd85818cbc136905b9d0e8edc30d173bd871a9adce7317e497a74964e1060f6950ac9c3921f69981abff2539ac62492cc
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  <p align="center">
2
2
  <b>Deliver</b> &bull;
3
3
  <a href="https://github.com/KrauseFx/snapshot">Snapshot</a> &bull;
4
- <a href="https://github.com/KrauseFx/frameit">FrameIt</a>
4
+ <a href="https://github.com/KrauseFx/frameit">FrameIt</a> &bull;
5
+ <a href="https://github.com/KrauseFx/PEM">PEM</a> &bull;
6
+ <a href="https://github.com/KrauseFx/sigh">Sigh</a>
5
7
  </p>
6
8
  -------
7
9
 
@@ -27,14 +29,16 @@ Follow the developer on Twitter: [@KrauseFx](https://twitter.com/KrauseFx)
27
29
 
28
30
 
29
31
  -------
30
- [Features](#features) &bull;
31
- [Installation](#installation) &bull;
32
- [Quick Start](#quick-start) &bull;
33
- [Usage](#usage) &bull;
34
- [Credentials](#credentials) &bull;
35
- [Can I trust Deliver?](#can-i-trust-deliver) &bull;
36
- [Tips](#tips) &bull;
37
- [Need help?](#need-help)
32
+ <p align="center">
33
+ <a href="#features">Features</a> &bull;
34
+ <a href="#installation">Installation</a> &bull;
35
+ <a href="#quick-start">Quick Start</a> &bull;
36
+ <a href="#usage">Usage</a> &bull;
37
+ <a href="#credentials">Credentials</a> &bull;
38
+ <a href="#can-i-trust-deliver">Can I trust Deliver?</a> &bull;
39
+ <a href="#tips">Tips</a> &bull;
40
+ <a href="#need-help">Need help?</a>
41
+ </p>
38
42
 
39
43
  -------
40
44
 
@@ -62,7 +66,7 @@ Install phantomjs (this is needed to control the iTunes Connect frontend)
62
66
 
63
67
  brew update && brew install phantomjs
64
68
 
65
- If you don't have homebrew installed already, [install it here](http://brew.sh/).
69
+ If you don't already have homebrew installed, [install it here](http://brew.sh/).
66
70
 
67
71
  To create new screenshots automatically, check out my other open source project [Snapshot](https://github.com/KrauseFx/snapshot).
68
72
 
@@ -260,6 +264,15 @@ Before actually uploading anything to iTunes, ```Deliver``` will generate a [PDF
260
264
  - The iTunes search API to find missing information about a certain app, like the *apple_id* when you only pass the *bundle_identifier*.
261
265
 
262
266
  # Tips
267
+
268
+ ## Other helpful tools
269
+ Check out other tools in this collection to speed up your deployment process:
270
+ - [```snapshot```](https://github.com/KrauseFx/snapshot): Create hundreds of screenshots of your iPhone app... while doing something else.
271
+ - [```frameit```](https://github.com/KrauseFx/frameit): Want a device frame around your screenshot? Do it in an instant!
272
+ - [```PEM```](https://github.com/KrauseFx/pem): Tired of manually creating and maintaining your push certification profiles?
273
+ - [```sigh```](https://github.com/KrauseFx/sigh): Because you would rather spend your time building stuff than fighting provisioning.
274
+
275
+
263
276
  ## Available language codes
264
277
  ```ruby
265
278
  ["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"]
@@ -277,6 +290,7 @@ You can easily create screenshots completely automatically in the background usi
277
290
  - Run ```snapshot init``` in your project folder
278
291
  - You can edit the new ```snapshot.js``` file with your UI Automation code
279
292
  - Run ```snapshot``` to test if the screenshots work as expected
293
+ - Remove the line ```screenshot_folder``` from your ```Deliverfile``` to automatically create new screenshots for each deployment.
280
294
 
281
295
  From now on, when you start ```deliver```, it will first create the new screenshots for you, which then will be uploaded to iTunes Connect.
282
296
 
@@ -1,9 +1,9 @@
1
1
  require 'nokogiri'
2
2
 
3
3
  module Deliver
4
- class AppMetadataError < StandardError
4
+ class AppMetadataError < StandardError
5
5
  end
6
- class AppMetadataParameterError < StandardError
6
+ class AppMetadataParameterError < StandardError
7
7
  end
8
8
 
9
9
  class AppMetadata
@@ -40,7 +40,7 @@ module Deliver
40
40
  # @param app [Deliver::App] The app this metadata is from/for
41
41
  # @param dir [String] The app this metadata is from/for
42
42
  # @param redownload_package [bool] When true
43
- # the current package will be downloaded from iTC before you can
43
+ # the current package will be downloaded from iTC before you can
44
44
  # modify any values. This should only be false for unit tests
45
45
  # @raise (AppMetadataParameterError) Is thrown when don't pass a correct app object
46
46
  def initialize(app, dir, redownload_package = true)
@@ -93,10 +93,10 @@ module Deliver
93
93
  Helper.log.info("Locale '#{language}' already exists. Can not create it again.")
94
94
  return false
95
95
  end
96
-
96
+
97
97
 
98
98
  locales = fetch_value("//x:locales").first
99
-
99
+
100
100
  new_locale = @data.create_element('locale')
101
101
  new_locale['name'] = language
102
102
  locales << new_locale
@@ -110,7 +110,7 @@ module Deliver
110
110
 
111
111
  Helper.log.info("Successfully created the new locale '#{language}'. The default title '#{default_title}' was set, since it's required by iTunesConnect.")
112
112
  Helper.log.info("You can update the title using 'app.metadata.update_title'")
113
-
113
+
114
114
  information[language] ||= {}
115
115
  information[language][:title] = { value: default_title, modified: true}
116
116
 
@@ -218,14 +218,14 @@ module Deliver
218
218
 
219
219
  def add_screenshot(language, app_screenshot)
220
220
  raise AppMetadataParameterError.new(INVALID_LANGUAGE_ERROR) unless Languages::ALL_LANGUAGES.include?language
221
-
221
+
222
222
  create_locale_if_not_exists(language)
223
223
 
224
224
  # Fetch the 'software_screenshots' node (array) for the specific locale
225
225
  locales = self.fetch_value("//x:locale[@name='#{language}']")
226
226
 
227
227
  screenshots = self.fetch_value("//x:locale[@name='#{language}']/x:software_screenshots").first
228
-
228
+
229
229
  if not screenshots or screenshots.children.count == 0
230
230
  screenshots.remove if screenshots
231
231
 
@@ -277,7 +277,7 @@ module Deliver
277
277
 
278
278
  new_screenshots.each do |key, value|
279
279
  if key.kind_of?String and value.kind_of?Array and value.count > 0 and value.first.kind_of?AppScreenshot
280
-
280
+
281
281
  self.clear_all_screenshots(key)
282
282
 
283
283
  value.each do |screen|
@@ -291,24 +291,24 @@ module Deliver
291
291
  end
292
292
 
293
293
  # Automatically add all screenshots contained in the given directory to the app.
294
- #
294
+ #
295
295
  # This method will automatically detect which device type each screenshot is.
296
- #
296
+ #
297
297
  # This will also clear all existing screenshots before setting the new ones.
298
298
  # @param (Hash) hash A hash containing a different path for each locale ({Deliver::Languages::ALL_LANGUAGES})
299
299
  def set_screenshots_for_each_language(hash)
300
300
  raise AppMetadataParameterError.new("Parameter needs to be an hash, containg strings with the new description") unless hash.kind_of?Hash
301
301
 
302
302
  hash.each do |language, current_path|
303
- resulting_path = "#{current_path}/*.png"
303
+ resulting_path = "#{current_path}/*.{png,PNG,jpg,JPG,jpeg,JPEG}"
304
304
 
305
305
  raise AppMetadataParameterError.new(INVALID_LANGUAGE_ERROR) unless Languages::ALL_LANGUAGES.include?language
306
306
 
307
307
  if Dir[resulting_path].count == 0
308
- Helper.log.error("No screenshots found at the given path '#{resulting_path}'")
308
+ Helper.log.error("No screenshots found at the given path '#{resulting_path}'")
309
309
  else
310
310
  self.clear_all_screenshots(language)
311
-
311
+
312
312
  Dir[resulting_path].sort.each do |path|
313
313
  add_screenshot(language, Deliver::AppScreenshot.new(path))
314
314
  end
@@ -318,7 +318,7 @@ module Deliver
318
318
  true
319
319
  end
320
320
 
321
- # This method will run through all the available locales, check if there is
321
+ # This method will run through all the available locales, check if there is
322
322
  # a folder for this language (e.g. 'en-US') and use all screenshots in there
323
323
  # @param (String) path A path to the folder, which contains a folder for each locale
324
324
  def set_all_screenshots_from_path(path)
@@ -383,7 +383,7 @@ module Deliver
383
383
  end
384
384
  end
385
385
 
386
- # @return (Deliver::ItunesTransporter) The iTunesTranspoter which is
386
+ # @return (Deliver::ItunesTransporter) The iTunesTransporter which is
387
387
  # used to upload/download the app metadata.
388
388
  def transporter
389
389
  @transporter ||= ItunesTransporter.new
@@ -402,7 +402,7 @@ module Deliver
402
402
  locale = fetch_value("//x:locale[@name='#{language}']").first
403
403
 
404
404
  raise AppMetadataParameterError.new("#{INVALID_LANGUAGE_ERROR} (#{language})") unless Languages::ALL_LANGUAGES.include?language
405
-
405
+
406
406
 
407
407
  field = locale.search(xpath_name).first
408
408
 
@@ -475,7 +475,7 @@ module Deliver
475
475
  modified: false
476
476
  }
477
477
  end
478
-
478
+
479
479
  information[language][:keywords] = { value: [], modified: false}
480
480
  locale.search('keyword').each do |current|
481
481
  information[language][:keywords][:value] << current.content
@@ -485,4 +485,4 @@ module Deliver
485
485
  end
486
486
  end
487
487
  end
488
- end
488
+ end
@@ -59,7 +59,7 @@ module Deliver
59
59
 
60
60
  # Validates the given screenshots (size and format)
61
61
  def is_valid?
62
- return false unless self.path.split(".").last == "png"
62
+ return false unless ["png", "PNG", "jpg", "JPG", "jpeg", "JPEG"].include? self.path.split(".").last
63
63
 
64
64
  size = FastImage.size(self.path)
65
65
 
@@ -128,7 +128,7 @@ module Deliver
128
128
  matching.each do |key, value|
129
129
  if current[key]
130
130
  @deploy_information[value] ||= {}
131
- @deploy_information[value][language] = current[key]
131
+ @deploy_information[value][language] ||= current[key]
132
132
  end
133
133
  end
134
134
  end
@@ -226,10 +226,10 @@ module Deliver
226
226
  if @deploy_information[:blocks][:error]
227
227
  # Custom error handling, we just call this one
228
228
  @deploy_information[:blocks][:error].call(ex)
229
- else
230
- # Re-Raise the exception
231
- raise ex
232
229
  end
230
+
231
+ # Re-Raise the exception
232
+ raise ex
233
233
  end
234
234
 
235
235
  private
@@ -6,7 +6,7 @@ module Deliver
6
6
  # Logging happens using this method
7
7
  def self.log
8
8
  if is_test?
9
- @@log ||= Logger.new(nil) # don't show any logs when running tests
9
+ @@log ||= Logger.new(STDOUT) # don't show any logs when running tests
10
10
  else
11
11
  @@log ||= Logger.new(STDOUT)
12
12
  end
@@ -5,7 +5,7 @@ require 'deliver/password_manager'
5
5
 
6
6
  module Deliver
7
7
  # The TransporterInputError occurs when you passed wrong inputs to the {Deliver::ItunesTransporter}
8
- class TransporterInputError < StandardError
8
+ class TransporterInputError < StandardError
9
9
  end
10
10
  # The TransporterTransferError occurs when some error happens
11
11
  # while uploading or downloading something from/to iTC
@@ -13,18 +13,19 @@ module Deliver
13
13
  end
14
14
 
15
15
  class ItunesTransporter
16
- ERROR_REGEX = />\s*ERROR:\s+(.+)/
16
+ ERROR_REGEX = />\s*ERROR:\s+(.+)/
17
17
  WARNING_REGEX = />\s*WARN:\s+(.+)/
18
18
  OUTPUT_REGEX = />\s+(.+)/
19
+ RETURN_VALUE_REGEX = />\sDBG-X:\sReturning\s+(\d+)/
19
20
 
20
- private_constant :ERROR_REGEX, :WARNING_REGEX, :OUTPUT_REGEX
21
+ private_constant :ERROR_REGEX, :WARNING_REGEX, :OUTPUT_REGEX, :RETURN_VALUE_REGEX
21
22
 
22
- # This will be called from the Deliverfile, and disables the logging of the transpoter output
23
+ # This will be called from the Deliverfile, and disables the logging of the transporter output
23
24
  def self.hide_transporter_output
24
25
  @@hide_transporter_output = true
25
26
  end
26
-
27
- # Returns a new instance of the iTunesTranspoter.
27
+
28
+ # Returns a new instance of the iTunesTransporter.
28
29
  # If no username or password given, it will be taken from
29
30
  # the #{Deliver::PasswordManager}
30
31
  def initialize(user = nil, password = nil)
@@ -73,7 +74,7 @@ module Deliver
73
74
  dir += "/#{app.apple_id}.itmsp"
74
75
 
75
76
  Helper.log.info "Going to upload updated app to iTunesConnect"
76
-
77
+
77
78
  command = build_upload_command(@user, @password, dir)
78
79
  result = execute_transporter(command)
79
80
 
@@ -91,7 +92,7 @@ module Deliver
91
92
 
92
93
  if defined?@@hide_transporter_output
93
94
  # Show a one time message instead
94
- Helper.log.info "Waiting for iTunes Connect transpoter to be finished.".green
95
+ Helper.log.info "Waiting for iTunes Connect transporter to be finished.".green
95
96
  Helper.log.info "If you want upload/download logs to be enabled, remove 'hide_transporter_output' from your Deliverfile."
96
97
  Helper.log.info "iTunes Transporter progress...".green
97
98
  end
@@ -107,37 +108,58 @@ module Deliver
107
108
  @errors << ex.to_s
108
109
  end
109
110
 
110
- if @errors.count > 0
111
- raise TransporterTransferError.new(@errors.join("\n"))
112
- end
113
-
114
111
  if @warnings.count > 0
115
112
  Helper.log.warn(@warnings.join("\n"))
116
113
  end
117
114
 
115
+ if @errors.count > 0
116
+ Helper.log.error(@errors.join("\n"))
117
+ end
118
+
118
119
  true
119
120
  end
120
121
 
121
122
  def parse_line(line)
122
123
  # Taken from https://github.com/sshaw/itunes_store_transporter/blob/master/lib/itunes/store/transporter/output_parser.rb
123
124
 
125
+ output_done = false
124
126
  if line =~ ERROR_REGEX
125
127
  @errors << $1
128
+ Helper.log.error "[Transporter Error Output]: #{$1}".red
126
129
 
127
130
  # Check if it's a login error
128
131
  if $1.include?"Your Apple ID or password was entered incorrectly" or
129
132
  $1.include?"This Apple ID has been locked for security reasons"
130
133
 
131
134
  Deliver::PasswordManager.shared_manager.password_seems_wrong
135
+ elsif $1.include?"Redundant Binary Upload. There already exists a binary upload with build"
136
+ Helper.log.fatal $1
137
+ Helper.log.fatal "You have to change the build number of your app to upload your ipa file"
132
138
  end
133
139
 
140
+ output_done = true
134
141
  elsif line =~ WARNING_REGEX
135
142
  @warnings << $1
143
+ Helper.log.warn "[Transporter Warning Output]: #{$1}".yellow
144
+ output_done = true
145
+ end
146
+
147
+ if line =~ RETURN_VALUE_REGEX
148
+ if $1.to_i != 0
149
+ Helper.log.fatal "Transporter transfer failed.".red
150
+ Helper.log.warn(@warnings.join("\n").yellow)
151
+ Helper.log.error(@errors.join("\n").red)
152
+ raise "Return status of iTunes Transporter was #{$1}: #{@errors.join('\n')}".red
153
+ else
154
+ Helper.log.info "iTunes Transporter successfully finished its job".green
155
+ end
136
156
  end
137
157
 
138
158
  if not defined?@@hide_transporter_output and line =~ OUTPUT_REGEX
139
159
  # General logging for debug purposes
140
- Helper.log.debug "[Transpoter Output]: #{$1}"
160
+ unless output_done
161
+ Helper.log.debug "[Transporter Output]: #{$1}"
162
+ end
141
163
  end
142
164
  end
143
165
 
@@ -167,4 +189,4 @@ module Deliver
167
189
  end
168
190
 
169
191
  end
170
- end
192
+ end
@@ -1,3 +1,3 @@
1
1
  module Deliver
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7.beta1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deliver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-20 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -350,9 +350,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
350
350
  version: 2.0.0
351
351
  required_rubygems_version: !ruby/object:Gem::Requirement
352
352
  requirements:
353
- - - '>='
353
+ - - '>'
354
354
  - !ruby/object:Gem::Version
355
- version: '0'
355
+ version: 1.3.1
356
356
  requirements: []
357
357
  rubyforge_project:
358
358
  rubygems_version: 2.2.2