snapshot 0.2.3 → 0.2.4

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: acfede0f257f7e7e7ec950ee9ba4818ade0d22db
4
- data.tar.gz: a15c43321dc16c4b01ed728dab042c8b825e76b4
3
+ metadata.gz: 5fb8551c6c185df8ccba72657f78aed84d5970fc
4
+ data.tar.gz: 80bac1bdfc3f0d1f0a682267f781a32416b7a94a
5
5
  SHA512:
6
- metadata.gz: 23f8baf982808b583d7265fd00b8fa806fb1ba2e00f3740338ff81761768fe5de72b2e0e4dfbedf9268aefc292cb0d6b5ef8cfa6bdde677ddb298ec9d7fdf551
7
- data.tar.gz: 238fba164839399ef47e4ded7cd16e91aca329f7dd9dff4f4abf84ec48055bdb2ff9e18fd7923b61388a921821c8e15d4cd2196a9a8ce6489adac40bd1ecf2c2
6
+ metadata.gz: bab34e72bc1436f0d5ff95e0acfa78518b87101d9ceed42308233741539de56aa01a0f93614772400ed3d88344ffb7f62ad5cc42ab98e4916eeb892cf66c4215
7
+ data.tar.gz: 53ee98138bc60617066898664f37f26a5a252c7ffc635ec826fa54d177249944e4509372a2e7d6e02fcc250ea7d9a8440dbeb9274a77f6996596c22b2c9203c3
data/README.md CHANGED
@@ -211,6 +211,11 @@ You can use [SimulatorStatusMagic](https://github.com/shinydevelopment/Simulator
211
211
  ## Editing the ```Snapfile```
212
212
  Change syntax highlighting to *Ruby*.
213
213
 
214
+ ## Instruments is not responding
215
+ Unfortunately, from time to time, ```Instruments``` decide, to not respond to anything. Which means, neither the ```Instruments``` application, nor the ```instruments``` command line work. Killing the process doesn't help.
216
+
217
+ The only way to fix this, is a restart of the Mac.
218
+
214
219
  # Need help?
215
220
  - If there is a technical problem with ```Snapshot```, submit an issue. Run ```snapshot --trace``` to get the stacktrace.
216
221
  - I'm available for contract work - drop me an email: snapshot@felixkrause.at
@@ -7,6 +7,7 @@ require 'snapshot/builder'
7
7
  require 'snapshot/snapshot_file'
8
8
  require 'snapshot/languages'
9
9
  require 'snapshot/reports_generator'
10
+ require 'snapshot/screenshot_flatten'
10
11
 
11
12
  # Third Party code
12
13
  require 'colored'
@@ -38,6 +38,8 @@ module Snapshot
38
38
  else
39
39
  Helper.log.info "Successfully finished generating #{counter} screenshots.".green
40
40
  end
41
+
42
+ ScreenshotFlatten.new.run(SnapshotConfig.shared_instance.screenshots_path)
41
43
 
42
44
  Helper.log.info "Check it out here: #{SnapshotConfig.shared_instance.screenshots_path}".green
43
45
  end
@@ -0,0 +1,25 @@
1
+ module Snapshot
2
+ # This class takes care of removing the alpha channel of the generated screenshots
3
+ class ScreenshotFlatten
4
+ # @param (String) The path in which the screenshots are located in
5
+ def run(path)
6
+ if image_magick_installed?
7
+ flatten(path)
8
+ else
9
+ Helper.log.info "Could not remove transparency of generated screenhots.".yellow
10
+ Helper.log.info "This will cause problems when trying to manually upload them to iTC.".yellow
11
+ Helper.log.info "You can install 'imagemagick' using 'brew install imagemagick' to enable this feature.".yellow
12
+ end
13
+ end
14
+
15
+ def flatten(path)
16
+ Dir.glob([path, '**/*.png'].join('/')).each do |file|
17
+ `convert -flatten '#{file}' -alpha off -alpha remove '#{file}'`
18
+ end
19
+ end
20
+
21
+ def image_magick_installed?
22
+ `which convert`.length > 1
23
+ end
24
+ end
25
+ end
@@ -1,3 +1,3 @@
1
1
  module Snapshot
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
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.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -186,6 +186,7 @@ files:
186
186
  - lib/snapshot/page.html.erb
187
187
  - lib/snapshot/reports_generator.rb
188
188
  - lib/snapshot/runner.rb
189
+ - lib/snapshot/screenshot_flatten.rb
189
190
  - lib/snapshot/snapfile_creator.rb
190
191
  - lib/snapshot/snapshot_config.rb
191
192
  - lib/snapshot/snapshot_file.rb