badge 0.4.1 → 0.4.2

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: e2161bbfb1d059fcdc7efbbd76ab90ea93679cd3
4
- data.tar.gz: 51c56de5ee8f626bef1f4650b47e00a3d42c5d55
3
+ metadata.gz: 2c6e7be74490391b278353a104c112c35e79c34f
4
+ data.tar.gz: 46e3549960cdac887b7b021881461bf1f696050f
5
5
  SHA512:
6
- metadata.gz: fe4b7904c1f4c189c6fab078081ed4c49303fa387ed1453d24a7a338c58f85a99cb380c2253eab1e7171a739d3a31654b2a9e0976cde8e4bf3cd21b101d4c7df
7
- data.tar.gz: 1a1972462e533c4c70cfe4c1d8526cbc6242d3677326e2c77ad9c15a52d6555c0f12c8443b618276a92b4eaf5e4cd43aede4060c8ae411c5cfd761c72168608b
6
+ metadata.gz: a847598a6267a7d239febb141a3f918bcec7517256619878123e0f5da56e67406b62672a3faf1b251a38df7da42642dbb8e0cba3262fdfb674a8230f01ce6f69
7
+ data.tar.gz: a931a652cbe50b3dd3955162b2007bffcb303846d9a15aafbc482f7d29d4bbfe88b55938b7be13060e2750301c8a467979333064b82233701d222babe5b54974
data/README.md CHANGED
@@ -79,7 +79,7 @@ Sometimes the response from shield.io takes a long time and can timeout. You can
79
79
 
80
80
  `--shield_gravity=North` changes the postion of the shield on the icon. Choices include: NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast.
81
81
 
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.
82
+ 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.
83
83
 
84
84
  Add ```--no_badge``` as an option to hide the beta badge completely if you just want to add a shield.
85
85
 
@@ -114,7 +114,10 @@ end
114
114
  If Jenkins has problems finding imagemagick on your mac add following env variable to your job:
115
115
 
116
116
  PATH=$PATH:/usr/local/bin
117
+
118
+ Make sure you have imagemagick installed on your machine e.g. for Mac its:
117
119
 
120
+ brew install imagemagick
118
121
 
119
122
  ## Uninstall
120
123
 
@@ -4,5 +4,5 @@ require 'badge/runner'
4
4
  require 'fastlane_core'
5
5
  #
6
6
  module Badge
7
- Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
7
+ UI = FastlaneCore::UI
8
8
  end
@@ -1,6 +1,6 @@
1
1
  module Badge
2
2
 
3
- VERSION = "0.4.1"
3
+ VERSION = "0.4.2"
4
4
  DESCRIPTION = "Add a badge overlay to your ios app icon"
5
5
 
6
6
  def self.root
@@ -8,11 +8,11 @@ module Badge
8
8
 
9
9
  def run(path, options)
10
10
  glob = "/**/*.appiconset/*.{png,PNG}"
11
- glob = options[:glob] unless not options[:glob]
11
+ glob = options[:glob] if options[:glob]
12
12
 
13
13
  app_icons = Dir.glob("#{path}#{glob}")
14
- Helper.log.info "Verbose active...".blue unless not $verbose
15
- Helper.log.info "Parameters: #{options.inspect}".blue unless not $verbose
14
+ UI.verbose "Verbose active...".blue
15
+ UI.verbose "Parameters: #{options.inspect}".blue
16
16
 
17
17
  alpha_channel = false
18
18
  if options[:alpha_channel]
@@ -20,29 +20,29 @@ module Badge
20
20
  end
21
21
 
22
22
  if app_icons.count > 0
23
- Helper.log.info "Start adding badges...".green
23
+ UI.message "Start adding badges...".green
24
24
 
25
25
  shield = nil
26
26
  response_error = false
27
27
  begin
28
28
  timeout = Badge.shield_io_timeout
29
- timeout = options[:shield_io_timeout] unless not options[:shield_io_timeout]
29
+ timeout = options[:shield_io_timeout] if options[:shield_io_timeout]
30
30
  Timeout.timeout(timeout.to_i) do
31
- shield = load_shield(options[:shield]) unless not options[:shield]
31
+ shield = load_shield(options[:shield]) if options[:shield]
32
32
  end
33
33
  rescue Timeout::Error
