lolcommits-sample_plugin 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +34 -0
- data/.github/workflows/push_gem.yml +25 -0
- data/.travis.yml +4 -4
- data/CHANGELOG.md +11 -1
- data/README.md +6 -12
- data/Rakefile +1 -11
- data/lib/lolcommits/sample_plugin/version.rb +1 -1
- data/lolcommits-plugin-sample.gemspec +2 -4
- metadata +9 -39
- data/test/lolcommits/plugin/sample_plugin_test.rb +0 -108
- data/test/test_helper.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4963638d9fb2e82c3d6668cc04840305be43caf5082685cf664888915ce3964e
|
4
|
+
data.tar.gz: afce17712fcd4941780a77589510408a9dca0d84154a8149d4966521c203eb7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f094d34b8a5e41d19918514e4eec00dac5ce45ff6d5741d5c634899ad4464ac1460b03be1f44a8bd8c319c9371fd1aaa75ed8429769d9dc26dd1148930ca76dd
|
7
|
+
data.tar.gz: cca703fa294bd230bb015bf67cb06bc657382f5bdc90083bdfad8c8b2c1cf79baf2489fe23e59bcc3d20ef0c780f16729ce5e41eaa4b8bfb45521f258da33203
|
@@ -0,0 +1,34 @@
|
|
1
|
+
name: Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ "main" ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ "main" ]
|
8
|
+
|
9
|
+
permissions:
|
10
|
+
contents: read
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
test:
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
strategy:
|
16
|
+
fail-fast: false
|
17
|
+
matrix:
|
18
|
+
ruby-version: ['3.1', '3.2', '3.3', '3.4']
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v4
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby-version }}
|
25
|
+
bundler-cache: true
|
26
|
+
- name: Configure git user name, email
|
27
|
+
run: |
|
28
|
+
git config --global user.name $NAME
|
29
|
+
git config --global user.email $EMAIL
|
30
|
+
env:
|
31
|
+
NAME: "George Costanza"
|
32
|
+
EMAIL: "george.costanza@vandelay.com"
|
33
|
+
- name: Run tests
|
34
|
+
run: bundle exec rake test
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: Publish gem to RubyGems.org
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- v*
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
push:
|
10
|
+
name: Push gem to RubyGems.org
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
permissions:
|
14
|
+
id-token: write
|
15
|
+
contents: write
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v4
|
19
|
+
- name: Set up Ruby
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
bundler-cache: true
|
23
|
+
ruby-version: ruby
|
24
|
+
|
25
|
+
- uses: rubygems/release-gem@v1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,14 @@ project adheres to [Semantic Versioning][Semver].
|
|
9
9
|
|
10
10
|
- Your contribution here!
|
11
11
|
|
12
|
+
## [0.5.0] - 2024-09-22
|
13
|
+
### Removed
|
14
|
+
- Support for Ruby < 3.1 (older rubies no longer supported)
|
15
|
+
|
16
|
+
## [0.4.0] - 2020-01-24
|
17
|
+
### Removed
|
18
|
+
- Support for Ruby < 2.4 (older rubies no longer supported)
|
19
|
+
|
12
20
|
## [0.3.0] - 2019-05-20
|
13
21
|
### Changed
|
14
22
|
- Requires at least lolcommits >= `0.14.2`
|
@@ -54,7 +62,9 @@ project adheres to [Semantic Versioning][Semver].
|
|
54
62
|
### Changed
|
55
63
|
- Initial release
|
56
64
|
|
57
|
-
[Unreleased]: https://github.com/lolcommits/lolcommits-sample_plugin/compare/v0.
|
65
|
+
[Unreleased]: https://github.com/lolcommits/lolcommits-sample_plugin/compare/v0.5.0...HEAD
|
66
|
+
[0.5.0]: https://github.com/lolcommits/lolcommits-sample_plugin/compare/v0.4.0...v0.5.0
|
67
|
+
[0.4.0]: https://github.com/lolcommits/lolcommits-sample_plugin/compare/v0.3.0...v0.4.0
|
58
68
|
[0.3.0]: https://github.com/lolcommits/lolcommits-sample_plugin/compare/v0.2.0...v0.3.0
|
59
69
|
[0.2.0]: https://github.com/lolcommits/lolcommits-sample_plugin/compare/v0.1.2...v0.2.0
|
60
70
|
[0.1.2]: https://github.com/lolcommits/lolcommits-sample_plugin/compare/v0.1.1...v0.1.2
|
data/README.md
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
# Lolcommits Sample Plugin
|
2
2
|
|
3
|
+
[![Build](https://img.shields.io/github/actions/workflow/status/lolcommits/lolcommits-sample_plugin/build.yml?branch=main&style=flat)](https://github.com/lolcommits/lolcommits-sample_plugin/actions/workflows/build.yml)
|
3
4
|
[![Gem](https://img.shields.io/gem/v/lolcommits-sample_plugin.svg?style=flat)](http://rubygems.org/gems/lolcommits-sample_plugin)
|
4
|
-
[![Travis](https://img.shields.io/travis/com/lolcommits/lolcommits-sample_plugin/master.svg?style=flat)](https://travis-ci.com/lolcommits/lolcommits-sample_plugin)
|
5
5
|
[![Depfu](https://img.shields.io/depfu/lolcommits/lolcommits-sample_plugin.svg?style=flat)](https://depfu.com/github/lolcommits/lolcommits-sample_plugin)
|
6
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/ce34ea41c79820a2fc75/maintainability)](https://codeclimate.com/github/lolcommits/lolcommits-sample_plugin/maintainability)
|
7
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/ce34ea41c79820a2fc75/test_coverage)](https://codeclimate.com/github/lolcommits/lolcommits-sample_plugin/test_coverage)
|
8
6
|
|
9
7
|
[lolcommits](https://lolcommits.github.io/) takes a snapshot with your
|
10
8
|
webcam every time you git commit code, and archives a lolcat style image
|
@@ -25,7 +23,7 @@ be enabled, you'll see something like this for a capture:
|
|
25
23
|
(it was an image!)
|
26
24
|
|
27
25
|
Use this repo to jump-start development on your own plugin. It has
|
28
|
-
tests, docs and hooks with useful tools;
|
26
|
+
tests, docs and hooks with useful tools; CI, Rdoc etc.
|
29
27
|
|
30
28
|
## Developing your own plugin
|
31
29
|
|
@@ -227,7 +225,7 @@ repo](https://github.com/lolcommits/lolcommits-sample_plugin/blob/master/test/lo
|
|
227
225
|
|
228
226
|
## Requirements
|
229
227
|
|
230
|
-
* Ruby >= 2.
|
228
|
+
* Ruby >= 2.4
|
231
229
|
* A webcam
|
232
230
|
* [ImageMagick](http://www.imagemagick.org)
|
233
231
|
* [ffmpeg](https://www.ffmpeg.org) (optional) for animated gif capturing
|
@@ -284,10 +282,8 @@ and [pull
|
|
284
282
|
requests](https://github.com/lolcommits/lolcommits-sample_plugin/pulls)
|
285
283
|
are welcome on GitHub.
|
286
284
|
|
287
|
-
When submitting pull requests, remember to add tests covering any new
|
288
|
-
|
289
|
-
CI](https://travis-ci.com/lolcommits/lolcommits-sample_plugin). Read the
|
290
|
-
[contributing
|
285
|
+
When submitting pull requests, remember to add tests covering any new behaviour,
|
286
|
+
and ensure all tests are passing on CI. Read the [contributing
|
291
287
|
guidelines](https://github.com/lolcommits/lolcommits-sample_plugin/blob/master/CONTRIBUTING.md)
|
292
288
|
for more details.
|
293
289
|
|
@@ -305,9 +301,7 @@ The gem is available as open source under the terms of
|
|
305
301
|
|
306
302
|
## Links
|
307
303
|
|
308
|
-
* [
|
309
|
-
* [Test Coverage](https://codeclimate.com/github/lolcommits/lolcommits-sample_plugin/test_coverage)
|
310
|
-
* [Code Climate](https://codeclimate.com/github/lolcommits/lolcommits-sample_plugin)
|
304
|
+
* [CI](https://github.com/lolcommits/lolcommits-sample_plugin/actions/workflows/build.yml)
|
311
305
|
* [RDoc](http://rdoc.info/projects/lolcommits/lolcommits-sample_plugin)
|
312
306
|
* [Issues](http://github.com/lolcommits/lolcommits-sample_plugin/issues)
|
313
307
|
* [Report a bug](http://github.com/lolcommits/lolcommits-sample_plugin/issues/new)
|
data/Rakefile
CHANGED
@@ -18,14 +18,4 @@ Rake::TestTask.new(:test) do |t|
|
|
18
18
|
t.test_files = FileList["test/**/*_test.rb"]
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
namespace :test do
|
23
|
-
desc "Run all tests and features and generate a code coverage report"
|
24
|
-
task :coverage do
|
25
|
-
ENV['COVERAGE'] = 'true'
|
26
|
-
Rake::Task['test'].execute
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
|
31
|
-
task :default => ['test:coverage']
|
21
|
+
task :default => ['test']
|
@@ -26,13 +26,11 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.executables = []
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
|
29
|
-
spec.required_ruby_version = ">=
|
29
|
+
spec.required_ruby_version = ">= 3.1"
|
30
30
|
|
31
|
-
spec.add_runtime_dependency "lolcommits", ">= 0.
|
31
|
+
spec.add_runtime_dependency "lolcommits", ">= 0.17.2"
|
32
32
|
|
33
33
|
spec.add_development_dependency "bundler"
|
34
34
|
spec.add_development_dependency "rake"
|
35
35
|
spec.add_development_dependency "minitest"
|
36
|
-
spec.add_development_dependency "simplecov"
|
37
|
-
spec.add_development_dependency "pry"
|
38
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolcommits-sample_plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Hutchinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lolcommits
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.17.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.17.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,34 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: simplecov
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: pry
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
69
|
description: Use this gem as a guide or template to get started with lolcommits plugin
|
98
70
|
development
|
99
71
|
email:
|
@@ -102,6 +74,8 @@ executables: []
|
|
102
74
|
extensions: []
|
103
75
|
extra_rdoc_files: []
|
104
76
|
files:
|
77
|
+
- ".github/workflows/build.yml"
|
78
|
+
- ".github/workflows/push_gem.yml"
|
105
79
|
- ".gitignore"
|
106
80
|
- ".simplecov"
|
107
81
|
- ".travis.yml"
|
@@ -119,8 +93,6 @@ files:
|
|
119
93
|
- lib/lolcommits/sample_plugin.rb
|
120
94
|
- lib/lolcommits/sample_plugin/version.rb
|
121
95
|
- lolcommits-plugin-sample.gemspec
|
122
|
-
- test/lolcommits/plugin/sample_plugin_test.rb
|
123
|
-
- test/test_helper.rb
|
124
96
|
homepage: https://github.com/lolcommits/lolcommits-sample_plugin
|
125
97
|
licenses:
|
126
98
|
- LGPL-3.0
|
@@ -138,17 +110,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
110
|
requirements:
|
139
111
|
- - ">="
|
140
112
|
- !ruby/object:Gem::Version
|
141
|
-
version: '
|
113
|
+
version: '3.1'
|
142
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
115
|
requirements:
|
144
116
|
- - ">="
|
145
117
|
- !ruby/object:Gem::Version
|
146
118
|
version: '0'
|
147
119
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
120
|
+
rubygems_version: 3.5.16
|
149
121
|
signing_key:
|
150
122
|
specification_version: 4
|
151
123
|
summary: Example gem for lolcommits plugin development
|
152
|
-
test_files:
|
153
|
-
- test/lolcommits/plugin/sample_plugin_test.rb
|
154
|
-
- test/test_helper.rb
|
124
|
+
test_files: []
|
@@ -1,108 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
describe Lolcommits::Plugin::SamplePlugin do
|
6
|
-
|
7
|
-
include Lolcommits::TestHelpers::GitRepo
|
8
|
-
include Lolcommits::TestHelpers::FakeIO
|
9
|
-
|
10
|
-
describe 'with a runner' do
|
11
|
-
def runner
|
12
|
-
# a simple lolcommits runner with an empty configuration Hash
|
13
|
-
@runner ||= Lolcommits::Runner.new(
|
14
|
-
lolcommit_path: "/path/to/lolcommit.jpg"
|
15
|
-
)
|
16
|
-
end
|
17
|
-
|
18
|
-
def plugin
|
19
|
-
@plugin ||= Lolcommits::Plugin::SamplePlugin.new(runner: runner)
|
20
|
-
end
|
21
|
-
|
22
|
-
def valid_enabled_config
|
23
|
-
{
|
24
|
-
enabled: true,
|
25
|
-
ask_for_cheese: false,
|
26
|
-
always_a_great_commit?: true,
|
27
|
-
camera_emoji: {
|
28
|
-
enabled: true,
|
29
|
-
emoji_multiplier: 5
|
30
|
-
}
|
31
|
-
}
|
32
|
-
end
|
33
|
-
|
34
|
-
describe '#run_pre_capture' do
|
35
|
-
before { commit_repo_with_message }
|
36
|
-
|
37
|
-
it 'outputs a message to stdout' do
|
38
|
-
in_repo do
|
39
|
-
Proc.new { plugin.run_pre_capture }.
|
40
|
-
must_output "✨ Say cheese 😁 !\n"
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
after { teardown_repo }
|
45
|
-
end
|
46
|
-
|
47
|
-
describe '#run_post_capture' do
|
48
|
-
before { commit_repo_with_message }
|
49
|
-
|
50
|
-
it 'outputs a message to stdout' do
|
51
|
-
plugin.configuration = valid_enabled_config
|
52
|
-
in_repo do
|
53
|
-
Proc.new { plugin.run_post_capture }.must_output "📸 📸 📸 📸 📸 Snap!\n"
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
after { teardown_repo }
|
58
|
-
end
|
59
|
-
|
60
|
-
describe '#run_capture_ready' do
|
61
|
-
|
62
|
-
before { commit_repo_with_message }
|
63
|
-
|
64
|
-
it 'outputs a message to stdout' do
|
65
|
-
in_repo do
|
66
|
-
Proc.new { plugin.run_capture_ready }.
|
67
|
-
must_output "wow! #{last_commit.sha[0..10]} at /path/to/lolcommit.jpg is your best looking commit yet!\n(it was an image!)\n"
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
after { teardown_repo }
|
72
|
-
end
|
73
|
-
|
74
|
-
describe '#enabled?' do
|
75
|
-
it 'returns be false by default' do
|
76
|
-
plugin.enabled?.must_equal false
|
77
|
-
end
|
78
|
-
|
79
|
-
it 'returns true when configured' do
|
80
|
-
plugin.configuration = valid_enabled_config
|
81
|
-
plugin.enabled?.must_equal true
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
describe 'configuration' do
|
86
|
-
it 'allows plugin options to be configured' do
|
87
|
-
configured_plugin_options = {}
|
88
|
-
|
89
|
-
fake_io_capture(inputs: %w(true false true true 5)) do
|
90
|
-
configured_plugin_options = plugin.configure_options!
|
91
|
-
end
|
92
|
-
|
93
|
-
configured_plugin_options.must_equal(valid_enabled_config)
|
94
|
-
end
|
95
|
-
|
96
|
-
describe '#valid_configuration?' do
|
97
|
-
it 'returns false without config set' do
|
98
|
-
plugin.valid_configuration?.must_equal(false)
|
99
|
-
end
|
100
|
-
|
101
|
-
it 'returns true for a valid configuration' do
|
102
|
-
plugin.configuration = valid_enabled_config
|
103
|
-
plugin.valid_configuration?.must_equal true
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
4
|
-
|
5
|
-
# lolcommits gem
|
6
|
-
require 'lolcommits'
|
7
|
-
|
8
|
-
# lolcommit test helpers
|
9
|
-
require 'lolcommits/test_helpers/git_repo'
|
10
|
-
require 'lolcommits/test_helpers/fake_io'
|
11
|
-
|
12
|
-
if ENV['COVERAGE']
|
13
|
-
require 'simplecov'
|
14
|
-
end
|
15
|
-
|
16
|
-
# plugin gem test libs
|
17
|
-
require 'lolcommits/sample_plugin'
|
18
|
-
require 'minitest/autorun'
|
19
|
-
|
20
|
-
# swallow all debug output during test runs
|
21
|
-
def debug(msg); end
|