badge 0.8.7 → 0.9.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: b4690e5853b9ba97e9b5741603e278f27092de1b
4
- data.tar.gz: 3ce2164672c0cf303563246a3fd866691171c8a5
3
+ metadata.gz: 0d501aaf87aefbb2c0b0cf15b5b0aa72612a7008
4
+ data.tar.gz: 795a37d2fea3c8900806c73eef04a22d4459076d
5
5
  SHA512:
6
- metadata.gz: d425e77cb3315bb7fd1145462c6df28bf3050d312fee8ab2ebde6c3e837cfaa9d97d45219d9202fb78b35aedf2a2e85766ec4b176aae2775e5e5f297fb00fca6
7
- data.tar.gz: dc4d29a721b0ec1e64d9681c16b7a67aac070967a1928e685062e7309ce95ed6eed24b657c58022749c70227f618f9d0e41007316976adc38fef68171c06a90a
6
+ metadata.gz: 958509781bdf8f9131da9bbd46c5406aaece814c398bb12640664744cb1e92be26e075dc0080aa2fb1e6a7a14b1f000e887fcb7ca4e44118d123ee20e24f41f3
7
+ data.tar.gz: b4a3a0c5fb4c358ad9302085883eb676678d4373f167c92b0ee1934f7722fa1ba55eea6bbd7c75a4bffcb82bfdd26e76683632f0faff0afc38e6da7c6b8b96ad
data/README.md CHANGED
@@ -57,6 +57,12 @@ badge --shield "Version-0.0.3-blue" --dark --shield_geometry "+0+25%" --shield_s
57
57
 
58
58
  ![assets/icon175x175_shield_Version-0.0.3-blue-geo-scale.png](assets/icon175x175_shield_Version-0.0.3-blue-geo-scale.png?raw=1) ![assets/icon175x175_fitrack_shield_Version-0.0.3-blue-geo-scale.png](assets/icon175x175_fitrack_shield_Version-0.0.3-blue-geo-scale.png?raw=1)
59
59
  ---
60
+ ```
61
+ badge --grayscale --shield "Version-0.0.3-blue" --dark
62
+ ```
63
+
64
+ ![assets/icon175x175_grayscale.png](assets/icon175x175_grayscale.png?raw=1) ![assets/icon175x175_fitrack_grayscale.png](assets/icon175x175_fitrack_grayscale.png?raw=1)
65
+ ---
60
66
 
61
67
  # Installation
62
68
 
data/lib/badge/base.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Badge
2
2
 
3
- VERSION = "0.8.7"
3
+ VERSION = "0.9.0"
4
4
  DESCRIPTION = "Add a badge overlay to your app icon"
5
5
 
6
6
  def self.root
data/lib/badge/options.rb CHANGED
@@ -2,6 +2,7 @@ require 'fastlane_core'
2
2
 
3
3
  module Badge
4
4
  class Options
5
+ AVAILABLE_GRAVITIES = %w(NorthWest North NorthEast West Center East SouthWest South SouthEast)
5
6
  def self.available_options
6
7
  [
7
8
  FastlaneCore::ConfigItem.new(key: :dark,
@@ -29,7 +30,10 @@ module Badge
29
30
  optional: true),
30
31
 
31
32
  FastlaneCore::ConfigItem.new(key: :badge_gravity,
32
- description: "Position of the badge on icon. Default: SouthEast - Choices include: NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast",
33
+ description: "Position of the badge on icon. Default: SouthEast - Choices include: #{AVAILABLE_GRAVITIES.join(', ')}",
34
+ verify_block: proc do |value|
35
+ UI.user_error!("badge_gravity #{value} is invalid") unless AVAILABLE_GRAVITIES.include?
36
+ end,
33
37
  optional: true),
34
38
 
35
39
  FastlaneCore::ConfigItem.new(key: :shield,
@@ -60,6 +64,12 @@ module Badge
60
64
 
61
65
  FastlaneCore::ConfigItem.new(key: :glob,
62
66
  description: "Glob pattern for finding image files Default: CURRENT_PATH/**/*.appiconset/*.{png,PNG}",
67
+ optional: true),
68
+
69
+ FastlaneCore::ConfigItem.new(key: :grayscale,
70
+ description: "Whether making icons to grayscale",
71
+ is_string: false,
72
+ default_value: false,
63
73
  optional: true)
64
74
  ]
65
75
  end
data/lib/badge/runner.rb CHANGED
@@ -68,6 +68,10 @@ module Badge
68
68
 
69
69
  result = MiniMagick::Image.new(full_path)
70
70
 
71
+ if options[:grayscale]
72
+ result.colorspace 'gray'
73
+ icon_changed = true
74
+ end
71
75
  if !options[:no_badge]
72
76
  result = add_badge(options[:custom], options[:dark], icon, options[:alpha], alpha_channel, options[:badge_gravity])
73
77
  icon_changed = true
@@ -76,7 +80,6 @@ module Badge
76
80
  result = add_shield(icon, result, shield, alpha_channel, options[:shield_gravity], options[:shield_no_resize], options[:shield_scale], options[:shield_geometry])
77
81
  icon_changed = true
78
82
  end
79
-
80
83
  if icon_changed
81
84
  result.format "png"
82
85
  result.write full_path
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.7
4
+ version: 0.9.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-01-08 00:00:00.000000000 Z
11
+ date: 2018-04-04 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.7
69
+ description: 0.9.0
70
70
  email:
71
71
  - daniel.griesser.86@gmail.com
72
72
  executables: