lolcommits-loltext 0.1.0 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -3
- data/PULL_REQUEST_TEMPLATE.md +1 -1
- data/README.md +3 -3
- data/lib/lolcommits/loltext/version.rb +1 -1
- data/lib/lolcommits/plugin/loltext.rb +22 -16
- data/lolcommits-loltext.gemspec +0 -1
- data/test/lolcommits/plugin/loltext_test.rb +0 -4
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1241a6508c14df43bcd23a741b41b6019ad1f7ade49aafb514e5b1f76c66eeca
|
4
|
+
data.tar.gz: 4e910956ce8db81fedae758c9923a742b433f491dc5c2682f5f34b280e954ea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32bd95efb302944370421278c9db566c595229c2a56c0c973b46d23031a05494b0a2c71fb288154d7020470d6067122d0f47565d05c5eee7021ee7a35de66d44
|
7
|
+
data.tar.gz: 638f9359c3b70544d4acd0b99ad38aa01e126e30248438acce560d13ab4be192a381d89fcf41d0365bcae3ac40338596409921335a3804e092acea8362aeb39b
|
data/CHANGELOG.md
CHANGED
@@ -2,13 +2,22 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
The format is based on [Keep a Changelog][KeepAChangelog] and this
|
6
|
-
adheres to [Semantic Versioning][Semver].
|
5
|
+
The format is based on [Keep a Changelog][KeepAChangelog] and this
|
6
|
+
project adheres to [Semantic Versioning][Semver].
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
10
|
- Your contribution here!
|
11
11
|
|
12
|
+
## [0.2.3] - 2019-05-10
|
13
|
+
### Changed
|
14
|
+
- use runner.overlay instance to build overlay (requires at least
|
15
|
+
lolcommits 0.14.0)
|
16
|
+
- improved debug messages throughout
|
17
|
+
|
18
|
+
### Removed
|
19
|
+
- Support for lolcommits < 0.14.0
|
20
|
+
|
12
21
|
## [0.1.0] - 2019-04-24
|
13
22
|
### Removed
|
14
23
|
- Support for Ruby < 2.3 (older rubies no longer supported)
|
@@ -63,7 +72,8 @@ adheres to [Semantic Versioning][Semver].
|
|
63
72
|
### Changed
|
64
73
|
- Initial release (Yanked)
|
65
74
|
|
66
|
-
[Unreleased]: https://github.com/lolcommits/lolcommits-loltext/compare/v0.1
|
75
|
+
[Unreleased]: https://github.com/lolcommits/lolcommits-loltext/compare/v0.2.1...HEAD
|
76
|
+
[0.2.1]: https://github.com/lolcommits/lolcommits-loltext/compare/v0.1.0...v0.2.1
|
67
77
|
[0.1.0]: https://github.com/lolcommits/lolcommits-loltext/compare/v0.9.0...v0.1.0
|
68
78
|
[0.0.9]: https://github.com/lolcommits/lolcommits-loltext/compare/v0.0.8...v0.0.9
|
69
79
|
[0.0.8]: https://github.com/lolcommits/lolcommits-loltext/compare/v0.0.7...v0.0.8
|
data/PULL_REQUEST_TEMPLATE.md
CHANGED
@@ -6,7 +6,7 @@ Explain what you're changing and why here.
|
|
6
6
|
|
7
7
|
Please check this list and leave it intact for the reviewer. Thanks! :heart:
|
8
8
|
|
9
|
-
- [ ] Commit messages provide context (why not just what, some tips [here](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)).
|
9
|
+
- [ ] Commit messages to provide context (why not just what, some tips [here](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)).
|
10
10
|
- [ ] If relevant, mention GitHub issue number above and include in a commit message.
|
11
11
|
- [ ] Latest code from master merged.
|
12
12
|
- [ ] New behaviour has test coverage.
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Lolcommits Loltext
|
2
2
|
|
3
3
|
[![Gem](https://img.shields.io/gem/v/lolcommits-loltext.svg?style=flat)](http://rubygems.org/gems/lolcommits-loltext)
|
4
|
-
[![Travis](https://
|
4
|
+
[![Travis](https://img.shields.io/travis/com/lolcommits/lolcommits-loltext/master.svg?style=flat)](https://travis-ci.com/lolcommits/lolcommits-loltext)
|
5
5
|
[![Depfu](https://img.shields.io/depfu/lolcommits/lolcommits-loltext.svg?style=flat)](https://depfu.com/github/lolcommits/lolcommits-loltext)
|
6
6
|
[![Maintainability](https://api.codeclimate.com/v1/badges/2e0fa03867952572c5db/maintainability)](https://codeclimate.com/github/lolcommits/lolcommits-loltext/maintainability)
|
7
7
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/2e0fa03867952572c5db/test_coverage)](https://codeclimate.com/github/lolcommits/lolcommits-loltext/test_coverage)
|
@@ -142,7 +142,7 @@ GitHub.
|
|
142
142
|
|
143
143
|
When submitting pull requests, remember to add tests covering any new behaviour,
|
144
144
|
and ensure all tests are passing on [Travis
|
145
|
-
CI](https://travis-ci.
|
145
|
+
CI](https://travis-ci.com/lolcommits/lolcommits-loltext). Read the
|
146
146
|
[contributing
|
147
147
|
guidelines](https://github.com/lolcommits/lolcommits-loltext/blob/master/CONTRIBUTING.md)
|
148
148
|
for more details.
|
@@ -160,7 +160,7 @@ The gem is available as open source under the terms of
|
|
160
160
|
|
161
161
|
## Links
|
162
162
|
|
163
|
-
* [Travis CI](https://travis-ci.
|
163
|
+
* [Travis CI](https://travis-ci.com/lolcommits/lolcommits-loltext)
|
164
164
|
* [Test Coverage](https://codeclimate.com/github/lolcommits/lolcommits-loltext/test_coverage)
|
165
165
|
* [Code Climate](https://codeclimate.com/github/lolcommits/lolcommits-loltext)
|
166
166
|
* [RDoc](http://rdoc.info/projects/lolcommits/lolcommits-loltext)
|
@@ -68,36 +68,42 @@ module Lolcommits
|
|
68
68
|
#
|
69
69
|
# Post-capture hook, runs after lolcommits captures a snapshot.
|
70
70
|
#
|
71
|
-
#
|
71
|
+
# Annotate runner overlay with message, sha, optional border,
|
72
|
+
# and semi-transparent colored background (based on config)
|
72
73
|
#
|
73
74
|
def run_post_capture
|
74
|
-
debug
|
75
|
-
image = MiniMagick::Image.open(runner.main_image)
|
75
|
+
debug "creating annotation overlay with MiniMagick"
|
76
76
|
if config_option(:overlay, :enabled)
|
77
|
-
|
78
|
-
|
79
|
-
|
77
|
+
color = config_option(:overlay, :overlay_colors).split(',').map(&:strip).sample
|
78
|
+
overlay_percent = config_option(:overlay, :overlay_percent).to_f
|
79
|
+
debug "adding colorized overlay (#{color} at #{overlay_percent}% opacity)"
|
80
|
+
overlay_percent = (255 * (overlay_percent/100)).round
|
81
|
+
|
82
|
+
runner.overlay.combine_options do |c|
|
83
|
+
c.fill "#{color}#{sprintf('%02X',overlay_percent)}"
|
84
|
+
c.draw "color 0,0 reset"
|
80
85
|
end
|
81
86
|
end
|
82
87
|
|
83
88
|
if config_option(:border, :enabled)
|
84
|
-
|
85
|
-
|
89
|
+
debug "adding border (#{config_option(:border, :size)}px #{config_option(:border, :color)})"
|
90
|
+
# mogrify doesn't allow compose, format forces use of convert
|
91
|
+
runner.overlay.format("PNG32") do |c|
|
92
|
+
c.compose "Copy"
|
93
|
+
c.shave config_option(:border, :size)
|
86
94
|
c.bordercolor config_option(:border, :color)
|
95
|
+
c.border config_option(:border, :size)
|
87
96
|
end
|
88
97
|
end
|
89
98
|
|
90
|
-
annotate(
|
91
|
-
annotate(
|
92
|
-
debug "Writing changed file to #{runner.main_image}"
|
93
|
-
image.write runner.main_image
|
99
|
+
annotate(runner.overlay, :message, clean_msg(runner.message))
|
100
|
+
annotate(runner.overlay, :sha, runner.sha)
|
94
101
|
end
|
95
102
|
|
96
|
-
|
97
103
|
private
|
98
104
|
|
99
105
|
def annotate(image, type, string)
|
100
|
-
debug("annotating #{type}
|
106
|
+
debug("annotating #{type} text (#{string})")
|
101
107
|
|
102
108
|
transformed_position = position_transform(config_option(type, :position))
|
103
109
|
annotate_location = '0'
|
@@ -118,12 +124,12 @@ module Lolcommits
|
|
118
124
|
string.upcase! if config_option(type, :uppercase)
|
119
125
|
|
120
126
|
image.combine_options do |c|
|
121
|
-
c.strokewidth
|
127
|
+
c.strokewidth 2
|
122
128
|
c.interline_spacing(-(config_option(type, :size) / 5))
|
123
129
|
c.stroke config_option(type, :stroke_color)
|
124
130
|
c.fill config_option(type, :color)
|
125
131
|
c.gravity transformed_position
|
126
|
-
c.pointsize
|
132
|
+
c.pointsize config_option(type, :size)
|
127
133
|
c.font config_option(type, :font)
|
128
134
|
c.annotate annotate_location, string
|
129
135
|
end
|
data/lolcommits-loltext.gemspec
CHANGED
@@ -40,7 +40,6 @@ Gem::Specification.new do |spec|
|
|
40
40
|
|
41
41
|
spec.required_ruby_version = ">= 2.3"
|
42
42
|
|
43
|
-
spec.add_development_dependency "lolcommits", ">= 0.11.0"
|
44
43
|
spec.add_development_dependency "bundler"
|
45
44
|
spec.add_development_dependency "rake"
|
46
45
|
spec.add_development_dependency "minitest"
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolcommits-loltext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Hutchinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: lolcommits
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.11.0
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.11.0
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: bundler
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|