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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3aef91776cdf789a5b8e78e8a1f4ec1d3c9b1b76
4
- data.tar.gz: 9e82876afce0b73f62f0baf08d6af5b763fef212
3
+ metadata.gz: e2161bbfb1d059fcdc7efbbd76ab90ea93679cd3
4
+ data.tar.gz: 51c56de5ee8f626bef1f4650b47e00a3d42c5d55
5
5
  SHA512:
6
- metadata.gz: 0cd6f132c177e1e1ca21dd40db3b79dfb509f9d81a78297c34a2630e9d5d0f04498ae840c68e4668c3e8c05ed75027c330a3d8bb9a1556bde15238f1bd1dea6d
7
- data.tar.gz: 6f3aab19e6473acd3a278509295c7c7abc28224e90cb8d6d258d58ebf2147094c99751eacfba46658345f74a6d44c6916a615b5025a19fd98f22a8425ffd39fb
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
  ![assets/icon175x175_shield_1.2-2031-orange.png](assets/icon175x175_shield_1.2-2031-orange.png?raw=1) ![assets/icon175x175_fitrack_shield_1.2-2031-orange.png](assets/icon175x175_fitrack_shield_1.2-2031-orange.png?raw=1)
32
32
 
33
+ badge --shield="1.2-2031-orange" --no_badge --shield_no_resize
34
+
35
+ ![assets/icon175x175_shield_1.2-2031-orange-no-resize.png](assets/icon175x175_shield_1.2-2031-orange-no-resize.png?raw=1) ![assets/icon175x175_fitrack_shield_1.2-2031-orange-no-resize.png](assets/icon175x175_fitrack_shield_1.2-2031-orange-no-resize.png?raw=1)
36
+
33
37
  badge --shield="Version-0.0.3-blue" --dark
34
38
 
35
39
  ![assets/icon175x175_shield_Version-0.0.3-blue.png](assets/icon175x175_shield_Version-0.0.3-blue.png?raw=1) ![assets/icon175x175_fitrack_shield_Version-0.0.3-blue.png](assets/icon175x175_fitrack_shield_Version-0.0.3-blue.png?raw=1)
36
40
 
41
+ badge --shield="Version-0.0.3-blue" --dark --shield_no_resize
42
+
43
+ ![assets/icon175x175_shield_Version-0.0.3-blue-no-resize.png](assets/icon175x175_shield_Version-0.0.3-blue-no-resize.png?raw=1) ![assets/icon175x175_fitrack_shield_Version-0.0.3-blue-no-resize.png](assets/icon175x175_fitrack_shield_Version-0.0.3-blue-no-resize.png?raw=1)
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
- `--shield-gravity=North` changes the postion of the shield on the icon. Choices include: NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast.
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
@@ -1,6 +1,6 @@
1
1
  module Badge
2
2
 
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  DESCRIPTION = "Add a badge overlay to your ios app icon"
5
5
 
6
6
  def self.root
@@ -39,4 +39,8 @@ module Badge
39
39
  10
40
40
  end
41
41
 
42
+ def self.shield_io_retries
43
+ 10
44
+ end
45
+
42
46
  end
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.0
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-02-28 00:00:00.000000000 Z
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.0.2
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.0.2
61
- description: 0.4.0
60
+ version: 4.5.1
61
+ description: 0.4.1
62
62
  email:
63
63
  - daniel.griesser.86@gmail.com
64
64
  executables: