badge 0.8.4 → 0.8.5
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 +4 -2
- data/lib/badge/base.rb +1 -1
- data/lib/badge/options.rb +0 -1
- data/lib/badge/runner.rb +19 -13
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6acfc4494a3c8e85fc4d8d0b19167d205ae50f3
|
4
|
+
data.tar.gz: 78305f25e672aa1fa2b82fa0c882d78c50fd56f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
|
data/lib/badge/base.rb
CHANGED
data/lib/badge/options.rb
CHANGED
data/lib/badge/runner.rb
CHANGED
@@ -5,7 +5,7 @@ require 'curb'
|
|
5
5
|
|
6
6
|
module Badge
|
7
7
|
class Runner
|
8
|
-
@@
|
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.
|
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.
|
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
|
-
|
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
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
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
|
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
|
+
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-
|
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.
|
69
|
+
description: 0.8.5
|
70
70
|
email:
|
71
71
|
- daniel.griesser.86@gmail.com
|
72
72
|
executables:
|