lolcommits-loltext 0.0.4 → 0.0.5

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: 51d6d7c8bb936f01b7547edc01220ae9039f5e9e
4
- data.tar.gz: 4c0d237d372dc538e31cb79121fed7266e15d1b9
3
+ metadata.gz: f9348cdaa338b881bf19eca6ad2afaae9c94b761
4
+ data.tar.gz: 4c90aeb629125bcc2f2eab8bf3f106f779d8ee7f
5
5
  SHA512:
6
- metadata.gz: f7f36e5c3b3f66683861f32824e4885c6a90540eb74a1f89589f3caa0e52ff5f01f9b343c22e2c0e5f91451c5aaac226a3aaa77d2fd955da3dde8cf7ac00c78b
7
- data.tar.gz: 1a543e9e05fc31bf792480bcbcc5a36566afbfa0108f93849acae8204f5b72d2a72285f9f5db13a05660caf9c995a05ca89e6873d29b733702804bba1af7fe94
6
+ metadata.gz: a104bdf1586ba5a459c47cc5dde0033ff90dea112f4918c02967a695c1b6db087ab1a44c7eadaf3f6c305e466b80a83734c474f8eb0a6b3074dfe20533d83abd
7
+ data.tar.gz: b813527f9fb04adbd84873687bfef1f6c5c43dc896307a4334f0196b0adfd46b0d3a19dd4b26806d76bd244110600c116888559e893733ddad1e2fa24e90fefb
@@ -1,5 +1,5 @@
1
1
  module Lolcommits
2
2
  module Loltext
3
- VERSION = "0.0.4".freeze
3
+ VERSION = "0.0.5".freeze
4
4
  end
5
5
  end
@@ -73,6 +73,7 @@ module Lolcommits
73
73
  options[:message] = configure_sub_options(:message)
74
74
  options[:sha] = configure_sub_options(:sha)
75
75
  options[:overlay] = configure_sub_options(:overlay)
76
+ options[:border] = configure_sub_options(:border)
76
77
  end
77
78
  options
78
79
  end
@@ -93,6 +94,13 @@ module Lolcommits
93
94
  end
94
95
  end
95
96
 
97
+ if config_option(:border, :enabled)
98
+ image.combine_options do |c|
99
+ c.border "#{config_option(:border, :size)}x#{config_option(:border, :size)}"
100
+ c.bordercolor config_option(:border, :color)
101
+ end
102
+ end
103
+
96
104
  annotate(image, :message, clean_msg(runner.message))
97
105
  annotate(image, :sha, runner.sha)
98
106
  debug "Writing changed file to #{runner.main_image}"
@@ -108,9 +116,17 @@ module Lolcommits
108
116
  transformed_position = position_transform(config_option(type, :position))
109
117
  annotate_location = '0'
110
118
 
111
- # move South gravity off the edge of the image.
112
- if transformed_position == 'South'
113
- annotate_location = '+0+20'
119
+ padded_annotation = 10
120
+ if config_option(:border, :enabled)
121
+ padded_annotation = padded_annotation + config_option(:border, :size)
122
+ end
123
+
124
+ # move all positions off the edge of the image
125
+ case transformed_position
126
+ when "South"
127
+ annotate_location = "+0+#{padded_annotation}"
128
+ when "NorthWest", "SouthWest", "NorthEast", "SouthEast"
129
+ annotate_location = "+#{padded_annotation}+#{padded_annotation}"
114
130
  end
115
131
 
116
132
  string.upcase! if config_option(type, :uppercase)
@@ -177,6 +193,11 @@ module Lolcommits
177
193
  '#5566ac', '#ed8833', '#f8991c', '#408c93', '#ba9109'
178
194
  ],
179
195
  overlay_percent: 50
196
+ },
197
+ border: {
198
+ color: 'white',
199
+ enabled: false,
200
+ size: 10,
180
201
  }
181
202
  }
182
203
  end
@@ -85,6 +85,9 @@ describe Lolcommits::Plugin::Loltext do
85
85
  # styling overlay
86
86
  inputs += %w(true #2884ae,#7e231f 40)
87
87
 
88
+ # border options
89
+ inputs += %w(#e96d46 true 23)
90
+
88
91
  configured_plugin_options = {}
89
92
  output = fake_io_capture(inputs: inputs) do
90
93
  configured_plugin_options = plugin.configure_options!
@@ -112,6 +115,11 @@ describe Lolcommits::Plugin::Loltext do
112
115
  enabled: true,
113
116
  overlay_colors: ['#2884ae', '#7e231f'],
114
117
  overlay_percent: 40
118
+ },
119
+ border: {
120
+ color: '#e96d46',
121
+ enabled: true,
122
+ size: 23,
115
123
  }
116
124
  })
117
125
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lolcommits-loltext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Hutchinson