fastlane-plugin-polidea 3.0.0.pre.1 → 3.0.0.pre.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: 0e49b978d0f9ccc23f99bed241bf7c23c4a02a5742b8ef3497388268c267e245
4
- data.tar.gz: 0b2a0731c0a81b86e32a37b46444f9d79f55758e86bb3b00e4c68f453dc2e83a
3
+ metadata.gz: 317d3aa45968f0355417ab13df0a4da7049597e819c77972b1021e30ee7ef0d9
4
+ data.tar.gz: 23e604adeb790bdd1adfc74712b49818302beb1286da7dbdf6ea8332b7bf05fd
5
5
  SHA512:
6
- metadata.gz: 8efd5143e60704460f492e8c55fea1130005d20f4f57a1c1019155eed99d43f9d5e33096e59234bca9d3226106f801cc488aa45ed0b122e9f108b95d70baeaad
7
- data.tar.gz: 47028dd656853ddebf7dc589a8bcfbd69f7f49603a1f65a8eeef6bf697aae41388178709a801750d8920820392b2ee8697ef077c982cfb32a3149db84c3616ee
6
+ metadata.gz: d6ea02463c20ddd33fc9632cb4d7b8885be1a5d270107b83d4a39c8b59823f044c894925ea97a12a12f2d5597ee3a8211ad03a15571a5d5f5aff82b4ec209cc0
7
+ data.tar.gz: 765387f1eb7e99316a021a741d524783bf69f943e1d2e92058ac86b4f3b9f3102d8906baa53e45398699958ba0c87429eafd903339eeb2a1a2545ad6e1f6b013
@@ -118,7 +118,7 @@ module Fastlane
118
118
 
119
119
  def self.qr_code(installation_link)
120
120
  qr_code_path = "/tmp/qr_code.png"
121
- QRGenerator.new(installation_link, false, ::ChunkyPNG::Color.rgb(21, 18, 126)).generate(qr_code_path)
121
+ QRGenerator.new(installation_link, ::ChunkyPNG::Color.rgb(21, 18, 126)).generate(qr_code_path)
122
122
  File.new(qr_code_path)
123
123
  end
124
124
 
@@ -2,6 +2,8 @@ require 'json'
2
2
 
3
3
  module Fastlane
4
4
  module PageGenerator
5
+ PLACEHOLDER_URL = "https://s3.eu-central-1.amazonaws.com/fota.polidea.com/mails/images/icon-placeholder.jpg"
6
+
5
7
  def self.mail(config)
6
8
  UI.message("Generating e-mail...")
7
9
  eth = Fastlane::ErbTemplateHelper
@@ -12,7 +14,7 @@ module Fastlane
12
14
  author: config[:author],
13
15
  last_commit: config[:last_commit],
14
16
  is_android: config[:is_android],
15
- app_icon: app_icon_or_placholder(config[:app_icon]),
17
+ app_icon: mail_app_icon_or_placholder(config[:app_icon]),
16
18
  app_name: config[:app_name],
17
19
  app_version: config[:app_version],
18
20
  build_number: config[:build_number],
@@ -56,13 +58,22 @@ module Fastlane
56
58
  end
57
59
  private_class_method :parse_release_notes
58
60
 
59
- def self.app_icon_or_placholder(app_icon)
61
+ def self.mail_app_icon_or_placholder(app_icon)
60
62
  if app_icon.nil?
61
- "https://s3.eu-central-1.amazonaws.com/fota.polidea.com/mails/images/icon-placeholder.jpg"
63
+ PLACEHOLDER_URL
62
64
  else
63
65
  "cid:#{app_icon}"
64
66
  end
65
67
  end
68
+ private_class_method :mail_app_icon_or_placholder
69
+
70
+ def self.app_icon_or_placholder(app_icon)
71
+ if app_icon.nil?
72
+ PLACEHOLDER_URL
73
+ else
74
+ app_icon
75
+ end
76
+ end
66
77
  private_class_method :app_icon_or_placholder
67
78
  end
68
79
  end
@@ -2,34 +2,22 @@ require 'rqrcode_png'
2
2
 
3
3
  module Fastlane
4
4
  class QRGenerator
5
- def initialize(data, auto_awesome = false, dark_color = ::ChunkyPNG::Color::BLACK)
5
+ def initialize(data, dark_color = ::ChunkyPNG::Color::BLACK)
6
6
  @qr_code = RQRCode::QRCode.new(data, size: 10, level: :m)
