lolcommits-loltext 0.0.4 → 0.0.5
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 +4 -4
- data/lib/lolcommits/loltext/version.rb +1 -1
- data/lib/lolcommits/plugin/loltext.rb +24 -3
- data/test/lolcommits/plugin/loltext_test.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9348cdaa338b881bf19eca6ad2afaae9c94b761
|
4
|
+
data.tar.gz: 4c90aeb629125bcc2f2eab8bf3f106f779d8ee7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a104bdf1586ba5a459c47cc5dde0033ff90dea112f4918c02967a695c1b6db087ab1a44c7eadaf3f6c305e466b80a83734c474f8eb0a6b3074dfe20533d83abd
|
7
|
+
data.tar.gz: b813527f9fb04adbd84873687bfef1f6c5c43dc896307a4334f0196b0adfd46b0d3a19dd4b26806d76bd244110600c116888559e893733ddad1e2fa24e90fefb
|
@@ -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
|
-
|
112
|
-
if
|
113
|
-
|
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
|