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 +4 -4
- data/README.md +5 -0
- data/lib/snapshot.rb +1 -0
- data/lib/snapshot/runner.rb +2 -0
- data/lib/snapshot/screenshot_flatten.rb +25 -0
- data/lib/snapshot/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fb8551c6c185df8ccba72657f78aed84d5970fc
|
4
|
+
data.tar.gz: 80bac1bdfc3f0d1f0a682267f781a32416b7a94a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/snapshot.rb
CHANGED
data/lib/snapshot/runner.rb
CHANGED
@@ -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
|
data/lib/snapshot/version.rb
CHANGED
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.
|
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
|