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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af74b544968827ee8ecfe6ae294071c88e8669b6378a18710d54f6c1ac82c5a9
4
- data.tar.gz: a167638aceac00e098dc30fa31dc786cde2189958d9d0cb27632f1400c62af89
3
+ metadata.gz: 1241a6508c14df43bcd23a741b41b6019ad1f7ade49aafb514e5b1f76c66eeca
4
+ data.tar.gz: 4e910956ce8db81fedae758c9923a742b433f491dc5c2682f5f34b280e954ea5
5
5
  SHA512:
6
- metadata.gz: 369194a5f82bcb37cb01140464bcaba3fe69beff5a0be2336cc1fbfa904abcfcf31a65e0f60b4f714ffe6fbb46d72dac2712a32f6775d03a76fc8285c5d4ad55
7
- data.tar.gz: a17ddc402d9fcc5bd09cb6f3b463aafc0e37599c179f99dcf90c7cb7048aecb1d539fc831ed273d9f5c92e2b068997cf446647995f348225be8d8b80a1d7a673
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 project
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.0...HEAD
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
@@ -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://travis-ci.org/lolcommits/lolcommits-loltext.svg?branch=master)](https://travis-ci.org/lolcommits/lolcommits-loltext)
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.org/lolcommits/lolcommits-loltext). Read the
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.org/lolcommits/lolcommits-loltext)
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lolcommits
4
4
  module Loltext
5
- VERSION = "0.1.0".freeze
5
+ VERSION = "0.2.3".freeze
6
6
  end
7
7
  end
@@ -68,36 +68,42 @@ module Lolcommits
68
68
  #
69
69
  # Post-capture hook, runs after lolcommits captures a snapshot.
70
70
  #
71
- # Annotates the image with the git commit message and sha text
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 'Annotating image via MiniMagick'
75
- image = MiniMagick::Image.open(runner.main_image)
75
+ debug "creating annotation overlay with MiniMagick"
76
76
  if config_option(:overlay, :enabled)
77
- image.combine_options do |c|
78
- c.fill config_option(:overlay, :overlay_colors).split(',').map(&:strip).sample
79
- c.colorize config_option(:overlay, :overlay_percent)
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
- image.combine_options do |c|
85
- c.border "#{config_option(:border, :size)}x#{config_option(:border, :size)}"
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(image, :message, clean_msg(runner.message))
91
- annotate(image, :sha, runner.sha)
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} to image with #{string}")
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 runner.capture_animated? ? '1' : '2'
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 runner.capture_animated? ? (config_option(type, :size) / 2) : config_option(type, :size)
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
@@ -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"
@@ -6,10 +6,6 @@ describe Lolcommits::Plugin::Loltext do
6
6
 
7
7
  include Lolcommits::TestHelpers::FakeIO
8
8
 
9
- def plugin_name
10
- 'loltext'
11
- end
12
-
13
9
  it 'should run on post capturing' do
14
10
  ::Lolcommits::Plugin::Loltext.runner_order.must_equal [:post_capture]
15
11
  end
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.1.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-04-24 00:00:00.000000000 Z
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