badge 0.8.4 → 0.8.5

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: 822c906789564ef26e5abed06f3e8845404e1f68
4
- data.tar.gz: 7f095560ba04b4dec08b23ab2aeb38cc6794f9d9
3
+ metadata.gz: b6acfc4494a3c8e85fc4d8d0b19167d205ae50f3
4
+ data.tar.gz: 78305f25e672aa1fa2b82fa0c882d78c50fd56f1
5
5
  SHA512:
6
- metadata.gz: 442d51f3e18a91b18f3943c1f083bbfe940f685e1e1c5afa5638b0e1436408aff766118abf72f3de0058e33187a68ba20df9b536b8d79cae8afe5580ecc2bd9f
7
- data.tar.gz: 2f1950e78e67c15e030165dce7e16f97511365f445da152e9dafb200fc61e9a976ed7ea50902739a1a396c11a41a6e49f01600cb0a58ee65029781398d2140d1
6
+ metadata.gz: c9a9c38be73c5e278726f9e8ca2d088576b653e1afd0e640ce3781b232223f1ce359362825cb85a8513e62acb11b2745d4ea62277247126ca2a166782e40acb7
7
+ data.tar.gz: 30a96b6ed74e0d954b47b7cb1682cf5c5acaa2e334b0184bae9a82bca54102407651466a92b53a6526e115ff70aa3ae5886433753c455ad4ed5d9195830f1744
data/README.md CHANGED
@@ -73,8 +73,10 @@ Call ```badge``` in your projects root folder
73
73
 
74
74
  It will search all subfolders for your asset catalog app icon set and add the badge to the icons.
75
75
 
76
- But you can also run badge on your Android or tvOS icons.
77
- You have to use the `--glob "/**/*.appiconset/*.{png,PNG}"` parameter to adjust where to find your icons.
76
+ You can also run badge on your Android, tvOS icons, or any other iconset.
77
+ You have to use the `--glob "/**/*.appiconset/*.{png,PNG}"` parameter to adjust where to find your icons.
78
+
79
+ :warning: Note that you have to use a `/` in the beginning of the custom path, even if you're not starting from the root path, f.ex. if your icons are in `res/ios/beta/Appicon/*`, your badge call would be `badge --glob "/res/ios/beta/Appicon/*"`
78
80
 
79
81
  The keep the alpha channel in the icons use `--alpha_channel`
80
82
 
@@ -1,6 +1,6 @@
1
1
  module Badge
2
2
 
3
- VERSION = "0.8.4"
3
+ VERSION = "0.8.5"
4
4
  DESCRIPTION = "Add a badge overlay to your app icon"
5
5
 
6
6
  def self.root
@@ -65,4 +65,3 @@ module Badge
65
65
  end
66
66
  end
67
67
  end
68
-
@@ -5,7 +5,7 @@ require 'curb'
5
5
 
6
6
  module Badge
7
7
  class Runner
8
- @@retry_count = Badge.shield_io_retries
8
+ @@retry_attemps = 0
9
9
  @@rsvg_enabled = true
10
10
 
11
11
  def run(path, options)
@@ -26,7 +26,6 @@ module Badge
26
26
  UI.message "Start adding badges...".green
27
27
 
28
28
  shield = nil
29
- response_error = false
30
29
  begin
31
30
  timeout = Badge.shield_io_timeout
32
31
  timeout = options[:shield_io_timeout] if options[:shield_io_timeout]
@@ -34,21 +33,27 @@ module Badge
34
33
  shield = load_shield(options[:shield]) if options[:shield]
35
34
  end
36
35
  rescue Timeout::Error
37
- UI.error "Error loading image from shield.io timeout reached. Skipping Shield. Use --verbose for more info".red
36
+ UI.error "Error loading image from shield.io timeout reached. Use --verbose for more info".red
38
37
  rescue Curl::Err::CurlError => error
39
38
  response = error.io
40
- UI.error "Error loading image from shield.io response Error. Skipping Shield. Use --verbose for more info".red
39
+ UI.error "Error loading image from shield.io response Error. Use --verbose for more info".red
41
40
  UI.verbose response.status if FastlaneCore::Globals.verbose?
42
- response_error = true
41
+ rescue MiniMagick::Invalid
42
+ UI.error "Error validating image from shield.io. Use --verbose for more info".red
43
+ rescue Exception => error
44
+ UI.error "Other error occured. Use --verbose for more info".red
45
+ UI.verbose error if FastlaneCore::Globals.verbose?
43
46
  end
44
47
 
45
- if @@retry_count <= 0
46
- UI.error "Cannot load image from shield.io skipping it...".red
47
- elsif response_error
48
- UI.message "Waiting for #{timeout.to_i}s and retry to load image from shield.io tries remaining: #{@@retry_count}".red
49
- sleep timeout.to_i
50
- @@retry_count -= 1
51
- return run(path, options)
48
+ if options[:shield] && shield == nil
49
+ if @@retry_attemps >= Badge.shield_io_retries
50
+ UI.error "Cannot load image from shield.io skipping it...".red
51
+ else
52
+ UI.message "Waiting for #{timeout.to_i}s and retry to load image from shield.io tries remaining: #{Badge.shield_io_retries - @@retry_attemps}".red
53
+ sleep timeout.to_i
54
+ @@retry_attemps += 1
55
+ return run(path, options)
56
+ end
52
57
  end
53
58
 
54
59
  icon_changed = false
@@ -122,13 +127,14 @@ module Badge
122
127
  UI.verbose "URL: #{url}".blue
123
128
 
124
129
  Curl::Easy.download(url, file_name)
130
+ MiniMagick::Image.open(file_name) unless @@rsvg_enabled
125
131
 
126
132
  File.open(file_name)
127
133
  end
128
134
 
129
135
  def check_tools!
130
136
  if !`which rsvg-convert`.include?('rsvg-convert')
131
- UI.important("Install RSVG to get better results for shields ontop of your icon")
137
+ UI.important("Install RSVG to get better results for shields on top of your icon")
132
138
  UI.important("")
133
139
  UI.important("Install it using (RSVG):")
134
140
  UI.command("brew install librsvg")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: badge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Griesser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-23 00:00:00.000000000 Z
11
+ date: 2017-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curb
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '4.5'
69
- description: 0.8.4
69
+ description: 0.8.5
70
70
  email:
71
71
  - daniel.griesser.86@gmail.com
72
72
  executables: