snapshot 0.4.11 → 0.4.12
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 +8 -0
- data/bin/snapshot +13 -0
- data/lib/snapshot/latest_ios_version.rb +5 -0
- data/lib/snapshot/reset_simulators.rb +34 -0
- data/lib/snapshot/snapshot_config.rb +1 -1
- data/lib/snapshot/version.rb +1 -1
- data/lib/snapshot.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9968201d0d0aa36979286f7795002653e0b919bf
|
4
|
+
data.tar.gz: 02d096f07cac729ad6d4ded27698d6d8cafbd788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 805dbfb200d6dd9e71994fac0e293a4b008e708d97cdbc7d2b63d1c0e6aa7d39f804f16a2c7c94eb8fd450b8820b5935073c4faa6bed22d539cf4f8a6b6a96e5
|
7
|
+
data.tar.gz: fca03fb9128b4155be4162b9b6b5531f6e0d88d7466e08fbe79ce78b0e096a6140a9a913295da0bdab919528077cd519589511d6ffaa6121212c93a93364c132
|
data/README.md
CHANGED
@@ -301,6 +301,14 @@ If you add this line in your `Snapfile`, the previously generated screenshots wi
|
|
301
301
|
clear_previous_screenshots
|
302
302
|
```
|
303
303
|
|
304
|
+
### Completely reset all simulators
|
305
|
+
|
306
|
+
snapshot reset_simulators
|
307
|
+
|
308
|
+
**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`.
|
309
|
+
|
310
|
+
You can use the environment variable `SNAPSHOT_FORCE_DELETE` to stop asking for confirmation before deleting.
|
311
|
+
|
304
312
|
|
305
313
|
# Tips
|
306
314
|
|
data/bin/snapshot
CHANGED
@@ -50,6 +50,19 @@ class SnapshotApplication
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
+
command :reset_simulators do |c|
|
54
|
+
c.syntax = 'snapshot reset_simulators'
|
55
|
+
c.description = "This will remove all your existing simulators and re-create new ones"
|
56
|
+
c.option '-i', '--ios String', String, 'The iOS Version you want to use'
|
57
|
+
|
58
|
+
c.action do |args, options|
|
59
|
+
version = options.ios || ENV["SNAPSHOT_IOS_VERSION"] || Snapshot::LatestIosVersion::VERSION
|
60
|
+
require 'snapshot/reset_simulators'
|
61
|
+
|
62
|
+
Snapshot::ResetSimulators.clear_everything!(version)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
53
66
|
default_command :run
|
54
67
|
|
55
68
|
run!
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Snapshot
|
2
|
+
class ResetSimulators
|
3
|
+
def self.clear_everything!(ios_version)
|
4
|
+
# Taken from https://gist.github.com/cabeca/cbaacbeb6a1cc4683aa5
|
5
|
+
|
6
|
+
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
7
|
+
# !! Warning: This script will remove all your existing simulators !!
|
8
|
+
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
9
|
+
|
10
|
+
sure = true if ENV["SNAPSHOT_FORCE_DELETE"]
|
11
|
+
sure = agree("Are you sure? All your simulators will be DELETED and new ones will be created! (y/n)".red, true) unless sure
|
12
|
+
|
13
|
+
raise "User cancelled action" unless sure
|
14
|
+
|
15
|
+
device_types_output = `xcrun simctl list devicetypes`
|
16
|
+
device_types = device_types_output.scan /(.*) \((.*)\)/
|
17
|
+
|
18
|
+
devices_output = `xcrun simctl list devices`
|
19
|
+
devices = devices_output.scan /\s\s\s\s(.*) \(([^)]+)\) (.*)/
|
20
|
+
|
21
|
+
devices.each do |device|
|
22
|
+
puts "Removing device #{device[0]} (#{device[1]})"
|
23
|
+
`xcrun simctl delete #{device[1]}`
|
24
|
+
end
|
25
|
+
|
26
|
+
device_types.each do |device_type|
|
27
|
+
puts "Creating #{device_type} for iOS version #{ios_version}"
|
28
|
+
command = "xcrun simctl create '#{device_type[0]}' #{device_type[1]} #{ios_version}"
|
29
|
+
command_output = `#{command}`
|
30
|
+
sleep 0.5
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/snapshot/version.rb
CHANGED
data/lib/snapshot.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.12
|
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-
|
11
|
+
date: 2015-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastimage
|
@@ -139,8 +139,10 @@ files:
|
|
139
139
|
- lib/snapshot.rb
|
140
140
|
- lib/snapshot/builder.rb
|
141
141
|
- lib/snapshot/dependency_checker.rb
|
142
|
+
- lib/snapshot/latest_ios_version.rb
|
142
143
|
- lib/snapshot/page.html.erb
|
143
144
|
- lib/snapshot/reports_generator.rb
|
145
|
+
- lib/snapshot/reset_simulators.rb
|
144
146
|
- lib/snapshot/runner.rb
|
145
147
|
- lib/snapshot/screenshot_flatten.rb
|
146
148
|
- lib/snapshot/screenshot_rotate.rb
|