snapshot 0.9.3 → 0.10.0
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 -0
- data/bin/snapshot +4 -3
- data/lib/snapshot.rb +8 -0
- data/lib/snapshot/page.html.erb +0 -1
- data/lib/snapshot/reset_simulators.rb +5 -3
- data/lib/snapshot/runner.rb +16 -7
- data/lib/snapshot/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7f64dd119934c713a6b6fc7e05653ac8ebca9d1
|
4
|
+
data.tar.gz: 28d7d068560b15e39d75acdfdaf822bd49464aca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5697b920fda9b3352ce8c187f9c9489445ac49d285b02bcbed61fbdb1c55eb63b027d1c86154700f2a60eaf4bb6dcd9234fa5ca746aed1659efa29a10290516
|
7
|
+
data.tar.gz: 4ec9ce6549d8007be4c8dc9e026e96347ed249e7bc17e1505d96eceb7a46aad63a13afe69a36d272fad77160f1c4f42fe78bf40ac74cf1f9fdf2720d85ab35df
|
data/README.md
CHANGED
@@ -71,6 +71,8 @@ As a result, `snapshot` will be completely rewritten from ground up without chan
|
|
71
71
|
- UI Tests are written in Swift or Objective C
|
72
72
|
- UI Tests can be executed in a much cleaner and better way
|
73
73
|
|
74
|
+
A note to the new release of Xcode 7: `snapshot` has some issues with the GM, please use Xcode 6 for UI Automation until this is resolved.
|
75
|
+
|
74
76
|
-------
|
75
77
|
<p align="center">
|
76
78
|
<a href="#features">Features</a> •
|
data/bin/snapshot
CHANGED
@@ -69,13 +69,14 @@ class SnapshotApplication
|
|
69
69
|
command :reset_simulators do |c|
|
70
70
|
c.syntax = 'snapshot reset_simulators'
|
71
71
|
c.description = "This will remove all your existing simulators and re-create new ones"
|
72
|
-
c.option '-i', '--ios String', String, 'The iOS
|
72
|
+
c.option '-i', '--ios String', String, 'The comma separated list of iOS Versions you want to use'
|
73
73
|
|
74
74
|
c.action do |args, options|
|
75
|
-
|
75
|
+
versions = [Snapshot::LatestIosVersion.version]
|
76
|
+
versions = options.ios.split(',') if options.ios
|
76
77
|
require 'snapshot/reset_simulators'
|
77
78
|
|
78
|
-
Snapshot::ResetSimulators.clear_everything!(
|
79
|
+
Snapshot::ResetSimulators.clear_everything!(versions)
|
79
80
|
end
|
80
81
|
end
|
81
82
|
|
data/lib/snapshot.rb
CHANGED
@@ -16,4 +16,12 @@ module Snapshot
|
|
16
16
|
Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
|
17
17
|
|
18
18
|
Snapshot::DependencyChecker.check_dependencies
|
19
|
+
|
20
|
+
def self.xcode_version
|
21
|
+
`xcodebuild -version`.match(/Xcode (.*)/)[1]
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.min_xcode7?
|
25
|
+
xcode_version.split(".").first.to_i >= 7
|
26
|
+
end
|
19
27
|
end
|
data/lib/snapshot/page.html.erb
CHANGED
@@ -134,7 +134,6 @@
|
|
134
134
|
tmpImg.src = img.src;
|
135
135
|
imageDisplay.style.height = 'auto';
|
136
136
|
imageDisplay.style.width = 'auto';
|
137
|
-
imageDisplay.style.paddingTop = '20px';
|
138
137
|
if (window.innerHeight < tmpImg.height) {
|
139
138
|
imageDisplay.style.height = document.documentElement.clientHeight+'px';
|
140
139
|
} else if (window.innerWidth < tmpImg.width) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Snapshot
|
2
2
|
class ResetSimulators
|
3
|
-
def self.clear_everything!(
|
3
|
+
def self.clear_everything!(ios_versions)
|
4
4
|
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
5
5
|
# !! Warning: This script will remove all your existing simulators !!
|
6
6
|
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
@@ -35,8 +35,10 @@ module Snapshot
|
|
35
35
|
all_device_types.each do |device_type|
|
36
36
|
next if device_type.join(' ').include?"Watch" # we don't want to deal with the Watch right now
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
ios_versions.each do |ios_version|
|
39
|
+
puts "Creating #{device_type} for iOS version #{ios_version}"
|
40
|
+
`xcrun simctl create '#{device_type[0]}' #{device_type[1]} #{ios_version}`
|
41
|
+
end
|
40
42
|
end
|
41
43
|
end
|
42
44
|
end
|
data/lib/snapshot/runner.rb
CHANGED
@@ -51,7 +51,7 @@ module Snapshot
|
|
51
51
|
break if errors.any? && ENV["SNAPSHOT_BREAK_ON_FIRST_ERROR"]
|
52
52
|
end
|
53
53
|
|
54
|
-
|
54
|
+
kill_simulator # close the simulator after the script is finished
|
55
55
|
|
56
56
|
return unless take_snapshots
|
57
57
|
|
@@ -100,20 +100,24 @@ module Snapshot
|
|
100
100
|
|
101
101
|
def com(cmd)
|
102
102
|
puts cmd.magenta if $verbose
|
103
|
-
|
104
|
-
|
105
|
-
|
103
|
+
|
104
|
+
IO.popen("#{cmd} 2>&1", err: [:child, :out]) do |io|
|
105
|
+
io.each do |line|
|
106
|
+
puts line if (line.to_s.length > 0 and $verbose)
|
107
|
+
end
|
108
|
+
io.close
|
106
109
|
end
|
107
110
|
end
|
108
111
|
|
109
112
|
udid = udid_for_simulator(device)
|
110
113
|
|
111
|
-
|
114
|
+
kill_simulator
|
112
115
|
sleep 3
|
113
116
|
com("xcrun simctl boot '#{udid}'")
|
114
|
-
|
117
|
+
|
118
|
+
com("xcrun simctl uninstall '#{udid}' '#{app_identifier}'") unless Snapshot.min_xcode7?
|
115
119
|
sleep 3
|
116
|
-
com("xcrun simctl install
|
120
|
+
com("xcrun simctl install '#{udid}' #{@app_path.shellescape}") unless Snapshot.min_xcode7?
|
117
121
|
com("xcrun simctl shutdown booted")
|
118
122
|
end
|
119
123
|
|
@@ -221,6 +225,11 @@ module Snapshot
|
|
221
225
|
end
|
222
226
|
end
|
223
227
|
|
228
|
+
def kill_simulator
|
229
|
+
`killall "iOS Simulator"`
|
230
|
+
`killall "Simulator"`
|
231
|
+
end
|
232
|
+
|
224
233
|
def copy_screenshots(language)
|
225
234
|
resulting_path = File.join(SnapshotConfig.shared_instance.screenshots_path, language)
|
226
235
|
|
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
|
+
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-09-
|
11
|
+
date: 2015-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastimage
|
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
177
|
version: '0'
|
178
178
|
requirements: []
|
179
179
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.4.
|
180
|
+
rubygems_version: 2.4.5
|
181
181
|
signing_key:
|
182
182
|
specification_version: 4
|
183
183
|
summary: Automate taking localized screenshots of your iOS app on every device
|