lolcommits-uploldz 0.5.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +56 -0
- data/.quickhook/pre-commit/ruby-lint +3 -0
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +12 -2
- data/Gemfile +5 -1
- data/README.md +28 -38
- data/Rakefile +1 -11
- data/bin/rubocop +5 -0
- data/lib/lolcommits/plugin/uploldz.rb +5 -5
- data/lib/lolcommits/uploldz/version.rb +1 -1
- data/lib/lolcommits/uploldz.rb +2 -2
- data/lolcommits-uploldz.gemspec +7 -8
- data/test/images/lolcommit.jpg +0 -0
- data/test/lolcommits/plugin/uploldz_test.rb +87 -92
- data/test/test_helper.rb +7 -10
- metadata +16 -40
- data/.simplecov +0 -9
- data/.travis.yml +0 -29
- data/PULL_REQUEST_TEMPLATE.md +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9839173622884d12ac7c3f1243af76787ca33081eeb49cb5b67f574b8c6ea308
|
4
|
+
data.tar.gz: 7b3153491fd97da4968eb71a7115532426c96775d2c88085eac45cce4a2a30b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e54aa0308cd1017edc8535e0aa466e620a1c2151c014699a0b5af134542549baccf091673893987604426ca019c753a1792195be1b9a680b68de5adc9694d88e
|
7
|
+
data.tar.gz: 86166151ae1810ebd6a21482b0855b4fc34e7eb79cf05a66c75a0e537b09cfd0a4b534c81026cb823637fff6f311cb8ac203f0aed1acd8cfeac6e898af5663ec
|
@@ -0,0 +1,56 @@
|
|
1
|
+
name: CI
|
2
|
+
permissions:
|
3
|
+
contents: read
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- main
|
9
|
+
pull_request:
|
10
|
+
branches:
|
11
|
+
- main
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
rubocop:
|
15
|
+
name: RuboCop
|
16
|
+
runs-on: ubuntu-latest
|
17
|
+
env:
|
18
|
+
BUNDLE_ONLY: rubocop
|
19
|
+
steps:
|
20
|
+
- name: Checkout code
|
21
|
+
uses: actions/checkout@v4
|
22
|
+
- name: Setup Ruby and install gems
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: 3.3.0
|
26
|
+
bundler-cache: true
|
27
|
+
- name: Run Rubocop
|
28
|
+
run: bundle exec rubocop --parallel
|
29
|
+
test:
|
30
|
+
name: ${{ format('Unit tests (Ruby {0})', matrix.ruby-version) }}
|
31
|
+
runs-on: ubuntu-latest
|
32
|
+
strategy:
|
33
|
+
matrix:
|
34
|
+
ruby-version:
|
35
|
+
- "3.1"
|
36
|
+
- "3.2"
|
37
|
+
- "3.3"
|
38
|
+
- "3.4"
|
39
|
+
continue-on-error: true
|
40
|
+
steps:
|
41
|
+
- name: Checkout code
|
42
|
+
uses: actions/checkout@v4
|
43
|
+
- name: Setup Ruby and install gems
|
44
|
+
uses: ruby/setup-ruby@v1
|
45
|
+
with:
|
46
|
+
ruby-version: ${{ matrix.ruby-version }}
|
47
|
+
bundler-cache: true
|
48
|
+
- name: Configure Git
|
49
|
+
run: |
|
50
|
+
git config --global user.name $NAME
|
51
|
+
git config --global user.email $EMAIL
|
52
|
+
env:
|
53
|
+
NAME: "George Costanza"
|
54
|
+
EMAIL: "george.costanza@vandelay.com"
|
55
|
+
- name: Run tests
|
56
|
+
run: bundle exec rake test
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,15 @@ adheres to [Semantic Versioning][Semver].
|
|
9
9
|
|
10
10
|
- Your contribution here!
|
11
11
|
|
12
|
+
## [0.6.1] - 2024-12-29
|
13
|
+
### Changed
|
14
|
+
- Push gems with bundler (not GitHub actions)
|
15
|
+
- Updated documentation links
|
16
|
+
|
17
|
+
## [0.6.0] - 2024-09-24
|
18
|
+
### Removed
|
19
|
+
- Support for Ruby < 3.1 (older rubies no longer supported)
|
20
|
+
|
12
21
|
## [0.5.0] - 2020-01-24
|
13
22
|
### Removed
|
14
23
|
- Support for Ruby < 2.4 (older rubies no longer supported)
|
@@ -66,7 +75,9 @@ adheres to [Semantic Versioning][Semver].
|
|
66
75
|
### Changed
|
67
76
|
- Initial release
|
68
77
|
|
69
|
-
[Unreleased]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.
|
78
|
+
[Unreleased]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.6.1...HEAD
|
79
|
+
[0.6.1]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.6.0...v0.6.1
|
80
|
+
[0.6.0]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.5.0...v0.6.0
|
70
81
|
[0.5.0]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.4.0...v0.5.0
|
71
82
|
[0.4.0]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.3.0...v0.4.0
|
72
83
|
[0.3.0]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.2.0...v0.3.0
|
@@ -78,4 +89,3 @@ adheres to [Semantic Versioning][Semver].
|
|
78
89
|
[0.0.2]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.0.1...v0.0.2
|
79
90
|
[0.0.1]: https://github.com/lolcommits/lolcommits-uploldz/compare/11529d5...v0.0.1
|
80
91
|
[KeepAChangelog]: http://keepachangelog.com/en/1.0.0/
|
81
|
-
[Semver]: http://semver.org/spec/v2.0.0.html
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
# Lolcommits Uploldz
|
2
2
|
|
3
|
+
[![CI](https://img.shields.io/github/actions/workflow/status/lolcommits/lolcommits-uploldz/ci.yml?branch=main&style=flat&label=CI)](https://github.com/lolcommits/lolcommits-uploldz/actions/workflows/ci.yml)
|
3
4
|
[![Gem](https://img.shields.io/gem/v/lolcommits-uploldz.svg?style=flat)](http://rubygems.org/gems/lolcommits-uploldz)
|
4
|
-
[![Travis](https://img.shields.io/travis/com/lolcommits/lolcommits-uploldz/master.svg?style=flat)](https://travis-ci.com/lolcommits/lolcommits-uploldz)
|
5
5
|
[![Depfu](https://img.shields.io/depfu/lolcommits/lolcommits-uploldz.svg?style=flat)](https://depfu.com/github/lolcommits/lolcommits-uploldz)
|
6
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/adb505198ff0e8e8e170/maintainability)](https://codeclimate.com/github/lolcommits/lolcommits-uploldz/maintainability)
|
7
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/adb505198ff0e8e8e170/test_coverage)](https://codeclimate.com/github/lolcommits/lolcommits-uploldz/test_coverage)
|
8
6
|
|
9
|
-
[lolcommits](https://lolcommits.github.io/) takes a snapshot with your
|
10
|
-
|
11
|
-
|
7
|
+
[lolcommits](https://lolcommits.github.io/) takes a snapshot with your webcam
|
8
|
+
every time you git commit code, and archives a lolcat style image with it. Git
|
9
|
+
blame has never been so much fun!
|
12
10
|
|
13
|
-
This plugin uploads each lolcommit to a remote server after capturing.
|
14
|
-
|
15
|
-
|
11
|
+
This plugin uploads each lolcommit to a remote server after capturing. You
|
12
|
+
configure the plugin by setting a remote endpoint to handle the HTTP post
|
13
|
+
request. The following params will be sent:
|
16
14
|
|
17
15
|
* `file` - captured lolcommit file
|
18
16
|
* `message` - the commit message
|
@@ -22,12 +20,11 @@ post request. The following params will be sent:
|
|
22
20
|
* `author_email` - the commit author email address
|
23
21
|
* `key` - optional key (string) from plugin config
|
24
22
|
|
25
|
-
You can also set an optional HTTP Basic Auth header (username and/or
|
26
|
-
password).
|
23
|
+
You can also set an optional HTTP Basic Auth header (username and/or password).
|
27
24
|
|
28
25
|
## Requirements
|
29
26
|
|
30
|
-
* Ruby >=
|
27
|
+
* Ruby >= 3.1
|
31
28
|
* A webcam
|
32
29
|
* [ImageMagick](http://www.imagemagick.org)
|
33
30
|
* [ffmpeg](https://www.ffmpeg.org) (optional) for animated gif capturing
|
@@ -45,20 +42,19 @@ Then configure to enable and set the remote endpoint:
|
|
45
42
|
# set the remote endpoint (must begin with http(s)://)
|
46
43
|
# optionally set a key (sent in params) and/or HTTP Basic Auth credentials
|
47
44
|
|
48
|
-
That's it! Provided the endpoint responds correctly, your next lolcommit
|
49
|
-
|
45
|
+
That's it! Provided the endpoint responds correctly, your next lolcommit will be
|
46
|
+
uploaded to it. To disable use:
|
50
47
|
|
51
48
|
$ lolcommits --config -p uploldz
|
52
49
|
# and set enabled to `false`
|
53
50
|
|
54
51
|
## Development
|
55
52
|
|
56
|
-
Check out this repo and run `bin/setup`, this will install all
|
57
|
-
|
58
|
-
and generate a coverage report.
|
53
|
+
Check out this repo and run `bin/setup`, this will install all dependencies and
|
54
|
+
generate docs. Use `bundle exec rake` to run all tests.
|
59
55
|
|
60
|
-
You can also run `bin/console` for an interactive prompt that will allow
|
61
|
-
|
56
|
+
You can also run `bin/console` for an interactive prompt that will allow you to
|
57
|
+
experiment with the gem code.
|
62
58
|
|
63
59
|
## Tests
|
64
60
|
|
@@ -75,27 +71,23 @@ Generate docs for this gem with:
|
|
75
71
|
## Troubles?
|
76
72
|
|
77
73
|
If you think something is broken or missing, please raise a new
|
78
|
-
[issue](https://github.com/lolcommits/lolcommits-uploldz/issues). Take a
|
79
|
-
|
74
|
+
[issue](https://github.com/lolcommits/lolcommits-uploldz/issues). Take a moment
|
75
|
+
to check it hasn't been raised in the past (and possibly closed).
|
80
76
|
|
81
77
|
## Contributing
|
82
78
|
|
83
|
-
Bug [reports](https://github.com/lolcommits/lolcommits-uploldz/issues)
|
84
|
-
|
85
|
-
|
86
|
-
welcome on GitHub.
|
79
|
+
Bug [reports](https://github.com/lolcommits/lolcommits-uploldz/issues) and [pull
|
80
|
+
requests](https://github.com/lolcommits/lolcommits-uploldz/pulls) are welcome on
|
81
|
+
GitHub.
|
87
82
|
|
88
|
-
When submitting pull requests, remember to add tests covering any new
|
89
|
-
|
90
|
-
|
91
|
-
[contributing
|
92
|
-
guidelines](https://github.com/lolcommits/lolcommits-uploldz/blob/master/CONTRIBUTING.md)
|
83
|
+
When submitting pull requests, remember to add tests covering any new behaviour,
|
84
|
+
and ensure all tests are passing. Read the [contributing
|
85
|
+
guidelines](https://github.com/lolcommits/lolcommits-loltext/blob/master/CONTRIBUTING.md)
|
93
86
|
for more details.
|
94
87
|
|
95
|
-
This project is intended to be a safe, welcoming space for
|
96
|
-
|
97
|
-
|
98
|
-
See
|
88
|
+
This project is intended to be a safe, welcoming space for collaboration, and
|
89
|
+
contributors are expected to adhere to the [Contributor
|
90
|
+
Covenant](http://contributor-covenant.org) code of conduct. See
|
99
91
|
[here](https://github.com/lolcommits/lolcommits-uploldz/blob/master/CODE_OF_CONDUCT.md)
|
100
92
|
for more details.
|
101
93
|
|
@@ -106,10 +98,8 @@ The gem is available as open source under the terms of
|
|
106
98
|
|
107
99
|
## Links
|
108
100
|
|
109
|
-
* [
|
110
|
-
* [
|
111
|
-
* [Test Coverage](https://codeclimate.com/github/lolcommits/lolcommits-uploldz/coverage)
|
112
|
-
* [RDoc](http://rdoc.info/projects/lolcommits/lolcommits-uploldz)
|
101
|
+
* [CI](https://github.com/lolcommits/lolcommits-uploldz/actions/workflows/ci.yml)
|
102
|
+
* [RDoc](https://rubydoc.info/gems/lolcommits-uploldz)
|
113
103
|
* [Issues](http://github.com/lolcommits/lolcommits-uploldz/issues)
|
114
104
|
* [Report a bug](http://github.com/lolcommits/lolcommits-uploldz/issues/new)
|
115
105
|
* [Gem](http://rubygems.org/gems/lolcommits-uploldz)
|
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" ]
|
data/bin/rubocop
ADDED
@@ -1,13 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
3
|
+
require "rest-client"
|
4
|
+
require "base64"
|
5
|
+
require "lolcommits/plugin/base"
|
6
6
|
|
7
7
|
module Lolcommits
|
8
8
|
module Plugin
|
9
9
|
class Uploldz < Base
|
10
|
-
|
11
10
|
attr_accessor :endpoint
|
12
11
|
|
13
12
|
##
|
@@ -49,6 +48,7 @@ module Lolcommits
|
|
49
48
|
#
|
50
49
|
def run_capture_ready
|
51
50
|
debug "Posting capture to #{configuration[:endpoint]}"
|
51
|
+
|
52
52
|
RestClient.post(
|
53
53
|
configuration[:endpoint],
|
54
54
|
{
|
@@ -95,7 +95,7 @@ module Lolcommits
|
|
95
95
|
password = configuration[:optional_http_auth_password]
|
96
96
|
return unless user || password
|
97
97
|
|
98
|
-
|
98
|
+
"Basic " + Base64.encode64("#{user}:#{password}").chomp
|
99
99
|
end
|
100
100
|
end
|
101
101
|
end
|
data/lib/lolcommits/uploldz.rb
CHANGED
data/lolcommits-uploldz.gemspec
CHANGED
@@ -5,9 +5,9 @@ require 'lolcommits/uploldz/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "lolcommits-uploldz"
|
7
7
|
spec.version = Lolcommits::Uploldz::VERSION
|
8
|
-
spec.authors = ["Matthew Hutchinson"]
|
9
|
-
spec.email = ["matt@hiddenloop.com"]
|
10
|
-
spec.summary = %q
|
8
|
+
spec.authors = [ "Matthew Hutchinson" ]
|
9
|
+
spec.email = [ "matt@hiddenloop.com" ]
|
10
|
+
spec.summary = %q(Uploads lolcommits to a remote server)
|
11
11
|
spec.homepage = "https://github.com/lolcommits/lolcommits-uploldz"
|
12
12
|
spec.license = "LGPL-3.0"
|
13
13
|
|
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
|
19
19
|
spec.metadata = {
|
20
20
|
"homepage_uri" => "https://github.com/lolcommits/lolcommits-uploldz",
|
21
|
+
"documentation_uri" => "https://rubydoc.info/gems/lolcommits-uploldz",
|
21
22
|
"changelog_uri" => "https://github.com/lolcommits/lolcommits-uploldz/blob/master/CHANGELOG.md",
|
22
23
|
"source_code_uri" => "https://github.com/lolcommits/lolcommits-uploldz",
|
23
24
|
"bug_tracker_uri" => "https://github.com/lolcommits/lolcommits-uploldz/issues",
|
@@ -28,17 +29,15 @@ Gem::Specification.new do |spec|
|
|
28
29
|
spec.test_files = `git ls-files -- {test,features}/*`.split("\n")
|
29
30
|
spec.bindir = "bin"
|
30
31
|
spec.executables = []
|
31
|
-
spec.require_paths = ["lib"]
|
32
|
+
spec.require_paths = [ "lib" ]
|
32
33
|
|
33
|
-
spec.required_ruby_version = ">=
|
34
|
+
spec.required_ruby_version = ">= 3.1"
|
34
35
|
|
35
36
|
spec.add_runtime_dependency "rest-client", ">= 2.1.0"
|
36
|
-
spec.add_runtime_dependency "lolcommits", ">= 0.
|
37
|
+
spec.add_runtime_dependency "lolcommits", ">= 0.17.2"
|
37
38
|
|
38
39
|
spec.add_development_dependency "bundler"
|
39
40
|
spec.add_development_dependency "webmock"
|
40
|
-
spec.add_development_dependency "pry"
|
41
41
|
spec.add_development_dependency "rake"
|
42
42
|
spec.add_development_dependency "minitest"
|
43
|
-
spec.add_development_dependency "simplecov"
|
44
43
|
end
|
Binary file
|
@@ -1,121 +1,116 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "test_helper"
|
4
|
-
require 'webmock/minitest'
|
5
4
|
|
6
5
|
describe Lolcommits::Plugin::Uploldz do
|
7
|
-
|
8
6
|
include Lolcommits::TestHelpers::GitRepo
|
9
7
|
include Lolcommits::TestHelpers::FakeIO
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
def valid_enabled_config
|
10
|
+
{
|
11
|
+
enabled: true,
|
12
|
+
endpoint: "https://uploldz.com/uplol",
|
13
|
+
optional_http_auth_username: "joe",
|
14
|
+
optional_http_auth_password: "1234"
|
15
|
+
}
|
16
|
+
end
|
18
17
|
|
19
|
-
|
20
|
-
|
18
|
+
describe "initalizing" do
|
19
|
+
it "assigns runner and all plugin options" do
|
20
|
+
_(plugin.runner).wont_be_nil
|
21
|
+
_(plugin.options).must_equal [
|
22
|
+
:enabled,
|
23
|
+
:endpoint,
|
24
|
+
:optional_key,
|
25
|
+
:optional_http_auth_username,
|
26
|
+
:optional_http_auth_password
|
27
|
+
]
|
21
28
|
end
|
29
|
+
end
|
22
30
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
endpoint: "https://uploldz.com/uplol",
|
27
|
-
optional_http_auth_username: 'joe',
|
28
|
-
optional_http_auth_password: '1234'
|
29
|
-
}
|
31
|
+
describe "#enabled?" do
|
32
|
+
it "is false by default" do
|
33
|
+
_(plugin.enabled?).must_equal false
|
30
34
|
end
|
31
35
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
_(plugin.options).must_equal [
|
36
|
-
:enabled,
|
37
|
-
:endpoint,
|
38
|
-
:optional_key,
|
39
|
-
:optional_http_auth_username,
|
40
|
-
:optional_http_auth_password
|
41
|
-
]
|
42
|
-
end
|
36
|
+
it "is true when configured" do
|
37
|
+
plugin.configuration = valid_enabled_config
|
38
|
+
_(plugin.enabled?).must_equal true
|
43
39
|
end
|
40
|
+
end
|
44
41
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
42
|
+
describe "run_capture_ready" do
|
43
|
+
before { commit_repo_with_message("first commit!") }
|
44
|
+
after { teardown_repo }
|
49
45
|
|
50
|
-
|
46
|
+
it "syncs lolcommits" do
|
47
|
+
captured_img_path = File.expand_path("./test/images/lolcommit.jpg")
|
48
|
+
|
49
|
+
in_repo do
|
51
50
|
plugin.configuration = valid_enabled_config
|
52
|
-
|
51
|
+
plugin.runner.lolcommit_path = captured_img_path
|
52
|
+
|
53
|
+
stub_request(:post, "https://uploldz.com/uplol").to_return(status: 200)
|
54
|
+
|
55
|
+
plugin.run_capture_ready
|
56
|
+
|
57
|
+
assert_requested :post, "https://uploldz.com/uplol", times: 1,
|
58
|
+
headers: { "Content-Type" => /multipart\/form-data/ } do |req|
|
59
|
+
_(req.body).must_match(/Content-Disposition: form-data;.+name="file"; filename="lolcommit.jpg"/)
|
60
|
+
_(req.body).must_match 'name="repo"'
|
61
|
+
_(req.body).must_match 'name="author_name"'
|
62
|
+
_(req.body).must_match 'name="author_email"'
|
63
|
+
_(req.body).must_match 'name="sha"'
|
64
|
+
_(req.body).must_match 'name="key"'
|
65
|
+
_(req.body).must_match "plugin-test-repo"
|
66
|
+
_(req.body).must_match "first commit!"
|
67
|
+
end
|
53
68
|
end
|
54
69
|
end
|
70
|
+
end
|
55
71
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
_(req.body).must_match(/Content-Disposition: form-data;.+name="file"; filename="lolcommit.jpg.+"/)
|
71
|
-
_(req.body).must_match 'name="repo"'
|
72
|
-
_(req.body).must_match 'name="author_name"'
|
73
|
-
_(req.body).must_match 'name="author_email"'
|
74
|
-
_(req.body).must_match 'name="sha"'
|
75
|
-
_(req.body).must_match 'name="key"'
|
76
|
-
_(req.body).must_match "plugin-test-repo"
|
77
|
-
_(req.body).must_match "first commit!"
|
78
|
-
end
|
79
|
-
end
|
72
|
+
describe "configuration" do
|
73
|
+
it "allows plugin options to be configured" do
|
74
|
+
# enabled, endpoint, key, user, password
|
75
|
+
inputs = %w[
|
76
|
+
true
|
77
|
+
https://my-server.com/uplol
|
78
|
+
key-123
|
79
|
+
joe
|
80
|
+
1337pass
|
81
|
+
]
|
82
|
+
configured_plugin_options = {}
|
83
|
+
|
84
|
+
fake_io_capture(inputs: inputs) do
|
85
|
+
configured_plugin_options = plugin.configure_options!
|
80
86
|
end
|
81
|
-
end
|
82
87
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
1337pass
|
92
|
-
)
|
93
|
-
configured_plugin_options = {}
|
94
|
-
|
95
|
-
fake_io_capture(inputs: inputs) do
|
96
|
-
configured_plugin_options = plugin.configure_options!
|
97
|
-
end
|
88
|
+
_(configured_plugin_options).must_equal({
|
89
|
+
enabled: true,
|
90
|
+
endpoint: "https://my-server.com/uplol",
|
91
|
+
optional_key: "key-123",
|
92
|
+
optional_http_auth_username: "joe",
|
93
|
+
optional_http_auth_password: "1337pass"
|
94
|
+
})
|
95
|
+
end
|
98
96
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
optional_http_auth_username: "joe",
|
104
|
-
optional_http_auth_password: "1337pass"
|
105
|
-
})
|
97
|
+
describe "#valid_configuration?" do
|
98
|
+
it "returns false for an invalid configuration" do
|
99
|
+
plugin.configuration = { endpoint: "gibberish" }
|
100
|
+
_(plugin.valid_configuration?).must_equal false
|
106
101
|
end
|
107
102
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
_(plugin.valid_configuration?).must_equal false
|
112
|
-
end
|
113
|
-
|
114
|
-
it "returns true with a valid configuration" do
|
115
|
-
plugin.configuration = valid_enabled_config
|
116
|
-
_(plugin.valid_configuration?).must_equal true
|
117
|
-
end
|
103
|
+
it "returns true with a valid configuration" do
|
104
|
+
plugin.configuration = valid_enabled_config
|
105
|
+
_(plugin.valid_configuration?).must_equal true
|
118
106
|
end
|
119
107
|
end
|
120
108
|
end
|
109
|
+
|
110
|
+
private
|
111
|
+
def plugin
|
112
|
+
@plugin ||= Lolcommits::Plugin::Uploldz.new(
|
113
|
+
runner: Lolcommits::Runner.new
|
114
|
+
)
|
115
|
+
end
|
121
116
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,21 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
$LOAD_PATH.unshift File.expand_path(
|
3
|
+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
4
4
|
|
5
5
|
# lolcommits gem
|
6
|
-
require
|
6
|
+
require "lolcommits"
|
7
7
|
|
8
8
|
# lolcommit test helpers
|
9
|
-
require
|
10
|
-
require
|
11
|
-
|
12
|
-
if ENV['COVERAGE']
|
13
|
-
require 'simplecov'
|
14
|
-
end
|
9
|
+
require "lolcommits/test_helpers/git_repo"
|
10
|
+
require "lolcommits/test_helpers/fake_io"
|
15
11
|
|
16
12
|
# plugin gem test libs
|
17
|
-
require
|
18
|
-
require
|
13
|
+
require "lolcommits/uploldz"
|
14
|
+
require "webmock/minitest"
|
15
|
+
require "minitest/autorun"
|
19
16
|
|
20
17
|
# swallow all debug output during test runs
|
21
18
|
def debug(msg); end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolcommits-uploldz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Hutchinson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.17.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.17.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: pry
|
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
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: rake
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,20 +94,6 @@ dependencies:
|
|
108
94
|
- - ">="
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: simplecov
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
97
|
description: |2
|
126
98
|
Uploads lolcommits to a remote server, with optional key or HTTP based
|
127
99
|
authentication.
|
@@ -131,23 +103,25 @@ executables: []
|
|
131
103
|
extensions: []
|
132
104
|
extra_rdoc_files: []
|
133
105
|
files:
|
106
|
+
- ".github/workflows/ci.yml"
|
134
107
|
- ".gitignore"
|
135
|
-
- ".
|
136
|
-
- ".
|
108
|
+
- ".quickhook/pre-commit/ruby-lint"
|
109
|
+
- ".rubocop.yml"
|
137
110
|
- CHANGELOG.md
|
138
111
|
- CODE_OF_CONDUCT.md
|
139
112
|
- CONTRIBUTING.md
|
140
113
|
- Gemfile
|
141
114
|
- LICENSE
|
142
|
-
- PULL_REQUEST_TEMPLATE.md
|
143
115
|
- README.md
|
144
116
|
- Rakefile
|
145
117
|
- bin/console
|
118
|
+
- bin/rubocop
|
146
119
|
- bin/setup
|
147
120
|
- lib/lolcommits/plugin/uploldz.rb
|
148
121
|
- lib/lolcommits/uploldz.rb
|
149
122
|
- lib/lolcommits/uploldz/version.rb
|
150
123
|
- lolcommits-uploldz.gemspec
|
124
|
+
- test/images/lolcommit.jpg
|
151
125
|
- test/lolcommits/plugin/uploldz_test.rb
|
152
126
|
- test/test_helper.rb
|
153
127
|
homepage: https://github.com/lolcommits/lolcommits-uploldz
|
@@ -155,11 +129,12 @@ licenses:
|
|
155
129
|
- LGPL-3.0
|
156
130
|
metadata:
|
157
131
|
homepage_uri: https://github.com/lolcommits/lolcommits-uploldz
|
132
|
+
documentation_uri: https://rubydoc.info/gems/lolcommits-uploldz
|
158
133
|
changelog_uri: https://github.com/lolcommits/lolcommits-uploldz/blob/master/CHANGELOG.md
|
159
134
|
source_code_uri: https://github.com/lolcommits/lolcommits-uploldz
|
160
135
|
bug_tracker_uri: https://github.com/lolcommits/lolcommits-uploldz/issues
|
161
136
|
allowed_push_host: https://rubygems.org
|
162
|
-
post_install_message:
|
137
|
+
post_install_message:
|
163
138
|
rdoc_options: []
|
164
139
|
require_paths:
|
165
140
|
- lib
|
@@ -167,17 +142,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
142
|
requirements:
|
168
143
|
- - ">="
|
169
144
|
- !ruby/object:Gem::Version
|
170
|
-
version: '
|
145
|
+
version: '3.1'
|
171
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
147
|
requirements:
|
173
148
|
- - ">="
|
174
149
|
- !ruby/object:Gem::Version
|
175
150
|
version: '0'
|
176
151
|
requirements: []
|
177
|
-
rubygems_version: 3.
|
178
|
-
signing_key:
|
152
|
+
rubygems_version: 3.5.22
|
153
|
+
signing_key:
|
179
154
|
specification_version: 4
|
180
155
|
summary: Uploads lolcommits to a remote server
|
181
156
|
test_files:
|
157
|
+
- test/images/lolcommit.jpg
|
182
158
|
- test/lolcommits/plugin/uploldz_test.rb
|
183
159
|
- test/test_helper.rb
|
data/.simplecov
DELETED
data/.travis.yml
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
cache: bundler
|
4
|
-
rvm:
|
5
|
-
- 2.4.9
|
6
|
-
- 2.5.7
|
7
|
-
- 2.6.5
|
8
|
-
- 2.7.0
|
9
|
-
- ruby-head
|
10
|
-
|
11
|
-
before_install:
|
12
|
-
- git --version
|
13
|
-
- git config --global user.email "lol@commits.org"
|
14
|
-
- git config --global user.name "Lolcommits"
|
15
|
-
|
16
|
-
matrix:
|
17
|
-
allow_failures:
|
18
|
-
- rvm: ruby-head
|
19
|
-
|
20
|
-
env:
|
21
|
-
global:
|
22
|
-
- CC_TEST_REPORTER_ID=a11f4b88e9bad7b922ca0ce5c70e369d1fd704c1b7c08c5b9e273e29a8c73345
|
23
|
-
- GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
|
24
|
-
before_script:
|
25
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
26
|
-
- chmod +x ./cc-test-reporter
|
27
|
-
- ./cc-test-reporter before-build - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
|
28
|
-
after_script:
|
29
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/PULL_REQUEST_TEMPLATE.md
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
|
2
|
-
Explain what you're changing and why here.
|
3
|
-
|
4
|
-
---
|
5
|
-
#### :memo: Checklist
|
6
|
-
|
7
|
-
Please check this list and leave it intact for the reviewer. Thanks! :heart:
|
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)).
|
10
|
-
- [ ] If relevant, mention GitHub issue number above and include in a commit message.
|
11
|
-
- [ ] Latest code from master merged.
|
12
|
-
- [ ] New behaviour has test coverage.
|
13
|
-
- [ ] Avoid duplicating code.
|
14
|
-
- [ ] No commented out code.
|
15
|
-
- [ ] Avoid comments for your code, write code that explains itself.
|
16
|
-
- [ ] Changes are simple, useful, clear and brief.
|