snapshot 0.4.6 → 0.4.7
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 -0
- data/lib/assets/SnapfileTemplate +2 -0
- data/lib/snapshot/runner.rb +2 -0
- data/lib/snapshot/snapshot_config.rb +4 -1
- data/lib/snapshot/snapshot_file.rb +2 -0
- data/lib/snapshot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13928d9326f39b30e569d84dc9b7322b75528461
|
4
|
+
data.tar.gz: 980ee5750a4891dc1a393a3ea9ffaef388eb6fb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f1dd54873bc74cd2ebd857bcc3053fbee2f4008aac3acd904aba4258f2dddf8fff27fd390c6f81c980079116d3b149f995ad120a8d0d949385330cf3138cf99
|
7
|
+
data.tar.gz: ba74fd809f939871c5d95aaeb672bef8e7cec2db92f28472c4fd8103f408d2f925e2a8f53e1ac74a52cbeded4b5abd0e1285b457a6b70e7e4131483e604eb16d
|
data/README.md
CHANGED
@@ -276,6 +276,15 @@ This is only required in case there is a problem automatically detecting it.
|
|
276
276
|
SNAPSHOT_APP_IDENTIFIER="com.krausefx.app" snapshot
|
277
277
|
```
|
278
278
|
|
279
|
+
### Clear old screenshots
|
280
|
+
|
281
|
+
If you add this line in your `Snapfile`, the previously generated screenshots will be deleted before generating new ones:
|
282
|
+
|
283
|
+
```ruby
|
284
|
+
clear_previous_screenshots
|
285
|
+
```
|
286
|
+
|
287
|
+
|
279
288
|
# Tips
|
280
289
|
|
281
290
|
## [`fastlane`](http://fastlane.tools) Toolchain
|
data/lib/assets/SnapfileTemplate
CHANGED
@@ -18,6 +18,8 @@ languages([
|
|
18
18
|
# Where should the resulting screenshots be stored?
|
19
19
|
screenshots_path "./screenshots"
|
20
20
|
|
21
|
+
# clear_previous_screenshots # remove the '#'' to clear all previously generated screenshots before creating new ones
|
22
|
+
|
21
23
|
# JavaScript UIAutomation file
|
22
24
|
# js_file './snapshot.js'
|
23
25
|
|
data/lib/snapshot/runner.rb
CHANGED
@@ -13,6 +13,8 @@ module Snapshot
|
|
13
13
|
counter = 0
|
14
14
|
errors = []
|
15
15
|
|
16
|
+
FileUtils.rm_rf SnapshotConfig.shared_instance.screenshots_path if SnapshotConfig.shared_instance.clear_previous_screenshots
|
17
|
+
|
16
18
|
SnapshotConfig.shared_instance.devices.each do |device|
|
17
19
|
|
18
20
|
SnapshotConfig.shared_instance.blocks[:setup_for_device_change].call(device, udid_for_simulator(device)) # Callback
|
@@ -28,9 +28,12 @@ module Snapshot
|
|
28
28
|
# @return (String) The build command, wich should build the app to '/tmp/snapshot'
|
29
29
|
attr_accessor :build_command
|
30
30
|
|
31
|
-
# @return (
|
31
|
+
# @return (BOOL) Skip the removal of the alpha channel from the screenshots
|
32
32
|
attr_accessor :skip_alpha_removal
|
33
33
|
|
34
|
+
# @return (BOOL) Clear previously generated screenshots before creating new ones
|
35
|
+
attr_accessor :clear_previous_screenshots
|
36
|
+
|
34
37
|
# @return (Hash) All the blocks, which are called on specific actions
|
35
38
|
attr_accessor :blocks
|
36
39
|
|
@@ -45,6 +45,8 @@ module Snapshot
|
|
45
45
|
@config.build_command = value
|
46
46
|
when :skip_alpha_removal
|
47
47
|
@config.skip_alpha_removal = true
|
48
|
+
when :clear_previous_screenshots
|
49
|
+
@config.clear_previous_screenshots = true
|
48
50
|
when :project_path
|
49
51
|
raise "project_path has to be an String".red unless value.kind_of?String
|
50
52
|
|
data/lib/snapshot/version.rb
CHANGED