badge 0.4.0 → 0.4.1
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 +8 -1
- data/lib/badge/base.rb +5 -1
- data/lib/badge/runner.rb +16 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2161bbfb1d059fcdc7efbbd76ab90ea93679cd3
|
4
|
+
data.tar.gz: 51c56de5ee8f626bef1f4650b47e00a3d42c5d55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe4b7904c1f4c189c6fab078081ed4c49303fa387ed1453d24a7a338c58f85a99cb380c2253eab1e7171a739d3a31654b2a9e0976cde8e4bf3cd21b101d4c7df
|
7
|
+
data.tar.gz: 1a1972462e533c4c70cfe4c1d8526cbc6242d3677326e2c77ad9c15a52d6555c0f12c8443b618276a92b4eaf5e4cd43aede4060c8ae411c5cfd761c72168608b
|
data/README.md
CHANGED
@@ -30,10 +30,17 @@ It's built to easily integrate with [fastlane](https://github.com/fastlane/fastl
|
|
30
30
|
|
31
31
|
 
|
32
32
|
|
33
|
+
badge --shield="1.2-2031-orange" --no_badge --shield_no_resize
|
34
|
+
|
35
|
+
 
|
36
|
+
|
33
37
|
badge --shield="Version-0.0.3-blue" --dark
|
34
38
|
|
35
39
|
 
|
36
40
|
|
41
|
+
badge --shield="Version-0.0.3-blue" --dark --shield_no_resize
|
42
|
+
|
43
|
+
 
|
37
44
|
# Installation
|
38
45
|
|
39
46
|
Install the gem
|
@@ -70,7 +77,7 @@ Add a shield at the top of your icon for all possibilites head over to: [shields
|
|
70
77
|
|
71
78
|
Sometimes the response from shield.io takes a long time and can timeout. You can adjust the timeout to shield.io with `--shield_io_timeout=10` accordingly.
|
72
79
|
|
73
|
-
`--
|
80
|
+
`--shield_gravity=North` changes the postion of the shield on the icon. Choices include: NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast.
|
74
81
|
|
75
82
|
In version `0.4.0` (coming soon) the default behavior of the shield graphic has been changed. The shield graphic will always be resized to **aspect fill** the icon instead of just adding the shield on the icon. The disable to new behaviour use `--shield_no_resize` which now only puts the shield on the icon again.
|
76
83
|
|
data/lib/badge/base.rb
CHANGED
data/lib/badge/runner.rb
CHANGED
@@ -4,6 +4,7 @@ require 'mini_magick'
|
|
4
4
|
|
5
5
|
module Badge
|
6
6
|
class Runner
|
7
|
+
@@retry_count = Badge.shield_io_retries
|
7
8
|
|
8
9
|
def run(path, options)
|
9
10
|
glob = "/**/*.appiconset/*.{png,PNG}"
|
@@ -22,6 +23,7 @@ module Badge
|
|
22
23
|
Helper.log.info "Start adding badges...".green
|
23
24
|
|
24
25
|
shield = nil
|
26
|
+
response_error = false
|
25
27
|
begin
|
26
28
|
timeout = Badge.shield_io_timeout
|
27
29
|
timeout = options[:shield_io_timeout] unless not options[:shield_io_timeout]
|
@@ -30,6 +32,20 @@ module Badge
|
|
30
32
|
end
|
31
33
|
rescue Timeout::Error
|
32
34
|
Helper.log.error "Error loading image from shield.io timeout reached. Skipping Shield. Use --verbose for more info".red
|
35
|
+
rescue OpenURI::HTTPError => error
|
36
|
+
response = error.io
|
37
|
+
Helper.log.error "Error loading image from shield.io response Error. Skipping Shield. Use --verbose for more info".red
|
38
|
+
Helper.log.error response.status unless not $verbose
|
39
|
+
response_error = true
|
40
|
+
end
|
41
|
+
|
42
|
+
if @@retry_count <= 0
|
43
|
+
Helper.log.error "Cannot load image from shield.io skipping it...".red
|
44
|
+
elsif response_error
|
45
|
+
Helper.log.info "Waiting for #{timeout.to_i}s and retry to load image from shield.io tries remaining: #{@@retry_count}".red
|
46
|
+
sleep timeout.to_i
|
47
|
+
@@retry_count -= 1
|
48
|
+
return run(path, options)
|
33
49
|
end
|
34
50
|
|
35
51
|
icon_changed = false
|
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.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Griesser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|
@@ -50,15 +50,15 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 4.
|
53
|
+
version: 4.5.1
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ~>
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 4.
|
61
|
-
description: 0.4.
|
60
|
+
version: 4.5.1
|
61
|
+
description: 0.4.1
|
62
62
|
email:
|
63
63
|
- daniel.griesser.86@gmail.com
|
64
64
|
executables:
|