34
- Helper.log.error "Error loading image from shield.io timeout reached. Skipping Shield. Use --verbose for more info".red
34
+ UI.error "Error loading image from shield.io timeout reached. Skipping Shield. Use --verbose for more info".red
35
35
  rescue OpenURI::HTTPError => error
36
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
37
+ UI.error "Error loading image from shield.io response Error. Skipping Shield. Use --verbose for more info".red
38
+ UI.error response.status if $verbose
39
39
  response_error = true
40
40
  end
41
41
 
42
42
  if @@retry_count <= 0
43
- Helper.log.error "Cannot load image from shield.io skipping it...".red
43
+ UI.error "Cannot load image from shield.io skipping it...".red
44
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
45
+ UI.message "Waiting for #{timeout.to_i}s and retry to load image from shield.io tries remaining: #{@@retry_count}".red
46
46
  sleep timeout.to_i
47
47
  @@retry_count -= 1
48
48
  return run(path, options)
@@ -70,18 +70,18 @@ module Badge
70
70
  end
71
71
  end
72
72
  if icon_changed
73
- Helper.log.info "Badged \\o/!".green
73
+ UI.message "Badged \\o/!".green
74
74
  else
75
- Helper.log.info "Did nothing... Enable --verbose for more info.".red
75
+ UI.message "Did nothing... Enable --verbose for more info.".red
76
76
  end
77
77
  else
78
- Helper.log.error "Could not find any app icons...".red
78
+ UI.error "Could not find any app icons...".red
79
79
  end
80
80
  end
81
81
 
82
82
  def add_shield(icon, result, shield, alpha_channel, shield_gravity, shield_no_resize)
83
- Helper.log.info "'#{icon.path}'"
84
- Helper.log.info "Adding shield.io image ontop of icon".blue unless not $verbose
83
+ UI.message "'#{icon.path}'"
84
+ UI.verbose "Adding shield.io image ontop of icon".blue
85
85
 
86
86
  current_shield = MiniMagick::Image.open(shield.path)
87
87
 
@@ -93,7 +93,7 @@ module Badge
93
93
 
94
94
  result = result.composite(current_shield, 'png') do |c|
95
95
  c.compose "Over"
96
- c.alpha 'On' unless !alpha_channel
96
+ c.alpha 'On' if alpha_channel
97
97
  if shield_gravity
98
98
  c.gravity shield_gravity
99
99
  else
@@ -106,8 +106,8 @@ module Badge
106
106
  url = Badge.shield_base_url + Badge.shield_path + shield_string + ".png"
107
107
  file_name = shield_string + ".png"
108
108
 
109
- Helper.log.info "Trying to load image from shield.io. Timeout: #{Badge.shield_io_timeout}s".blue unless not $verbose
110
- Helper.log.info "URL: #{url}".blue unless not $verbose
109
+ UI.verbose "Trying to load image from shield.io. Timeout: #{Badge.shield_io_timeout}s".blue
110
+ UI.verbose "URL: #{url}".blue
111
111
 
112
112
  shield = Tempfile.new(file_name).tap do |file|
113
113
  file.binmode
@@ -117,8 +117,8 @@ module Badge
117
117
  end
118
118
 
119
119
  def add_badge(custom_badge, dark_badge, icon, alpha_badge, alpha_channel)
120
- Helper.log.info "'#{icon.path}'"
121
- Helper.log.info "Adding badge image ontop of icon".blue unless not $verbose
120
+ UI.message "'#{icon.path}'"
121
+ UI.verbose "Adding badge image ontop of icon".blue
122
122
  if custom_badge && File.exist?(custom_badge) # check if custom image is provided
123
123
  badge = MiniMagick::Image.open(custom_badge)
124
124
  else
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.1
4
+ version: 0.4.2
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-05-04 00:00:00.000000000 Z
11
+ date: 2016-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.25.0
19
+ version: 0.44.0
20
20
  - - <
21
21
  - !ruby/object:Gem::Version
22
22
  version: 1.0.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.25.0
29
+ version: 0.44.0
30
30
  - - <
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.0
@@ -58,7 +58,7 @@ dependencies:
58
58
  - - ~>
59
59
  - !ruby/object:Gem::Version
60
60
  version: 4.5.1
61
- description: 0.4.1
61
+ description: 0.4.2
62
62
  email:
63
63
  - daniel.griesser.86@gmail.com
64
64
  executables: