badge 0.8.6 → 0.8.7

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
  SHA1:
3
- metadata.gz: 105dd6560b16aab0e4fdd0e00cf06d280464e3d8
4
- data.tar.gz: 186182b62f9f9be3d815c5d77ba8b9df737592e5
3
+ metadata.gz: b4690e5853b9ba97e9b5741603e278f27092de1b
4
+ data.tar.gz: 3ce2164672c0cf303563246a3fd866691171c8a5
5
5
  SHA512:
6
- metadata.gz: c6f5a3c1506fbd9022c13d527d195cafe8ef0bdc474e59966ab0531283dd13d9450e3e1867a17c0532525910f4da1571fe9db2ad452b244197e209ae6934132e
7
- data.tar.gz: 6c54a968cc0be8ab75428253077af888f705571699c7f2321b10509741f6547dca82e685d5100c5023912e4e1a4615a6d8cd3411cef8dc56e24243fba8efc14e
6
+ metadata.gz: d425e77cb3315bb7fd1145462c6df28bf3050d312fee8ab2ebde6c3e837cfaa9d97d45219d9202fb78b35aedf2a2e85766ec4b176aae2775e5e5f297fb00fca6
7
+ data.tar.gz: dc4d29a721b0ec1e64d9681c16b7a67aac070967a1928e685062e7309ce95ed6eed24b657c58022749c70227f618f9d0e41007316976adc38fef68171c06a90a
@@ -1,6 +1,6 @@
1
1
  module Badge
2
2
 
3
- VERSION = "0.8.6"
3
+ VERSION = "0.8.7"
4
4
  DESCRIPTION = "Add a badge overlay to your app icon"
5
5
 
6
6
  def self.root
@@ -27,11 +27,7 @@ module Badge
27
27
  File.join assets, 'alpha_badge_dark.png'
28
28
  end
29
29
 
30
- def self.shield_service_name
31
- 'shields.io'
32
- end
33
-
34
- def self.shield_serveice_base_url
30
+ def self.shield_base_url
35
31
  'https://img.shields.io'
36
32
  end
37
33
 
@@ -39,11 +35,11 @@ module Badge
39
35
  '/badge/'
40
36
  end
41
37
 
42
- def self.shield_service_timeout
38
+ def self.shield_io_timeout
43
39
  10
44
40
  end
45
41
 
46
- def self.shield_service_retries
42
+ def self.shield_io_retries
47
43
  10
48
44
  end
49
45
 
@@ -33,11 +33,11 @@ module Badge
33
33
  optional: true),
34
34
 
35
35
  FastlaneCore::ConfigItem.new(key: :shield,
36
- description: "Overlay a shield from #{Badge.shield_service_name} on your icon, eg: Version-1.2-green",
36
+ description: "Overlay a shield from shields.io on your icon, eg: Version-1.2-green",
37
37
  optional: true),
38
38
 
39
- FastlaneCore::ConfigItem.new(key: :shield_service_timeout,
40
- description: "The timeout in seconds we should wait the get a response from #{Badge.shield_service_name}",
39
+ FastlaneCore::ConfigItem.new(key: :shield_io_timeout,
40
+ description: "The timeout in seconds we should wait the get a response from shields.io",
41
41
  type: Integer,
42
42
  optional: true),
43
43
 
@@ -32,29 +32,29 @@ module Badge
32
32
 
33
33
  shield = nil
34
34
  begin
35
- timeout = Badge.shield_service_timeout
36
- timeout = options[:shield_service_timeout] if options[:shield_service_timeout]
35
+ timeout = Badge.shield_io_timeout
36
+ timeout = options[:shield_io_timeout] if options[:shield_io_timeout]
37
37
  Timeout.timeout(timeout.to_i) do
38
38
  shield = load_shield(options[:shield]) if options[:shield]
39
39
  end
40
40
  rescue Timeout::Error
41
- UI.error "Error loading image from #{Badge.shield_service_name} timeout reached. Use --verbose for more info".red
41
+ UI.error "Error loading image from shields.io timeout reached. Use --verbose for more info".red
42
42
  rescue Curl::Err::CurlError => error
43
43
  response = error.io
44
- UI.error "Error loading image from #{Badge.shield_service_name} response Error. Use --verbose for more info".red
44
+ UI.error "Error loading image from shields.io response Error. Use --verbose for more info".red
45
45
  UI.verbose response.status if FastlaneCore::Globals.verbose?
46
46
  rescue MiniMagick::Invalid
47
- UI.error "Error validating image from #{Badge.shield_service_name}. Use --verbose for more info".red
47
+ UI.error "Error validating image from shields.io. Use --verbose for more info".red
48
48
  rescue Exception => error
49
49
  UI.error "Other error occured. Use --verbose for more info".red
50
50
  UI.verbose error if FastlaneCore::Globals.verbose?
51
51
  end
52
52
 
53
53
  if options[:shield] && shield == nil
54
- if @@retry_attemps >= Badge.shield_service_retries
55
- UI.error "Cannot load image from #{Badge.shield_service_name} skipping it...".red
54
+ if @@retry_attemps >= Badge.shield_io_retries
55
+ UI.error "Cannot load image from shields.io skipping it...".red
56
56
  else
57
- UI.message "Waiting for #{timeout.to_i}s and retry to load image from #{Badge.shield_service_name} tries remaining: #{Badge.shield_service_retries - @@retry_attemps}".red
57
+ UI.message "Waiting for #{timeout.to_i}s and retry to load image from shields.io tries remaining: #{Badge.shield_io_retries - @@retry_attemps}".red
58
58
  sleep timeout.to_i
59
59
  @@retry_attemps += 1
60
60
  return run(path, options)
@@ -100,7 +100,7 @@ module Badge
100
100
 
101
101
  def add_shield(icon, result, shield, alpha_channel, shield_gravity, shield_no_resize, shield_scale, shield_geometry)
102
102
  UI.message "'#{icon.path}'"
103
- UI.verbose "Adding #{Badge.shield_service_name} image ontop of icon".blue
103
+ UI.verbose "Adding shields.io image ontop of icon".blue
104
104
 
105
105
  shield_scale = shield_scale ? shield_scale.to_f : 1.0
106
106
 
@@ -125,10 +125,10 @@ module Badge
125
125
  end
126
126
 
127
127
  def load_shield(shield_string)
128
- url = Badge.shield_serveice_base_url + Badge.shield_path + shield_string + (@@rsvg_enabled ? ".svg" : ".png")
128
+ url = Badge.shield_base_url + Badge.shield_path + shield_string + (@@rsvg_enabled ? ".svg" : ".png")
129
129
  file_name = shield_string + (@@rsvg_enabled ? ".svg" : ".png")
130
130
 
131
- UI.verbose "Trying to load image from #{Badge.shield_service_name}. Timeout: #{Badge.shield_service_timeout}s".blue
131
+ UI.verbose "Trying to load image from shields.io. Timeout: #{Badge.shield_io_timeout}s".blue
132
132
  UI.verbose "URL: #{url}".blue
133
133
 
134
134
  Curl::Easy.download(url, file_name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: badge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Griesser
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '4.5'
69
- description: 0.8.6
69
+ description: 0.8.7
70
70
  email:
71
71
  - daniel.griesser.86@gmail.com
72
72
  executables: