lolcommits-uploldz 0.4.0 → 0.6.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 -2
- data/README.md +4 -9
- data/Rakefile +1 -11
- data/lib/lolcommits/plugin/uploldz.rb +1 -0
- data/lib/lolcommits/uploldz/version.rb +1 -1
- data/lolcommits-uploldz.gemspec +2 -4
- metadata +9 -39
- data/test/lolcommits/plugin/uploldz_test.rb +0 -121
- 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: e25d6e8591f09c0f55e4b91884a3b30325ff6e60b923265bc5a578544bc45978
|
4
|
+
data.tar.gz: 226a8ccb7d019742ec8ac66a9dab6f003f8354a67cff30638196a3c7cf93d40e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7cae83c182b5baac0f3bdce7ae2e45857a2368d39982ce11515f382ff3bd9e7565181e2bcf2116575ab828b7b86906622eff4007b4720e21e9dbff79a3d2c0d
|
7
|
+
data.tar.gz: 0b1c91c9a6ae28f5b03b20e2425e384f9837f88592fc82f2193e04376d16ff7fd509a2d5ab47bf534afd1f7db6767d860f9eae76afa6dbfaed2a1f2e4d62c9e1
|
@@ -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 @@ adheres to [Semantic Versioning][Semver].
|
|
9
9
|
|
10
10
|
- Your contribution here!
|
11
11
|
|
12
|
+
## [0.6.0] - 2024-09-24
|
13
|
+
### Removed
|
14
|
+
- Support for Ruby < 3.1 (older rubies no longer supported)
|
15
|
+
|
16
|
+
## [0.5.0] - 2020-01-24
|
17
|
+
### Removed
|
18
|
+
- Support for Ruby < 2.4 (older rubies no longer supported)
|
19
|
+
|
12
20
|
## [0.4.0] - 2019-08-25
|
13
21
|
### Changed
|
14
22
|
- Require an up-to-date `rest-client` (`>= 2.1.0`)
|
@@ -62,7 +70,9 @@ adheres to [Semantic Versioning][Semver].
|
|
62
70
|
### Changed
|
63
71
|
- Initial release
|
64
72
|
|
65
|
-
[Unreleased]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.
|
73
|
+
[Unreleased]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.6.0...HEAD
|
74
|
+
[0.6.0]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.5.0...v0.6.0
|
75
|
+
[0.5.0]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.4.0...v0.5.0
|
66
76
|
[0.4.0]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.3.0...v0.4.0
|
67
77
|
[0.3.0]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.2.0...v0.3.0
|
68
78
|
[0.2.0]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.1.1...v0.2.0
|
@@ -73,4 +83,3 @@ adheres to [Semantic Versioning][Semver].
|
|
73
83
|
[0.0.2]: https://github.com/lolcommits/lolcommits-uploldz/compare/v0.0.1...v0.0.2
|
74
84
|
[0.0.1]: https://github.com/lolcommits/lolcommits-uploldz/compare/11529d5...v0.0.1
|
75
85
|
[KeepAChangelog]: http://keepachangelog.com/en/1.0.0/
|
76
|
-
[Semver]: http://semver.org/spec/v2.0.0.html
|
data/README.md
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
# Lolcommits Uploldz
|
2
2
|
|
3
|
+
[![Build](https://img.shields.io/github/actions/workflow/status/lolcommits/lolcommits-uploldz/build.yml?branch=main&style=flat)](https://github.com/lolcommits/lolcommits-uploldz/actions/workflows/build.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
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
|
@@ -27,7 +25,7 @@ password).
|
|
27
25
|
|
28
26
|
## Requirements
|
29
27
|
|
30
|
-
* Ruby >=
|
28
|
+
* Ruby >= 3.1
|
31
29
|
* A webcam
|
32
30
|
* [ImageMagick](http://www.imagemagick.org)
|
33
31
|
* [ffmpeg](https://www.ffmpeg.org) (optional) for animated gif capturing
|
@@ -54,8 +52,7 @@ will be uploaded to it. To disable use:
|
|
54
52
|
## Development
|
55
53
|
|
56
54
|
Check out this repo and run `bin/setup`, this will install all
|
57
|
-
dependencies and generate docs. Use `bundle exec rake` to run all tests
|
58
|
-
and generate a coverage report.
|
55
|
+
dependencies and generate docs. Use `bundle exec rake` to run all tests.
|
59
56
|
|
60
57
|
You can also run `bin/console` for an interactive prompt that will allow
|
61
58
|
you to experiment with the gem code.
|
@@ -106,9 +103,7 @@ The gem is available as open source under the terms of
|
|
106
103
|
|
107
104
|
## Links
|
108
105
|
|
109
|
-
* [
|
110
|
-
* [Code Climate](https://codeclimate.com/github/lolcommits/lolcommits-uploldz)
|
111
|
-
* [Test Coverage](https://codeclimate.com/github/lolcommits/lolcommits-uploldz/coverage)
|
106
|
+
* [CI](https://github.com/lolcommits/lolcommits-uploldz/actions/workflows/build.yml)
|
112
107
|
* [RDoc](http://rdoc.info/projects/lolcommits/lolcommits-uploldz)
|
113
108
|
* [Issues](http://github.com/lolcommits/lolcommits-uploldz/issues)
|
114
109
|
* [Report a bug](http://github.com/lolcommits/lolcommits-uploldz/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']
|
data/lolcommits-uploldz.gemspec
CHANGED
@@ -30,15 +30,13 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.executables = []
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
|
33
|
-
spec.required_ruby_version = ">=
|
33
|
+
spec.required_ruby_version = ">= 3.1"
|
34
34
|
|
35
35
|
spec.add_runtime_dependency "rest-client", ">= 2.1.0"
|
36
|
-
spec.add_runtime_dependency "lolcommits", ">= 0.
|
36
|
+
spec.add_runtime_dependency "lolcommits", ">= 0.17.2"
|
37
37
|
|
38
38
|
spec.add_development_dependency "bundler"
|
39
39
|
spec.add_development_dependency "webmock"
|
40
|
-
spec.add_development_dependency "pry"
|
41
40
|
spec.add_development_dependency "rake"
|
42
41
|
spec.add_development_dependency "minitest"
|
43
|
-
spec.add_development_dependency "simplecov"
|
44
42
|
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.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-28 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,6 +103,8 @@ executables: []
|
|
131
103
|
extensions: []
|
132
104
|
extra_rdoc_files: []
|
133
105
|
files:
|
106
|
+
- ".github/workflows/build.yml"
|
107
|
+
- ".github/workflows/push_gem.yml"
|
134
108
|
- ".gitignore"
|
135
109
|
- ".simplecov"
|
136
110
|
- ".travis.yml"
|
@@ -148,8 +122,6 @@ files:
|
|
148
122
|
- lib/lolcommits/uploldz.rb
|
149
123
|
- lib/lolcommits/uploldz/version.rb
|
150
124
|
- lolcommits-uploldz.gemspec
|
151
|
-
- test/lolcommits/plugin/uploldz_test.rb
|
152
|
-
- test/test_helper.rb
|
153
125
|
homepage: https://github.com/lolcommits/lolcommits-uploldz
|
154
126
|
licenses:
|
155
127
|
- LGPL-3.0
|
@@ -167,17 +139,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
139
|
requirements:
|
168
140
|
- - ">="
|
169
141
|
- !ruby/object:Gem::Version
|
170
|
-
version: '
|
142
|
+
version: '3.1'
|
171
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
144
|
requirements:
|
173
145
|
- - ">="
|
174
146
|
- !ruby/object:Gem::Version
|
175
147
|
version: '0'
|
176
148
|
requirements: []
|
177
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.5.16
|
178
150
|
signing_key:
|
179
151
|
specification_version: 4
|
180
152
|
summary: Uploads lolcommits to a remote server
|
181
|
-
test_files:
|
182
|
-
- test/lolcommits/plugin/uploldz_test.rb
|
183
|
-
- test/test_helper.rb
|
153
|
+
test_files: []
|
@@ -1,121 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "test_helper"
|
4
|
-
require 'webmock/minitest'
|
5
|
-
|
6
|
-
describe Lolcommits::Plugin::Uploldz do
|
7
|
-
|
8
|
-
include Lolcommits::TestHelpers::GitRepo
|
9
|
-
include Lolcommits::TestHelpers::FakeIO
|
10
|
-
|
11
|
-
describe "with a runner" do
|
12
|
-
def runner
|
13
|
-
# a simple lolcommits runner with an empty configuration Hash
|
14
|
-
@runner ||= Lolcommits::Runner.new(
|
15
|
-
lolcommit_path: Tempfile.new('lolcommit.jpg').path
|
16
|
-
)
|
17
|
-
end
|
18
|
-
|
19
|
-
def plugin
|
20
|
-
@plugin ||= Lolcommits::Plugin::Uploldz.new(runner: runner)
|
21
|
-
end
|
22
|
-
|
23
|
-
def valid_enabled_config
|
24
|
-
{
|
25
|
-
enabled: true,
|
26
|
-
endpoint: "https://uploldz.com/uplol",
|
27
|
-
optional_http_auth_username: 'joe',
|
28
|
-
optional_http_auth_password: '1234'
|
29
|
-
}
|
30
|
-
end
|
31
|
-
|
32
|
-
describe "initalizing" do
|
33
|
-
it "assigns runner and all plugin options" do
|
34
|
-
plugin.runner.must_equal runner
|
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
|
43
|
-
end
|
44
|
-
|
45
|
-
describe "#enabled?" do
|
46
|
-
it "is false by default" do
|
47
|
-
plugin.enabled?.must_equal false
|
48
|
-
end
|
49
|
-
|
50
|
-
it "is true when configured" do
|
51
|
-
plugin.configuration = valid_enabled_config
|
52
|
-
plugin.enabled?.must_equal true
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe "run_capture_ready" do
|
57
|
-
before { commit_repo_with_message("first commit!") }
|
58
|
-
after { teardown_repo }
|
59
|
-
|
60
|
-
it "syncs lolcommits" do
|
61
|
-
in_repo do
|
62
|
-
plugin.configuration = valid_enabled_config
|
63
|
-
|
64
|
-
stub_request(:post, "https://uploldz.com/uplol").to_return(status: 200)
|
65
|
-
|
66
|
-
plugin.run_capture_ready
|
67
|
-
|
68
|
-
assert_requested :post, "https://uploldz.com/uplol", times: 1,
|
69
|
-
headers: {'Content-Type' => /multipart\/form-data/ } do |req|
|
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
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe "configuration" do
|
84
|
-
it "allows plugin options to be configured" do
|
85
|
-
# enabled, endpoint, key, user, password
|
86
|
-
inputs = %w(
|
87
|
-
true
|
88
|
-
https://my-server.com/uplol
|
89
|
-
key-123
|
90
|
-
joe
|
91
|
-
1337pass
|
92
|
-
)
|
93
|
-
configured_plugin_options = {}
|
94
|
-
|
95
|
-
fake_io_capture(inputs: inputs) do
|
96
|
-
configured_plugin_options = plugin.configure_options!
|
97
|
-
end
|
98
|
-
|
99
|
-
configured_plugin_options.must_equal({
|
100
|
-
enabled: true,
|
101
|
-
endpoint: "https://my-server.com/uplol",
|
102
|
-
optional_key: "key-123",
|
103
|
-
optional_http_auth_username: "joe",
|
104
|
-
optional_http_auth_password: "1337pass"
|
105
|
-
})
|
106
|
-
end
|
107
|
-
|
108
|
-
describe "#valid_configuration?" do
|
109
|
-
it "returns false for an invalid configuration" do
|
110
|
-
plugin.configuration = { endpoint: "gibberish" }
|
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
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
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/uploldz'
|
18
|
-
require 'minitest/autorun'
|
19
|
-
|
20
|
-
# swallow all debug output during test runs
|
21
|
-
def debug(msg); end
|