fastlane-plugin-screenshot_notifier 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fbde9cfedf4a778509f8b7ea23d92dc972251297b6ee4981cc56933ee92fcd8
4
- data.tar.gz: 2da75461850c503933f0079a8318046fb0360d75c2970a36547d9331d719efd4
3
+ metadata.gz: 5e26ff84624dce3334d249c1ecf51a0b98579db60019dd2372443f0229160c6d
4
+ data.tar.gz: 762727583e6849b3250730513e1280b8862f60ff99514ce6526332c081505af1
5
5
  SHA512:
6
- metadata.gz: 1019e99a90cddf10a12c0400699619e5d979b17f5c46c15913dd2cdfb1c972b7579972f21c4c34b1b2ba3ce1ebdb1008be9128d6fac7c0f6eb27741f3fd4aeb4
7
- data.tar.gz: 24ccddf8baf9cca131900f8f391318e0ab15bcdd2d89df609985b8e132b7f8b047d59b7d1933cebe64dbccc737a4c51fa546f8bab408150888148136e4ca0f98
6
+ metadata.gz: 7a86b3314f83cb2d75fadc7dacf4e9f0934b382cfa143d4c1f6f1b5b5ccbb4da7899efc321de5c217ebac89e35a801b64c0367610976d6ec2bc4a32b5a0efd68
7
+ data.tar.gz: ffcbc3830a4b6e242de7b8430b3557e6b7cb0b4b0fb5314d2823a38a85f0573cd8f7e6af3226ab8e00a4a0fbfb6515090dd4883fdde3ee51ee37dace2d364e27
@@ -25,13 +25,18 @@ module Fastlane
25
25
  devices = Dir.chdir("#{screenshot_dir}") do
26
26
  Dir.glob("*").select { |path| FileTest.directory? path }.sort
27
27
  end
28
+ if devices.empty?
29
+ UI.message("That screenshot dir is empty")
30
+ return
31
+ end
32
+
28
33
  header = "<tr><td>Screen Name</td>\n#{devices.map { |device| "<td>#{device}</td>\n" }.inject(&:+)}</tr>"
29
34
  rows = Dir.glob("#{screenshot_dir}/#{devices[0]}/*.jpg")
30
35
  .map { |path| File.basename(path) }
31
36
  .map { |file_name|
32
37
  cells = devices.map { |device|
33
38
  file_path = "#{screenshot_dir}/#{device}/#{file_name}"
34
- next if !File.exist?(file_path)
39
+ next "<td></td>" unless File.exist?(file_path)
35
40
  ratio = Helper.calc_aspect_ratio(file_path)
36
41
  is_portrait = ratio >= 1.0
37
42
  size_attr = if params[:image_length] != nil
@@ -52,8 +57,7 @@ module Fastlane
52
57
  "<td><img src=\"#{url}\" #{size_attr}/></td>\n"
53
58
  }.inject(&:+)
54
59
  "<tr><td>#{file_name}</td>\n#{cells}</tr>\n"
55
- }
56
- .inject(&:+)
60
+ }.inject(&:+)
57
61
 
58
62
  table = "<table>#{header}#{rows}</table>"
59
63
  comment = if params[:fold_result]
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module ScreenshotNotifier
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-screenshot_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moyuru Aizawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-29 00:00:00.000000000 Z
11
+ date: 2019-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry