snapshot 0.4.6 → 0.4.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca1d44f5d3981444263228bcb8c0528b97cede47
4
- data.tar.gz: 2a84ee85f3a7c0dd2c1d7da5557857abe5ee869a
3
+ metadata.gz: 13928d9326f39b30e569d84dc9b7322b75528461
4
+ data.tar.gz: 980ee5750a4891dc1a393a3ea9ffaef388eb6fb8
5
5
  SHA512:
6
- metadata.gz: f80391c3b5d104f8271c4cd90f03110cb4ee900d6edbe582ba9b061c83d744d13942ba9cda5c4853e4365275e16136f325f07db2665925eefcee8329cc297f92
7
- data.tar.gz: 4a194d765aa44cfa75b3cca707dd65753e60e65874052cbc1e881acd558b8ad8b44edbdec69a5510dbb43675bc2fd683f3e69aabd23a3d5748a3365724e2d422
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
@@ -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
 
@@ -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 (BOOl) Skip the removal of the alpha channel from the screenshots
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
 
@@ -1,3 +1,3 @@
1
1
  module Snapshot
2
- VERSION = "0.4.6"
2
+ VERSION = "0.4.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause