badge 0.9.1 → 0.10.0

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: 8b76f289f68758fca7336bcc65e74f3355cd8093
4
- data.tar.gz: 0dd1487b77b8ffa9bbbbd4f7add644dd873177f4
3
+ metadata.gz: 4f35b608b69cb5df1e074afcf9e22b86e9df1ff3
4
+ data.tar.gz: d42e1c422a6df931b788bbeeb38dedd6d94b05db
5
5
  SHA512:
6
- metadata.gz: d6046d98ed9461aa1a417e6c0732d7e4640db279b4fa03d395474ae16f773ccdbf7ea610b04e782a6292bd04981ac885a23d2f5156e53af4fd3eacfb971abd6c
7
- data.tar.gz: c69c1f80f0a9e0798432e0cc61479a025d5aaee47c526db59bcf8d73547cc7d75539947217988e8005c79aa06c37f5765fbab5faddbc5378ce710d22f0cb749e
6
+ metadata.gz: 6b4310af842058b5c6652490f731ecbd38cfb964de22c8d023d491a981dd377419acfd5c681e932af3d1344de9475bb646f4cf7031ef3432fbe0018cdefc8ad1
7
+ data.tar.gz: da51d9f45ece4401fd1bd8e4b47625ae86800f34b776a44f0c899fb0131d009ff2be72ea07b096c5180e6c82dc3d23e7a1c82143730021b1a98313d2bef223f6
data/README.md CHANGED
@@ -104,6 +104,8 @@ Sometimes the response from shields.io takes a long time and can timeout. You ca
104
104
 
105
105
  `--shield_gravity North` changes the postion of the shield on the icon. Choices include: NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast.
106
106
 
107
+ `--shield_parameters "colorA=abcdef&style=flat"` changes the parameters of the shield image. It uses a string of key-value pairs separated by ampersand as specified on shields.io, eg: colorA=abcdef&style=flat.
108
+
107
109
  In version [0.4.0](https://github.com/HazAT/badge/releases/tag/0.4.0) 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.
108
110
 
109
111
  Add ```--no_badge``` as an option to hide the beta badge completely if you just want to add a shield.
@@ -1,6 +1,6 @@
1
1
  module Badge
2
2
 
3
- VERSION = "0.9.1"
3
+ VERSION = "0.10.0"
4
4
  DESCRIPTION = "Add a badge overlay to your app icon"
5
5
 
6
6
  def self.root
@@ -40,6 +40,10 @@ module Badge
40
40
  description: "Overlay a shield from shields.io on your icon, eg: Version-1.2-green",
41
41
  optional: true),
42
42
 
43
+ FastlaneCore::ConfigItem.new(key: :shield_parameters,
44
+ description: "Parameters of the shield image. String of key-value pairs separated by ampersand as specified on shields.io, eg: colorA=abcdef&style=flat",
45
+ optional: true),
46
+
43
47
  FastlaneCore::ConfigItem.new(key: :shield_io_timeout,
44
48
  description: "The timeout in seconds we should wait the get a response from shields.io",
45
49
  type: Integer,
@@ -35,7 +35,7 @@ module Badge
35
35
  timeout = Badge.shield_io_timeout
36
36
  timeout = options[:shield_io_timeout] if options[:shield_io_timeout]
37
37
  Timeout.timeout(timeout.to_i) do
38
- shield = load_shield(options[:shield]) if options[:shield]
38
+ shield = load_shield(options[:shield], options[:shield_parameters]) if options[:shield]
39
39
  end
40
40
  rescue Timeout::Error
41
41
  UI.error "Error loading image from shields.io timeout reached. Use --verbose for more info".red
@@ -127,8 +127,11 @@ module Badge
127
127
  result = composite(result, new_shield, alpha_channel, shield_gravity || "north", shield_geometry)
128
128
  end
129
129
 
130
- def load_shield(shield_string)
130
+ def load_shield(shield_string, shield_parameters)
131
131
  url = Badge.shield_base_url + Badge.shield_path + shield_string + (@@rsvg_enabled ? ".svg" : ".png")
132
+ if shield_parameters
133
+ url = url + "?" + shield_parameters
134
+ end
132
135
  file_name = shield_string + (@@rsvg_enabled ? ".svg" : ".png")
133
136
 
134
137
  UI.verbose "Trying to load image from shields.io. Timeout: #{Badge.shield_io_timeout}s".blue
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.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Griesser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-05 00:00:00.000000000 Z
11
+ date: 2018-11-27 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.9.1
69
+ description: 0.10.0
70
70
  email:
71
71
  - daniel.griesser.86@gmail.com
72
72
  executables:
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.5.2
109
+ rubygems_version: 2.5.2.3
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Add a badge overlay to your app icon