deliver 0.9.4 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/bin/deliver +2 -1
- data/lib/assets/DeliverfileExample +4 -4
- data/lib/assets/summary.html.erb +203 -0
- data/lib/deliver.rb +1 -3
- data/lib/deliver/deliver_process.rb +5 -5
- data/lib/deliver/html_generator.rb +21 -0
- data/lib/deliver/version.rb +1 -1
- metadata +6 -5
- data/lib/deliver/pdf_generator.rb +0 -150
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a3a8eed44f8084c64b1f4947a3e5c6158fb0582
|
4
|
+
data.tar.gz: 0d6a5d848a43ccac5c447a8f0f5b627615a4953d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 405185ddfcf48f78757938756dc8391dfa484a88b613629a4c4fa5d9035555583bcfe6deb7307c5907303378e8883a749c8a39e2a72e1d87808efad846fb9f78
|
7
|
+
data.tar.gz: 9b20f456befe9309d76efe6d88c884264c51f6cc58fbf957775f2dc4a298948d56268e3f2430016b7c83e432de18d0fda2d2c30ab06efc770c045dbfcf5b9150
|
data/README.md
CHANGED
@@ -182,10 +182,10 @@ ipa do
|
|
182
182
|
"./name.ipa"
|
183
183
|
end
|
184
184
|
|
185
|
-
changelog(
|
185
|
+
changelog(
|
186
186
|
"en-US" => "This update adds cool new features",
|
187
187
|
"de-DE" => "Dieses Update ist super"
|
188
|
-
|
188
|
+
)
|
189
189
|
```
|
190
190
|
If you wish to skip automated submission to review you can provide `--skip-deploy` option when calling `deliver`. This will upload the ipa file and app metadata, but will not submit the app for review.
|
191
191
|
|
@@ -199,8 +199,8 @@ In order to upload an `.ipa` file for Apple TestFlight you need to specify `beta
|
|
199
199
|
|
200
200
|
```ruby
|
201
201
|
beta_ipa do
|
202
|
-
|
203
|
-
|
202
|
+
system("ipa build")
|
203
|
+
"./name.ipa"
|
204
204
|
end
|
205
205
|
```
|
206
206
|
|
@@ -228,10 +228,10 @@ end
|
|
228
228
|
|
229
229
|
#### Read content from somewhere external (file, web service, ...)
|
230
230
|
```ruby
|
231
|
-
description(
|
232
|
-
|
233
|
-
|
234
|
-
|
231
|
+
description(
|
232
|
+
"en-US" => File.read("description-en.txt")
|
233
|
+
"de-DE" => open("http://example.com/app_description.txt").read
|
234
|
+
)
|
235
235
|
```
|
236
236
|
|
237
237
|
#### Build and sign the app
|
@@ -278,7 +278,7 @@ app = Deliver::App.new(app_identifier: 'com.krausefx.app')
|
|
278
278
|
|
279
279
|
app.get_app_status # => Waiting for Review
|
280
280
|
app.create_new_version!("1.4")
|
281
|
-
app.metadata.update_title(
|
281
|
+
app.metadata.update_title("en-US" => "iPhone App Title")
|
282
282
|
app.metadata.set_all_screenshots_from_path("./screenshots")
|
283
283
|
app.upload_metadata!
|
284
284
|
app.itc.submit_for_review!(app)
|
data/bin/deliver
CHANGED
@@ -16,7 +16,7 @@ class FastlaneApplication
|
|
16
16
|
program :help, 'Author', 'Felix Krause <deliver@krausefx.com>'
|
17
17
|
program :help, 'Website', 'https://fastlane.tools'
|
18
18
|
program :help, 'GitHub', 'https://github.com/krausefx/deliver'
|
19
|
-
|
19
|
+
program :help_formatter, :compact
|
20
20
|
|
21
21
|
global_option '-f', '--force', 'Runs a deployment without verifying any information (PDF file). This can be used for build servers.'
|
22
22
|
global_option '--beta', 'Upload a beta build to iTunes Connect. This uses the `beta_ipa` block.'
|
@@ -101,6 +101,7 @@ end
|
|
101
101
|
|
102
102
|
begin
|
103
103
|
FastlaneCore::UpdateChecker.start_looking_for_update('deliver')
|
104
|
+
Deliver::DependencyChecker.check_dependencies
|
104
105
|
FastlaneApplication.new.run
|
105
106
|
ensure
|
106
107
|
FastlaneCore::UpdateChecker.show_update_status('deliver', Deliver::VERSION)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
###################### App Metadata ######################
|
2
2
|
#
|
3
|
-
# title(
|
3
|
+
# title(
|
4
4
|
# "en-US" => "Your App Name"
|
5
|
-
#
|
5
|
+
# )
|
6
6
|
#
|
7
|
-
# changelog(
|
7
|
+
# changelog(
|
8
8
|
# "en-US" => "iPhone 6 (Plus) Support"
|
9
|
-
#
|
9
|
+
# )
|
10
10
|
# More options: https://github.com/KrauseFx/deliver/blob/master/Deliverfile.md
|
11
11
|
|
12
12
|
###################### Screenshots ######################
|
@@ -0,0 +1,203 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>deliver - <%= @data['en-US'][:title][:value] rescue @data.values.first[:title][:value] %></title>
|
4
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-16">
|
5
|
+
<style>
|
6
|
+
#app-name {
|
7
|
+
font-size: 42px;
|
8
|
+
font-family: 'Helvetica Neue', HelveticaNeue, Helvetica Neue;
|
9
|
+
font-weight: 300;
|
10
|
+
margin-top: 22px;
|
11
|
+
margin-left: 25px;
|
12
|
+
margin-right: 25px;
|
13
|
+
}
|
14
|
+
|
15
|
+
#app-urls {
|
16
|
+
margin-left: 25px;
|
17
|
+
font-size: 14px;
|
18
|
+
margin-top: 4px;
|
19
|
+
margin-right: 25px;
|
20
|
+
}
|
21
|
+
|
22
|
+
body {
|
23
|
+
font-family: 'Helvetica Neue', HelveticaNeue;
|
24
|
+
}
|
25
|
+
|
26
|
+
hr {
|
27
|
+
margin-top: 40px;
|
28
|
+
margin-bottom: 40px;
|
29
|
+
}
|
30
|
+
|
31
|
+
.app-url-descr {
|
32
|
+
height:22px;
|
33
|
+
display: inline-block;
|
34
|
+
font-weight: 500;
|
35
|
+
}
|
36
|
+
|
37
|
+
.app-url {
|
38
|
+
color: #0056ba;
|
39
|
+
font-weight: 300;
|
40
|
+
margin-right: 10px;
|
41
|
+
}
|
42
|
+
|
43
|
+
#app-keyword {
|
44
|
+
margin-left: 25px;
|
45
|
+
margin-right: 25px;
|
46
|
+
margin-top: 22px;
|
47
|
+
}
|
48
|
+
|
49
|
+
.cat-headline {
|
50
|
+
font-weight: 700;
|
51
|
+
margin-bottom: 5px;
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
#app-description {
|
57
|
+
margin-left: 25px;
|
58
|
+
margin-right: 25px;
|
59
|
+
margin-top: 22px;
|
60
|
+
}
|
61
|
+
|
62
|
+
#app-description-text {
|
63
|
+
font-weight: 300;
|
64
|
+
}
|
65
|
+
|
66
|
+
#app-changelog {
|
67
|
+
margin-left: 25px;
|
68
|
+
margin-right: 25px;
|
69
|
+
margin-top: 22px;
|
70
|
+
}
|
71
|
+
|
72
|
+
#app-screenshots {
|
73
|
+
margin-left: 15px;
|
74
|
+
margin-right: 15px;
|
75
|
+
margin-top: 22px;
|
76
|
+
}
|
77
|
+
|
78
|
+
.app-keyword-list {
|
79
|
+
font-weight: 300;
|
80
|
+
}
|
81
|
+
|
82
|
+
.app-changelog-list {
|
83
|
+
list-style-type: square;
|
84
|
+
|
85
|
+
font-weight: 300;
|
86
|
+
}
|
87
|
+
|
88
|
+
ul {
|
89
|
+
margin-top: 6px;
|
90
|
+
}
|
91
|
+
|
92
|
+
.app-screenshot-row {
|
93
|
+
width: 100%;
|
94
|
+
margin-top: 10px;
|
95
|
+
margin-bottom: 10px;
|
96
|
+
}
|
97
|
+
|
98
|
+
.app-screenshot {
|
99
|
+
width: calc(20% - 30px);
|
100
|
+
margin-left: 10px;
|
101
|
+
margin-right: 10px;
|
102
|
+
}
|
103
|
+
|
104
|
+
#app-screenshots .cat-headline {
|
105
|
+
margin-left: 10px;
|
106
|
+
margin-right: 10px;
|
107
|
+
}
|
108
|
+
|
109
|
+
/*for highlighting a changed value*/
|
110
|
+
.modified {
|
111
|
+
color: #0056ba;
|
112
|
+
}
|
113
|
+
</style>
|
114
|
+
</head>
|
115
|
+
|
116
|
+
<%
|
117
|
+
def modified?(val)
|
118
|
+
"modified" if (val and val[:modified] == true)
|
119
|
+
end
|
120
|
+
%>
|
121
|
+
|
122
|
+
<body>
|
123
|
+
<% @data.each do |language, content| %>
|
124
|
+
<div id="app-name" class="<%= modified?(content[:title]) %>">
|
125
|
+
<%= language %>: <%= content[:title][:value] %>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<div id="app-urls">
|
129
|
+
<% all_keys = [:support_url, :privacy_url, :software_url] %>
|
130
|
+
<% all_keys.each do |key| %>
|
131
|
+
<% value = content[key][:value] rescue nil %>
|
132
|
+
<% if value %>
|
133
|
+
<div class="app-url-descr <%= modified?(content[key]) %>">
|
134
|
+
<%= key %>: <a target="_blank" class="app-url" href="<%= value %>"><%= value %></a>
|
135
|
+
</div>
|
136
|
+
<% end %>
|
137
|
+
<% end %>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div id="app-keyword" class="<%= modified?(content[:keywords]) %>">
|
141
|
+
<div class="cat-headline">Keywords</div>
|
142
|
+
<ul class="app-keyword-list">
|
143
|
+
<% (content[:keywords][:value] rescue []).each do |keyword| %>
|
144
|
+
<li><%= keyword %></li>
|
145
|
+
<% end %>
|
146
|
+
</ul>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div id="app-description" class="<%= modified?(content[:description]) %>">
|
150
|
+
<div class="cat-headline">Description</div>
|
151
|
+
<div id="app-description-text">
|
152
|
+
<%= content[:description][:value].gsub("\n", "<br />") rescue nil %>
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div id="app-changelog" class="<%= modified?(content[:version_whats_new]) %>">
|
157
|
+
<div class="cat-headline">Changelog</div>
|
158
|
+
<%= content[:version_whats_new][:value].gsub("\n", "<br />") rescue nil %>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
<div id="app-screenshots">
|
162
|
+
<div class="cat-headline">Screenshots</div>
|
163
|
+
|
164
|
+
<% if (content[:screenshots] || []).count > 0 %>
|
165
|
+
<% last_size = nil %>
|
166
|
+
<% content[:screenshots].sort{|a, b| [a.screen_size, a.path] <=> [b.screen_size, b.path]}.each do |screenshot| %>
|
167
|
+
|
168
|
+
<% new_row = (last_size != screenshot.screen_size or last_size == nil) %>
|
169
|
+
|
170
|
+
<% if new_row and last_size != nil %>
|
171
|
+
</div>
|
172
|
+
<% end %>
|
173
|
+
|
174
|
+
<% if new_row %>
|
175
|
+
<h4><%= screenshot.screen_size %></h4>
|
176
|
+
<div class="app-screenshot-row">
|
177
|
+
<% end %>
|
178
|
+
|
179
|
+
<a href="<%= screenshot.path %>" target="_blank"><img class="app-screenshot" src="<%= screenshot.path %>"></a>
|
180
|
+
|
181
|
+
<% last_size = screenshot.screen_size %>
|
182
|
+
<% end %>
|
183
|
+
<% else %>
|
184
|
+
<!-- no screenshots -->
|
185
|
+
<div style="border: 3px solid red; padding: 0px 20px">
|
186
|
+
<h2 style="color: red">No Screenshots Found</h2>
|
187
|
+
<p>
|
188
|
+
deliver couldn't find any screenshots. Due to a bug in iTunes Transporter this will <b>remove</b> the existing screenshots on iTunes Connect.
|
189
|
+
</p>
|
190
|
+
<p>
|
191
|
+
Please make sure to store your screenshots in the screenshots folder. If you want to download your existing screenshots, run <i>deliver init</i> in a different directory.
|
192
|
+
</p>
|
193
|
+
</div>
|
194
|
+
<% end %>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
</div>
|
198
|
+
<hr />
|
199
|
+
<% end # end data %>
|
200
|
+
</body>
|
201
|
+
</html>
|
202
|
+
|
203
|
+
|
data/lib/deliver.rb
CHANGED
@@ -10,7 +10,7 @@ require 'deliver/deliverfile/deliverfile'
|
|
10
10
|
require 'deliver/deliverfile/deliverfile_creator'
|
11
11
|
require 'deliver/deliverer'
|
12
12
|
require 'deliver/ipa_uploader'
|
13
|
-
require 'deliver/
|
13
|
+
require 'deliver/html_generator'
|
14
14
|
require 'deliver/deliver_process'
|
15
15
|
require 'deliver/dependency_checker'
|
16
16
|
require 'deliver/ipa_file_analyser'
|
@@ -20,6 +20,4 @@ require 'fastlane_core'
|
|
20
20
|
|
21
21
|
module Deliver
|
22
22
|
Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
|
23
|
-
|
24
|
-
Deliver::DependencyChecker.check_dependencies
|
25
23
|
end
|
@@ -251,21 +251,21 @@ module Deliver
|
|
251
251
|
else
|
252
252
|
# Everything is prepared for the upload
|
253
253
|
# We may have to ask the user if that's okay
|
254
|
-
|
254
|
+
html_path = HtmlGenerator.new.render(self)
|
255
255
|
unless Helper.is_test?
|
256
256
|
puts "----------------------------------------------------------------------------"
|
257
|
-
puts "Verifying the upload via the
|
257
|
+
puts "Verifying the upload via the HTML file can be disabled by either adding"
|
258
258
|
puts "'skip_pdf true' to your Deliverfile or using the flag --force."
|
259
259
|
puts "----------------------------------------------------------------------------"
|
260
260
|
|
261
|
-
system("open '#{
|
262
|
-
okay = agree("Does the
|
261
|
+
system("open '#{html_path}'")
|
262
|
+
okay = agree("Does the Preview on path '#{html_path}' look okay for you? (blue = updated) (y/n)", true)
|
263
263
|
|
264
264
|
unless okay
|
265
265
|
dir ||= app.get_metadata_directory
|
266
266
|
dir += "/#{app.apple_id}.itmsp"
|
267
267
|
FileUtils.rm_rf(dir) unless Helper.is_test?
|
268
|
-
raise "Did not upload the metadata, because the
|
268
|
+
raise "Did not upload the metadata, because the HTML file was rejected by the user".yellow
|
269
269
|
end
|
270
270
|
end
|
271
271
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Deliver
|
2
|
+
class HtmlGenerator
|
3
|
+
# Renders all data available in the Deliverer to quickly see if everything was correctly generated.
|
4
|
+
# @param deliverer [Deliver::Deliverer] The deliver process on which based the HTML file should be generated
|
5
|
+
# @param export_path (String) The path to a folder where the resulting HTML file should be stored.
|
6
|
+
def render(deliverer, export_path = nil)
|
7
|
+
lib_path = Helper.gem_path('deliver')
|
8
|
+
|
9
|
+
@data = deliverer.app.metadata.information
|
10
|
+
|
11
|
+
html_path = File.join(lib_path, "lib/assets/summary.html.erb")
|
12
|
+
html = ERB.new(File.read(html_path)).result(binding) # http://www.rrn.dk/rubys-erb-templating-system
|
13
|
+
|
14
|
+
export_path ||= ENV["DELIVER_HTML_EXPORT_PATH"] || '.' # DELIVER_HTML_EXPORT_PATH used in tests to use /tmp
|
15
|
+
export_path = File.join(export_path, "Preview.html")
|
16
|
+
File.write(export_path, html)
|
17
|
+
|
18
|
+
return export_path
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/deliver/version.rb
CHANGED
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.
|
4
|
+
version: 0.10.0
|
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-05-
|
11
|
+
date: 2015-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.7.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.7.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: credentials_manager
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,6 +237,7 @@ files:
|
|
237
237
|
- lib/assets/DeliverfileExample
|
238
238
|
- lib/assets/ScreenshotsHelp
|
239
239
|
- lib/assets/fonts/mona.ttf
|
240
|
+
- lib/assets/summary.html.erb
|
240
241
|
- lib/deliver.rb
|
241
242
|
- lib/deliver/app.rb
|
242
243
|
- lib/deliver/app_metadata.rb
|
@@ -249,6 +250,7 @@ files:
|
|
249
250
|
- lib/deliver/deliverfile/deliverfile_creator.rb
|
250
251
|
- lib/deliver/deliverfile/dsl.rb
|
251
252
|
- lib/deliver/dependency_checker.rb
|
253
|
+
- lib/deliver/html_generator.rb
|
252
254
|
- lib/deliver/ipa_file_analyser.rb
|
253
255
|
- lib/deliver/ipa_uploader.rb
|
254
256
|
- lib/deliver/itunes_connect/itunes_connect.rb
|
@@ -262,7 +264,6 @@ files:
|
|
262
264
|
- lib/deliver/itunes_connect/itunes_connect_submission.rb
|
263
265
|
- lib/deliver/itunes_transporter.rb
|
264
266
|
- lib/deliver/metadata_item.rb
|
265
|
-
- lib/deliver/pdf_generator.rb
|
266
267
|
- lib/deliver/testflight.rb
|
267
268
|
- lib/deliver/version.rb
|
268
269
|
homepage: https://fastlane.tools
|
@@ -1,150 +0,0 @@
|
|
1
|
-
require 'prawn'
|
2
|
-
|
3
|
-
module Deliver
|
4
|
-
class PdfGenerator
|
5
|
-
|
6
|
-
# Renders all data available in the Deliverer to quickly see if everything was correctly generated.
|
7
|
-
# @param deliverer [Deliver::Deliverer] The deliver process on which based the PDF file should be generated
|
8
|
-
# @param export_path (String) The path to a folder where the resulting PDF file should be stored.
|
9
|
-
def render(deliverer, export_path = nil)
|
10
|
-
export_path ||= '/tmp'
|
11
|
-
fontdir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'assets', 'fonts'))
|
12
|
-
|
13
|
-
resulting_path = "#{export_path}/#{Time.now.to_i}.pdf"
|
14
|
-
Prawn::Document.generate(resulting_path) do
|
15
|
-
|
16
|
-
|
17
|
-
# Adding Mona to handle Japanese. The Prawn docs say not to use the included Kai font so we're
|
18
|
-
# using this 3rd-party font instead.
|
19
|
-
|
20
|
-
font_families["Mona"] = {
|
21
|
-
:normal => { :file => "#{fontdir}/mona.ttf", :font => "Mona" }
|
22
|
-
}
|
23
|
-
|
24
|
-
pdf_fallback_fonts = [ "Mona" ]
|
25
|
-
|
26
|
-
font "Helvetica" # Set main document font
|
27
|
-
|
28
|
-
counter = 0
|
29
|
-
deliverer.app.metadata.information.each do |language, content|
|
30
|
-
modified_color = '0000AA'
|
31
|
-
standard_color = '000000'
|
32
|
-
|
33
|
-
title = content[:title][:value] rescue ''
|
34
|
-
|
35
|
-
Helper.log.info("[PDF] Exporting locale '#{language}' for app with title '#{title}'")
|
36
|
-
|
37
|
-
font_size 20
|
38
|
-
color = (content[:title][:modified] ? modified_color : standard_color rescue standard_color)
|
39
|
-
text "#{language}: #{title}", :fallback_fonts => pdf_fallback_fonts, color: color
|
40
|
-
stroke_horizontal_rule
|
41
|
-
font_size 14
|
42
|
-
|
43
|
-
move_down 30
|
44
|
-
|
45
|
-
col1 = 200
|
46
|
-
|
47
|
-
prev_cursor = cursor.to_f
|
48
|
-
# Description on right side
|
49
|
-
bounding_box([col1, cursor], width: 340.0) do
|
50
|
-
if content[:description] and content[:description][:value]
|
51
|
-
text content[:description][:value], size: 6, color: (content[:description][:modified] ? modified_color : standard_color), :fallback_fonts => pdf_fallback_fonts
|
52
|
-
end
|
53
|
-
move_down 10
|
54
|
-
stroke_horizontal_rule
|
55
|
-
move_down 10
|
56
|
-
text "Changelog:", size: 8, :fallback_fonts => pdf_fallback_fonts
|
57
|
-
move_down 5
|
58
|
-
if content[:version_whats_new] and content[:version_whats_new][:value]
|
59
|
-
text content[:version_whats_new][:value], size: 6, color: (content[:version_whats_new][:modified] ? modified_color : standard_color), :fallback_fonts => pdf_fallback_fonts
|
60
|
-
end
|
61
|
-
end
|
62
|
-
title_bottom = cursor.to_f
|
63
|
-
|
64
|
-
move_cursor_to prev_cursor
|
65
|
-
|
66
|
-
all_keys = [:support_url, :privacy_url, :software_url, :keywords]
|
67
|
-
|
68
|
-
all_keys.each_with_index do |key, index|
|
69
|
-
value = content[key][:value] rescue nil
|
70
|
-
|
71
|
-
color = (content[key][:modified] ? modified_color : standard_color rescue standard_color)
|
72
|
-
|
73
|
-
bounding_box([0, cursor], width: col1) do
|
74
|
-
key = key.to_s.gsub('_', ' ').capitalize
|
75
|
-
|
76
|
-
width = 200
|
77
|
-
size = 10
|
78
|
-
|
79
|
-
if value.kind_of?Array
|
80
|
-
# Keywords only
|
81
|
-
text "#{key}:", color: color, width: width, size: size, :fallback_fonts => pdf_fallback_fonts
|
82
|
-
move_down 2
|
83
|
-
|
84
|
-
keywords_padding_left = 5
|
85
|
-
bounding_box([keywords_padding_left, cursor], width: (col1 - keywords_padding_left)) do
|
86
|
-
value.each do |item|
|
87
|
-
text "- #{item}", color: color, width: width, size: (size - 2), :fallback_fonts => pdf_fallback_fonts
|
88
|
-
end
|
89
|
-
end
|
90
|
-
else
|
91
|
-
# Everything else
|
92
|
-
next if value == nil or value.length == 0
|
93
|
-
|
94
|
-
text "#{key}: #{value}", color: color, width: width, size: size, :fallback_fonts => pdf_fallback_fonts
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
image_width = bounds.width / 6 # wide enough for 5 portrait screenshots to fit
|
100
|
-
padding = 10
|
101
|
-
last_size = nil
|
102
|
-
top = [cursor, title_bottom].min - padding
|
103
|
-
index = 0
|
104
|
-
previous_image_height = 0
|
105
|
-
move_cursor_to top
|
106
|
-
|
107
|
-
if (content[:screenshots] || []).count > 0
|
108
|
-
content[:screenshots].sort{ |a, b| [a.screen_size, a.path] <=> [b.screen_size, b.path] }.each do |screenshot|
|
109
|
-
|
110
|
-
if last_size and last_size != screenshot.screen_size
|
111
|
-
# Next row (other simulator size)
|
112
|
-
top -= (previous_image_height + padding)
|
113
|
-
move_cursor_to top
|
114
|
-
|
115
|
-
index = 0
|
116
|
-
end
|
117
|
-
|
118
|
-
# Compute the image height to know how far to move down
|
119
|
-
original_size = FastImage.size(screenshot.path)
|
120
|
-
previous_image_height = (image_width.to_f / original_size[0].to_f) * original_size[1].to_f
|
121
|
-
|
122
|
-
# If there isn't enough room for this image then start a new page
|
123
|
-
if top < previous_image_height
|
124
|
-
start_new_page
|
125
|
-
top = cursor
|
126
|
-
end
|
127
|
-
|
128
|
-
image screenshot.path, width: image_width,
|
129
|
-
at: [(index * (image_width + padding)), top]
|
130
|
-
|
131
|
-
|
132
|
-
last_size = screenshot.screen_size
|
133
|
-
index += 1
|
134
|
-
end
|
135
|
-
else
|
136
|
-
move_cursor_to top
|
137
|
-
text "No screenshots passed. Is this correct? They will get removed from iTunesConnect."
|
138
|
-
end
|
139
|
-
|
140
|
-
counter += 1
|
141
|
-
if counter < deliverer.app.metadata.information.count
|
142
|
-
start_new_page
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
return resulting_path
|
148
|
-
end
|
149
|
-
end
|
150
|
-
end
|