snapshot 0.4.12 → 0.4.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/bin/snapshot +1 -1
- data/lib/snapshot/page.html.erb +160 -14
- data/lib/snapshot/reset_simulators.rb +0 -1
- data/lib/snapshot/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d50d9664f7380c82a481684d7a6243278b5634e6
|
4
|
+
data.tar.gz: 41f40e3699e231b5e5432821319c036854152fb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f8764ab6afc3acb42e6493290ff44e330f8362538f335431831b782733dcd87f1c7baacb042e7899409bf391b50435dcd9ce06a5e6c57556b9188cc8c4a132c
|
7
|
+
data.tar.gz: 0c32385f6d29872c0d1aa52f896379f1b766f8aa46445633442f34cb656ef00afb8361b08f14e51794286b97ded20ea6f73411053d96f2b206847da26942b1cd
|
data/README.md
CHANGED
@@ -65,7 +65,7 @@ Get in contact with the developer on Twitter: [@KrauseFx](https://twitter.com/Kr
|
|
65
65
|
|
66
66
|
-------
|
67
67
|
|
68
|
-
<h5 align="center"><code>snapshot</code> is part of <a href="
|
68
|
+
<h5 align="center"><code>snapshot</code> is part of <a href="https://fastlane.tools">fastlane</a>: connect all deployment tools into one streamlined workflow.</h5>
|
69
69
|
|
70
70
|
|
71
71
|
|
@@ -73,7 +73,7 @@ Get in contact with the developer on Twitter: [@KrauseFx](https://twitter.com/Kr
|
|
73
73
|
- Create hundreds of screenshots in multiple languages on all simulators
|
74
74
|
- Configure it once, store the configuration in git
|
75
75
|
- Do something else, while the computer takes the screenshots for you
|
76
|
-
- Integrated with [`fastlane`](
|
76
|
+
- Integrated with [`fastlane`](https://fastlane.tools) and [`deliver`](https://github.com/KrauseFx/deliver)
|
77
77
|
- Generates a beautiful web page, which shows all screenshots on all devices. This is perfect to send to Q&A or the marketing team
|
78
78
|
- ```snapshot``` automatically waits for network requests to be finished before taking a screenshot (we don't want loading images in the App Store screenshots)
|
79
79
|
|
@@ -303,6 +303,8 @@ clear_previous_screenshots
|
|
303
303
|
|
304
304
|
### Completely reset all simulators
|
305
305
|
|
306
|
+
You can run this command in the terminal to delete and re-create all iOS simulators:
|
307
|
+
|
306
308
|
snapshot reset_simulators
|
307
309
|
|
308
310
|
**Warning**: This will delete **all** your simulators and replace by new ones! This is useful, if you run into weird `Instruments` problems when running `snapshot`.
|
@@ -312,9 +314,9 @@ You can use the environment variable `SNAPSHOT_FORCE_DELETE` to stop asking for
|
|
312
314
|
|
313
315
|
# Tips
|
314
316
|
|
315
|
-
## [`fastlane`](
|
317
|
+
## [`fastlane`](https://fastlane.tools) Toolchain
|
316
318
|
|
317
|
-
- [`fastlane`](
|
319
|
+
- [`fastlane`](https://fastlane.tools): Connect all deployment tools into one streamlined workflow
|
318
320
|
- [`deliver`](https://github.com/KrauseFx/deliver): Upload screenshots, metadata and your app to the App Store using a single command
|
319
321
|
- [`frameit`](https://github.com/KrauseFx/frameit): Quickly put your screenshots into the right device frames
|
320
322
|
- [`PEM`](https://github.com/KrauseFx/pem): Automatically generate and renew your push notification profiles
|
data/bin/snapshot
CHANGED
@@ -17,7 +17,7 @@ class SnapshotApplication
|
|
17
17
|
program :version, Snapshot::VERSION
|
18
18
|
program :description, 'CLI for \'Snapshot\' - Automate taking localized screenshots of your iOS app on every device'
|
19
19
|
program :help, 'Author', 'Felix Krause <snapshot@krausefx.com>'
|
20
|
-
program :help, 'Website', '
|
20
|
+
program :help, 'Website', 'https://fastlane.tools'
|
21
21
|
program :help, 'GitHub', 'https://github.com/krausefx/snapshot'
|
22
22
|
program :help_formatter, :compact
|
23
23
|
|
data/lib/snapshot/page.html.erb
CHANGED
@@ -1,41 +1,81 @@
|
|
1
|
+
<!DOCTYPE html>
|
1
2
|
<html>
|
2
3
|
<head>
|
4
|
+
<title>KrauseFx/snapshot</title>
|
5
|
+
<meta charset="UTF-8">
|
3
6
|
<style type="text/css">
|
4
7
|
* {
|
5
|
-
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
8
|
+
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
6
9
|
font-weight: 300;
|
7
10
|
}
|
8
11
|
.language {
|
9
|
-
|
12
|
+
|
10
13
|
}
|
11
14
|
.deviceName {
|
12
|
-
|
15
|
+
display: block;
|
13
16
|
font-size: 30px;
|
17
|
+
padding-bottom: 24px;
|
18
|
+
padding-top: 45px;
|
14
19
|
}
|
15
20
|
.screenshot {
|
16
21
|
cursor: pointer;
|
17
22
|
border: 1px #EEE solid;
|
23
|
+
z-index: 0;
|
18
24
|
}
|
19
25
|
td {
|
20
26
|
text-align: center;
|
21
27
|
}
|
28
|
+
#overlay {
|
29
|
+
position:fixed;
|
30
|
+
top:0;
|
31
|
+
left:0;
|
32
|
+
background:rgba(0,0,0,0.8);
|
33
|
+
z-index:5;
|
34
|
+
width:100%;
|
35
|
+
height:100%;
|
36
|
+
display:none;
|
37
|
+
cursor: zoom-out;
|
38
|
+
text-align: center;
|
39
|
+
}
|
40
|
+
#imageDisplay {
|
41
|
+
height: auto;
|
42
|
+
width: auto;
|
43
|
+
z-index: 10;
|
44
|
+
cursor: pointer;
|
45
|
+
}
|
46
|
+
#imageInfo {
|
47
|
+
background: none repeat scroll 0 0 rgba(0, 0, 0, 0.2);
|
48
|
+
border-radius: 5px;
|
49
|
+
color: white;
|
50
|
+
margin: 20px;
|
51
|
+
padding: 10px;
|
52
|
+
position: absolute;
|
53
|
+
right: 0;
|
54
|
+
top: 0;
|
55
|
+
width: 250px;
|
56
|
+
z-index: -1;
|
57
|
+
}
|
58
|
+
#imageInfo:hover {
|
59
|
+
z-index: 20;
|
60
|
+
}
|
22
61
|
</style>
|
23
62
|
</head>
|
24
63
|
<body>
|
25
64
|
<% divide_size_by = 5.0 %>
|
26
65
|
<% max_width = 180 %>
|
66
|
+
<% image_counter = 0 %>
|
27
67
|
|
28
68
|
|
29
69
|
<% @data.each do |language, content| %>
|
30
70
|
<h1 class="language"><%= language %></h1>
|
31
|
-
<hr
|
71
|
+
<hr>
|
32
72
|
<table>
|
33
73
|
<% content.each do |device_name, screens| %>
|
34
|
-
<
|
35
|
-
<
|
36
|
-
|
37
|
-
</
|
38
|
-
</
|
74
|
+
<tr>
|
75
|
+
<th colspan="<%= screens.count %>">
|
76
|
+
<span class="deviceName"><%= device_name %></span>
|
77
|
+
</th>
|
78
|
+
</tr>
|
39
79
|
<tr>
|
40
80
|
<% screens.each do |screen_path| %>
|
41
81
|
<% next if screen_path.include?"_framed.png" %>
|
@@ -44,10 +84,13 @@
|
|
44
84
|
<% width = ((screen_size[0] / divide_size_by).round rescue 0) %>
|
45
85
|
<% width = [width, max_width].min %>
|
46
86
|
<% style = (width > 0 ? "width: #{width}px;" : '') %>
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
87
|
+
<% image_counter += 1 %>
|
88
|
+
<a href="<%= screen_path %>" target="_blank" class="screenshotLink">
|
89
|
+
<img class="screenshot"
|
90
|
+
src="<%= screen_path %>"
|
91
|
+
style="<%= style %>"
|
92
|
+
alt="<%= language %> <%= device_name %>"
|
93
|
+
data-counter="<%= image_counter %>" />
|
51
94
|
</a>
|
52
95
|
</td>
|
53
96
|
<% end %>
|
@@ -55,5 +98,108 @@
|
|
55
98
|
<% end %>
|
56
99
|
</table>
|
57
100
|
<% end %>
|
101
|
+
<div id="overlay">
|
102
|
+
<img id="imageDisplay" src="" alt="" />
|
103
|
+
<div id="imageInfo"></div>
|
104
|
+
</div>
|
105
|
+
<script type="text/javascript">
|
106
|
+
var overlay = document.getElementById('overlay');
|
107
|
+
var imageDisplay = document.getElementById('imageDisplay');
|
108
|
+
var imageInfo = document.getElementById('imageInfo');
|
109
|
+
var screenshotLink = document.getElementsByClassName('screenshotLink');
|
110
|
+
|
111
|
+
function doClick(el) {
|
112
|
+
if (document.createEvent) {
|
113
|
+
var evObj = document.createEvent('MouseEvents', true);
|
114
|
+
evObj.initMouseEvent("click", false, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
115
|
+
el.dispatchEvent(evObj);
|
116
|
+
} else if (document.createEventObject) { //IE
|
117
|
+
var evObj = document.createEventObject();
|
118
|
+
el.fireEvent('onclick', evObj);
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
for (index = 0; index < screenshotLink.length; ++index) {
|
123
|
+
screenshotLink[index].addEventListener('click', function(e) {
|
124
|
+
e.preventDefault();
|
125
|
+
|
126
|
+
var img = e.target;
|
127
|
+
if (e.target.tagName == 'A') {
|
128
|
+
img = e.target.children[0];
|
129
|
+
}
|
130
|
+
|
131
|
+
// beautify
|
132
|
+
var tmpImg = new Image();
|
133
|
+
tmpImg.src = img.src;
|
134
|
+
imageDisplay.style.height = 'auto';
|
135
|
+
imageDisplay.style.width = 'auto';
|
136
|
+
imageDisplay.style.paddingTop = '0px';
|
137
|
+
if (window.innerHeight < tmpImg.height) {
|
138
|
+
imageDisplay.style.height = document.documentElement.clientHeight+'px';
|
139
|
+
} else if (window.innerWidth < tmpImg.width) {
|
140
|
+
imageDisplay.style.width = document.documentElement.clientWidth;+'px';
|
141
|
+
} else {
|
142
|
+
imageDisplay.style.paddingTop = parseInt((window.innerHeight - tmpImg.height) / 2)+'px';
|
143
|
+
}
|
144
|
+
|
145
|
+
imageDisplay.src = img.src;
|
146
|
+
imageDisplay.alt = img.alt;
|
147
|
+
imageDisplay.dataset.counter = img.dataset.counter;
|
148
|
+
|
149
|
+
imageInfo.innerHTML = '<h3>'+img.alt+'</h3>';
|
150
|
+
imageInfo.innerHTML += img.src.split("/").pop();
|
151
|
+
imageInfo.innerHTML += '<br />'+tmpImg.height+'×'+tmpImg.width+'px';
|
152
|
+
|
153
|
+
overlay.style.display = "block";
|
154
|
+
});
|
155
|
+
}
|
156
|
+
|
157
|
+
imageDisplay.addEventListener('click', function(e) {
|
158
|
+
e.stopPropagation(); // !
|
159
|
+
|
160
|
+
overlay.style.display = "none";
|
161
|
+
|
162
|
+
img_counter = parseInt(e.target.dataset.counter) + 1;
|
163
|
+
try {
|
164
|
+
link = document.body.querySelector('img[data-counter="'+img_counter+'"]').parentNode;
|
165
|
+
} catch (e) {
|
166
|
+
try {
|
167
|
+
link = document.body.querySelector('img[data-counter="0"]').parentNode;
|
168
|
+
} catch (e) {
|
169
|
+
return false;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
doClick(link);
|
173
|
+
});
|
174
|
+
|
175
|
+
overlay.addEventListener('click', function(e) {
|
176
|
+
overlay.style.display = "none";
|
177
|
+
})
|
178
|
+
|
179
|
+
document.onkeypress = function(e) {
|
180
|
+
e = e || window.event;
|
181
|
+
var charCode = e.keyCode || e.which;
|
182
|
+
|
183
|
+
switch(charCode) {
|
184
|
+
case 27: // Esc
|
185
|
+
overlay.style.display = "none";
|
186
|
+
break;
|
187
|
+
case 34: // right-arrow, Page Down, keypad right, ...
|
188
|
+
case 39:
|
189
|
+
case 54:
|
190
|
+
case 102:
|
191
|
+
e.preventDefault();
|
192
|
+
doClick(imageDisplay);
|
193
|
+
break;
|
194
|
+
case 33: // left-arrow, Page Up, keypad right, ...
|
195
|
+
case 37:
|
196
|
+
case 52:
|
197
|
+
case 100:
|
198
|
+
e.preventDefault();
|
199
|
+
document.getElementById('imageDisplay').dataset.counter -= 2; // hacky
|
200
|
+
break;
|
201
|
+
}
|
202
|
+
};
|
203
|
+
</script>
|
58
204
|
</body>
|
59
|
-
</
|
205
|
+
</html>
|
data/lib/snapshot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snapshot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.13
|
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-
|
11
|
+
date: 2015-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastimage
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: fastlane_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -151,7 +151,7 @@ files:
|
|
151
151
|
- lib/snapshot/snapshot_config.rb
|
152
152
|
- lib/snapshot/snapshot_file.rb
|
153
153
|
- lib/snapshot/version.rb
|
154
|
-
homepage:
|
154
|
+
homepage: https://fastlane.tools
|
155
155
|
licenses:
|
156
156
|
- MIT
|
157
157
|
metadata: {}
|