7
- @auto_awesome = auto_awesome
8
7
  @dark_color = dark_color
8
+ @light_color = ::ChunkyPNG::Color::WHITE
9
9
 
10
10
  @margin = 20
11
- @image = ::ChunkyPNG::Image.new(2 * @margin + @qr_code.qrcode.module_count * 5, 2 * @margin + @qr_code.qrcode.module_count * 5, ::ChunkyPNG::Color::WHITE)
12
-
13
- @logo = ::ChunkyPNG::Image.from_file("#{path_to_resources}/polidea-logo.png")
14
- @logo = @logo.resize(2 * @margin + @qr_code.qrcode.module_count * 5, 2 * @margin + @qr_code.qrcode.module_count * 5)
11
+ @image = ::ChunkyPNG::Image.new(2 * @margin + @qr_code.qrcode.module_count * 5, 2 * @margin + @qr_code.qrcode.module_count * 5, @light_color)
15
12
  end
16
13
 
17
14
  def generate(path)
18
- white = ::ChunkyPNG::Color::WHITE
19
- blue = ::ChunkyPNG::Color.rgb(26, 159, 217)
20
-
21
- if !@auto_awesome
22
- dark_color = @dark_color
23
- else
24
- dark_color = blue
25
- end
26
-
27
15
  @qr_code.modules.each_index do |row|
28
16
  @qr_code.modules[row].each_index do |column|
29
17
  if @qr_code.modules[row][column]
30
- print_symbol(dark_color, column, row, (column < 8 && row < 8) || (column < 8 && row >= @qr_code.qrcode.module_count - 8) || (column >= @qr_code.qrcode.module_count - 8 && row < 8))
18
+ print_symbol(@dark_color, column, row, (column < 8 && row < 8) || (column < 8 && row >= @qr_code.qrcode.module_count - 8) || (column >= @qr_code.qrcode.module_count - 8 && row < 8))
31
19
  else
32
- print_symbol(white, column, row, (column < 8 && row < 8) || (column < 8 && row >= @qr_code.qrcode.module_count - 8) || (column >= @qr_code.qrcode.module_count - 8 && row < 8))
20
+ print_symbol(@light_color, column, row, (column < 8 && row < 8) || (column < 8 && row >= @qr_code.qrcode.module_count - 8) || (column >= @qr_code.qrcode.module_count - 8 && row < 8))
33
21
  end
34
22
  end
35
23
  end
@@ -40,37 +28,14 @@ module Fastlane
40
28
 
41
29
  def print_symbol(color, column, row, interpolate)
42
30
  (0..4).each do |i|
43
- if i < 4 && i > 0
44
- print_symbol_row(interpolated_color(color, 5 * column + i, 5 * row, true), 5 * column + i, row, interpolate)
45
- else
46
- print_symbol_row(interpolated_color(color, 5 * column + i, 5 * row, interpolate), 5 * column + i, row, interpolate)
47
- end
31
+ print_symbol_row(color, 5 * column + i, row, interpolate)
48
32
  end
49
33
  end
50
34
 
51
- def interpolated_color(color, column, row, interpolate)
52
- if !@auto_awesome
53
- interpolated_color = color
54
- elsif interpolate
55
- interpolated_color = ::ChunkyPNG::Color.interpolate_quick(color, @logo[@margin + column, @margin + row], 255)
56
- else
57
- interpolated_color = ::ChunkyPNG::Color.interpolate_quick(color, @logo[@margin + column, @margin + row], 40)
58
- end
59
- interpolated_color
60
- end
61
-
62
35
  def print_symbol_row(color, column, row, interpolate)
63
36
  (0..4).each do |i|
64
- if i < 4 && i > 0
65
- @image[@margin + column, @margin + 5 * row + i] = interpolated_color(color, column, 5 * row + i, true)
66
- else
67
- @image[@margin + column, @margin + 5 * row + i] = interpolated_color(color, column, 5 * row + i, interpolate)
68
- end
37
+ @image[@margin + column, @margin + 5 * row + i] = color
69
38
  end
70
39
  end
71
-
72
- def path_to_resources
73
- File.expand_path("templates/images", Polidea.root)
74
- end
75
40
  end
76
41
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Polidea
3
- VERSION = "3.0.0.pre.1"
3
+ VERSION = "3.0.0.pre.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-polidea
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre.1
4
+ version: 3.0.0.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotrek Dubiel