lolcommits 0.12.1 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -10
- data/CHANGELOG.md +17 -3
- data/CODE_OF_CONDUCT.md +54 -31
- data/PULL_REQUEST_TEMPLATE.md +16 -0
- data/README.md +15 -3
- data/Rakefile +2 -2
- data/bin/lolcommits +1 -0
- data/features/step_definitions/lolcommits_steps.rb +2 -0
- data/features/support/env.rb +2 -0
- data/features/support/path_helpers.rb +2 -0
- data/lib/core_ext/mercurial-ruby/command.rb +3 -2
- data/lib/core_ext/mercurial-ruby/shell.rb +3 -1
- data/lib/lolcommits.rb +2 -3
- data/lib/lolcommits/backends/git_info.rb +3 -1
- data/lib/lolcommits/backends/installation_git.rb +8 -6
- data/lib/lolcommits/backends/installation_mercurial.rb +9 -3
- data/lib/lolcommits/backends/mercurial_info.rb +2 -0
- data/lib/lolcommits/capturer.rb +2 -0
- data/lib/lolcommits/capturer/capture_cygwin.rb +2 -0
- data/lib/lolcommits/capturer/capture_fake.rb +2 -0
- data/lib/lolcommits/capturer/capture_linux.rb +2 -0
- data/lib/lolcommits/capturer/capture_linux_animated.rb +3 -0
- data/lib/lolcommits/capturer/capture_mac.rb +2 -0
- data/lib/lolcommits/capturer/capture_mac_animated.rb +3 -0
- data/lib/lolcommits/capturer/capture_windows.rb +2 -0
- data/lib/lolcommits/capturer/capture_windows_animated.rb +4 -0
- data/lib/lolcommits/cli.rb +2 -0
- data/lib/lolcommits/cli/fatals.rb +6 -0
- data/lib/lolcommits/cli/launcher.rb +2 -0
- data/lib/lolcommits/cli/process_runner.rb +2 -0
- data/lib/lolcommits/cli/timelapse_gif.rb +2 -1
- data/lib/lolcommits/configuration.rb +4 -0
- data/lib/lolcommits/gem_plugin.rb +2 -0
- data/lib/lolcommits/installation.rb +3 -0
- data/lib/lolcommits/platform.rb +5 -0
- data/lib/lolcommits/plugin/base.rb +4 -0
- data/lib/lolcommits/plugin/configuration_helper.rb +3 -0
- data/lib/lolcommits/plugin_manager.rb +3 -1
- data/lib/lolcommits/runner.rb +3 -0
- data/lib/lolcommits/test_helpers/fake_io.rb +2 -0
- data/lib/lolcommits/test_helpers/git_repo.rb +4 -0
- data/lib/lolcommits/vcs_info.rb +2 -0
- data/lib/lolcommits/version.rb +3 -1
- data/lolcommits.gemspec +13 -6
- data/test/permissions_test.rb +5 -6
- data/test/test_helper.rb +2 -0
- metadata +17 -23
- data/lib/core_ext/hash/hash_dig.rb +0 -21
- data/lib/core_ext/mini_magick/utilities.rb +0 -14
- data/lib/lolcommits/plugin/lol_yammer.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b2cf93afdba092609bfaf87753b64447ec8c5280661397281321015da132084
|
4
|
+
data.tar.gz: 3700f1b9711610706ae12f5883a3f58805ebf69cd2409adaa610cd39cb84528d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4574138c9544daa67e9285af8a502df5131df7292fa0d5b439f56f5fc6ac2a65e3262e6f4c951943fcaf6bc7162610b6bcc6f225b67b372d2802257fe33fdd21
|
7
|
+
data.tar.gz: 6729da5655425c090468ea7e318fdfb33e46c0ca124b0bccabfbada72f0f520911e30ee5721ac908e91a86dec790289d6244afc1911f36a9169422a1570b04a7
|
data/.travis.yml
CHANGED
@@ -2,26 +2,24 @@ sudo: false
|
|
2
2
|
language: ruby
|
3
3
|
cache: bundler
|
4
4
|
rvm:
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
- 2.
|
8
|
-
- 2.
|
9
|
-
- 2.5.0
|
5
|
+
- 2.3.8
|
6
|
+
- 2.4.6
|
7
|
+
- 2.5.5
|
8
|
+
- 2.6.3
|
10
9
|
- ruby-head
|
11
10
|
|
11
|
+
matrix:
|
12
|
+
allow_failures:
|
13
|
+
- rvm: ruby-head
|
14
|
+
|
12
15
|
before_install:
|
13
16
|
# stub mplayer/ffmpeg so it looks like they are installed
|
14
17
|
- mkdir -p ~/bin
|
15
18
|
- touch ~/bin/mplayer ~/bin/ffmpeg
|
16
19
|
- chmod +x ~/bin/mplayer ~/bin/ffmpeg
|
17
20
|
- export PATH=~/bin:$PATH
|
18
|
-
- gem update --system
|
19
21
|
- git --version
|
20
22
|
|
21
|
-
matrix:
|
22
|
-
allow_failures:
|
23
|
-
- rvm: ruby-head
|
24
|
-
|
25
23
|
notifications:
|
26
24
|
slack:
|
27
25
|
secure: BkGsQOYMJqW55j94S1QwmR17BkwuTIULKVhwzRdnv37BvVcC17y9KLMo8NH+bcao36XZx9DukXcTyaDQc6tCSlFEbG/FcPUJM8bx9EWjHUoGVg1KdpVu/nVHu+GKosrB41lM3nfJWCnF0TOSnmTXU+bV8Pwkij+L5X+gNyAT2Ns=
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,16 @@ project adheres to [Semantic Versioning][Semver].
|
|
7
7
|
|
8
8
|
* Your contribution here!
|
9
9
|
|
10
|
+
## [0.13.0][] (23 April 2019)
|
11
|
+
* Require at least Ruby 2.3
|
12
|
+
* Upgrade git gem dependency to 1.5.0 (@matthutchinson [#377][])
|
13
|
+
* Upgrade mini_magick gem dependency to 4.9.3 (@matthutchinson [#385][])
|
14
|
+
* Add History and Contributor section to README (@mroth [#385][])
|
15
|
+
* add frozen_string_literal: true comment to all Ruby files
|
16
|
+
* change $PATH override precedence in hooks installers
|
17
|
+
* Updated COC (Contributor Covenant v1.4)
|
18
|
+
* Added PR template
|
19
|
+
|
10
20
|
## [0.12.1][] (27 March 2018)
|
11
21
|
* Name passed to `Plugin::Base` initializer (@matthutchinson)
|
12
22
|
* Removed dead method `configured? in `Plugin::Base`
|
@@ -292,7 +302,7 @@ project adheres to [Semantic Versioning][Semver].
|
|
292
302
|
## 0.1.3 (18 May 2012)
|
293
303
|
* add LGPLv3 license
|
294
304
|
* add option to translate your commit message to lolspeak! (thx
|
295
|
-
to @DanielleSucher!).
|
305
|
+
to @DanielleSucher!). To enable, set `LOLCOMMITS_TRANZLATE=1`.
|
296
306
|
* fix issue with older versions of IM crashing on interline spacing (pull [#31][] via @german)
|
297
307
|
* fix issue with git repos with no hooks directory (pull [#43][] via @mkmaster)
|
298
308
|
* fix missing dash in capture -c
|
@@ -302,7 +312,7 @@ project adheres to [Semantic Versioning][Semver].
|
|
302
312
|
* bundle imagesnap as well to remove a dependency on Mac OS X
|
303
313
|
|
304
314
|
## 0.1.1 (21 April 2012)
|
305
|
-
* Windows compatibility!
|
315
|
+
* Windows compatibility! Thanks to @Prydonious.
|
306
316
|
|
307
317
|
## 0.1.0 (19 April 2012)
|
308
318
|
* Linux compatibility! Thanks to @madjar, @cscorely, and @Prydonius.
|
@@ -325,7 +335,8 @@ project adheres to [Semantic Versioning][Semver].
|
|
325
335
|
instead of compositing multiply image Caption objects (this seems to be more
|
326
336
|
reliable to not glitch.)
|
327
337
|
|
328
|
-
[Unreleased]: https://github.com/mroth/lolcommits/compare/v0.
|
338
|
+
[Unreleased]: https://github.com/mroth/lolcommits/compare/v0.13.0...HEAD
|
339
|
+
[0.13.0]: https://github.com/mroth/lolcommits/compare/v0.12.1...v0.13.0
|
329
340
|
[0.12.1]: https://github.com/mroth/lolcommits/compare/v0.12.0...v0.12.1
|
330
341
|
[0.12.0]: https://github.com/mroth/lolcommits/compare/v0.11.0...v0.12.0
|
331
342
|
[0.11.0]: https://github.com/mroth/lolcommits/compare/v0.10.0...v0.11.0
|
@@ -516,3 +527,6 @@ project adheres to [Semantic Versioning][Semver].
|
|
516
527
|
[#366]: https://github.com/mroth/lolcommits/pull/366
|
517
528
|
[#367]: https://github.com/mroth/lolcommits/pull/367
|
518
529
|
[#369]: https://github.com/mroth/lolcommits/pull/369
|
530
|
+
[#377]: https://github.com/mroth/lolcommits/pull/377
|
531
|
+
[#384]: https://github.com/mroth/lolcommits/pull/384
|
532
|
+
[#385]: https://github.com/mroth/lolcommits/pull/385
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,24 +1,41 @@
|
|
1
|
-
# Contributor Code of Conduct
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
|
-
|
4
|
-
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
-
contribute through reporting issues, posting feature requests, updating
|
6
|
-
documentation, submitting pull requests or patches, and other activities.
|
3
|
+
## Our Pledge
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
education, socio-economic status, nationality, personal appearance, race,
|
10
|
+
religion, or sexual identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
12
22
|
|
13
23
|
Examples of unacceptable behavior by participants include:
|
14
24
|
|
15
|
-
* The use of sexualized language or imagery
|
16
|
-
|
17
|
-
* Trolling
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
18
28
|
* Public or private harassment
|
19
|
-
* Publishing
|
20
|
-
|
21
|
-
* Other
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
22
39
|
|
23
40
|
Project maintainers have the right and responsibility to remove, edit, or
|
24
41
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
@@ -26,25 +43,31 @@ that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
26
43
|
permanently any contributor for other behaviors that they deem inappropriate,
|
27
44
|
threatening, offensive, or harmful.
|
28
45
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
33
54
|
|
34
|
-
|
35
|
-
when an individual is representing the project or its community.
|
55
|
+
## Enforcement
|
36
56
|
|
37
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
-
reported by contacting
|
58
|
+
reported by contacting the project team at matt@hiddenloop.com. All
|
39
59
|
complaints will be reviewed and investigated and will result in a response that
|
40
|
-
is deemed necessary and appropriate to the circumstances.
|
41
|
-
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
-
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
43
69
|
|
44
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
-
version
|
46
|
-
[http://contributor-covenant.org/version/1/3/0/][version]
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
47
72
|
|
48
|
-
[
|
49
|
-
[homepage]: http://contributor-covenant.org
|
50
|
-
[version]: http://contributor-covenant.org/version/1/3/0/
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
@@ -0,0 +1,16 @@
|
|
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.
|
data/README.md
CHANGED
@@ -9,9 +9,21 @@ By default, the lol images are stored by a Github style short SHA in a
|
|
9
9
|
|
10
10
|
[![Gem Version](https://badge.fury.io/rb/lolcommits.svg)](https://rubygems.org/gems/lolcommits)
|
11
11
|
[![Build Status](https://travis-ci.org/mroth/lolcommits.svg?branch=master)](https://travis-ci.org/mroth/lolcommits)
|
12
|
-
[![
|
13
|
-
[![Maintainability](https://
|
14
|
-
[![Test Coverage](https://
|
12
|
+
[![Depfu](https://img.shields.io/depfu/mroth/lolcommits.svg?style=flat)](https://depfu.com/github/mroth/lolcommits)
|
13
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/9d87301dd4fa2184382c/maintainability)](https://codeclimate.com/github/mroth/lolcommits/maintainability)
|
14
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/9d87301dd4fa2184382c/test_coverage)](https://codeclimate.com/github/mroth/lolcommits/test_coverage)
|
15
|
+
|
16
|
+
## History
|
17
|
+
|
18
|
+
Originally created by [@mroth] in 2011 as a joke project for [Hack && Tell], lolcommits has grown considerably since then, and is now
|
19
|
+
primarily maintained by [@matthutchinson].
|
20
|
+
|
21
|
+
Thank you to all of the [contributors] throughout the years!
|
22
|
+
|
23
|
+
[@mroth]: https://github.com/mroth
|
24
|
+
[@matthutchinson]: https://github.com/matthutchinson
|
25
|
+
[Hack && Tell]: https://hackandtell.org
|
26
|
+
[contributors]: https://github.com/mroth/lolcommits/graphs/contributors
|
15
27
|
|
16
28
|
## Sample images
|
17
29
|
|
data/Rakefile
CHANGED
@@ -42,8 +42,8 @@ Cucumber::Rake::Task.new(:features) do |t|
|
|
42
42
|
end
|
43
43
|
|
44
44
|
Rake::RDocTask.new do |rd|
|
45
|
-
rd.main = 'README.
|
46
|
-
rd.rdoc_files.include('README.
|
45
|
+
rd.main = 'README.md'
|
46
|
+
rd.rdoc_files.include('README.md', 'lib/**/*.rb', 'bin/**/*')
|
47
47
|
end
|
48
48
|
|
49
49
|
require 'rubocop/rake_task'
|
data/bin/lolcommits
CHANGED
data/features/support/env.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
#
|
2
|
-
if Lolcommits::Platform.platform_windows?
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
3
|
+
if Lolcommits::Platform.platform_windows?
|
4
4
|
module Mercurial
|
5
5
|
class Command
|
6
6
|
private
|
7
7
|
|
8
|
+
# need to use popen3 on windows - popen4 always eventually calls fork
|
8
9
|
def execution_proc
|
9
10
|
proc do
|
10
11
|
debug(command)
|
@@ -1,6 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Mercurial
|
3
4
|
class Shell
|
5
|
+
# windows command line doesn't like single quotes
|
4
6
|
def self.interpolate_arguments(cmd_with_args)
|
5
7
|
cmd_with_args.shift.tap do |cmd|
|
6
8
|
cmd.gsub!(/\?/) do
|
data/lib/lolcommits.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
$LOAD_PATH.unshift File.expand_path('.')
|
4
4
|
|
5
5
|
require 'mini_magick'
|
6
|
-
require 'core_ext/mini_magick/utilities'
|
7
6
|
require 'fileutils'
|
8
7
|
require 'git'
|
9
8
|
require 'open3'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Lolcommits
|
2
4
|
#
|
3
5
|
# Methods to handle enabling and disabling of lolcommits
|
@@ -61,17 +63,17 @@ module Lolcommits
|
|
61
63
|
ruby_path = Lolcommits::Platform.command_which('ruby', true)
|
62
64
|
imagick_path = Lolcommits::Platform.command_which('identify', true)
|
63
65
|
capture_cmd = "if [ ! -d \"$GIT_DIR/rebase-merge\" ] && [ \"$LOLCOMMITS_CAPTURE_DISABLED\" != \"true\" ]; then lolcommits --capture #{capture_args}; fi"
|
64
|
-
exports = "LANG=\"#{ENV['LANG']}\" && PATH=\"
|
66
|
+
exports = "LANG=\"#{ENV['LANG']}\" && PATH=\"$PATH:#{ruby_path}:#{imagick_path}\""
|
65
67
|
|
66
68
|
if Lolcommits::Platform.platform_windows?
|
67
|
-
exports = "set path=\"
|
69
|
+
exports = "set path=\"%PATH%;#{ruby_path};#{imagick_path}\""
|
68
70
|
end
|
69
71
|
|
70
72
|
<<-HOOK
|
71
|
-
### lolcommits hook (begin) ###
|
72
|
-
#{exports} && #{capture_cmd}
|
73
|
-
### lolcommits hook (end) ###
|
74
|
-
HOOK
|
73
|
+
### lolcommits hook (begin) ###
|
74
|
+
#{exports} && #{capture_cmd}
|
75
|
+
### lolcommits hook (end) ###
|
76
|
+
HOOK
|
75
77
|
end
|
76
78
|
|
77
79
|
# does a git hook exist at all?
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Lolcommits
|
2
4
|
#
|
3
5
|
# Methods to handle enabling and disabling of lolcommits
|
@@ -41,13 +43,17 @@ module Lolcommits
|
|
41
43
|
ruby_path = Lolcommits::Platform.command_which('ruby', true)
|
42
44
|
imagick_path = Lolcommits::Platform.command_which('identify', true)
|
43
45
|
capture_cmd = "if [ \"$LOLCOMMITS_CAPTURE_DISABLED\" != \"true\" ]; then lolcommits --capture #{capture_args}; fi"
|
44
|
-
exports = "LANG=\"#{ENV['LANG']}\" && PATH=\"
|
46
|
+
exports = "LANG=\"#{ENV['LANG']}\" && PATH=\"$PATH:#{ruby_path}:#{imagick_path}\""
|
45
47
|
|
46
48
|
if Lolcommits::Platform.platform_windows?
|
47
|
-
exports = "set path=\"
|
49
|
+
exports = "set path=\"%PATH%;#{ruby_path};#{imagick_path}\""
|
48
50
|
end
|
49
51
|
|
50
|
-
|
52
|
+
<<-HOOK
|
53
|
+
### lolcommits hook (begin) ###
|
54
|
+
#{exports} && #{capture_cmd}
|
55
|
+
### lolcommits hook (end) ###
|
56
|
+
HOOK
|
51
57
|
end
|
52
58
|
|
53
59
|
def self.repository
|
data/lib/lolcommits/capturer.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Lolcommits
|
2
4
|
class CaptureLinuxAnimated < Capturer
|
3
5
|
def capture
|
@@ -8,6 +10,7 @@ module Lolcommits
|
|
8
10
|
# capture the raw video with ffmpeg video4linux2
|
9
11
|
system_call "ffmpeg -v quiet -y -f video4linux2 -video_size 320x240 -i #{capture_device_string} -t #{capture_duration} \"#{video_location}\" > /dev/null"
|
10
12
|
return unless File.exist?(video_location)
|
13
|
+
|
11
14
|
# convert raw video to png frames with ffmpeg
|
12
15
|
system_call "ffmpeg #{capture_delay_string} -v quiet -i \"#{video_location}\" -t #{animated_duration} \"#{frames_location}/%09d.png\" > /dev/null"
|
13
16
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Lolcommits
|
2
4
|
class CaptureMacAnimated < Capturer
|
3
5
|
def capture
|
@@ -8,6 +10,7 @@ module Lolcommits
|
|
8
10
|
# capture the raw video with videosnap
|
9
11
|
system_call "#{executable_path} -s 240 #{capture_device_string}#{capture_delay_string}-t #{animated_duration} --no-audio \"#{video_location}\" > /dev/null"
|
10
12
|
return unless File.exist?(video_location)
|
13
|
+
|
11
14
|
# get fps for ffmpeg output stream configuration
|
12
15
|
fps = video_fps(video_location)
|
13
16
|
# convert raw video to png frames with ffmpeg
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Lolcommits
|
2
4
|
class CaptureWindowsAnimated < Capturer
|
3
5
|
def capture
|
@@ -12,6 +14,7 @@ module Lolcommits
|
|
12
14
|
system_call "ffmpeg -v quiet -y -f dshow -i video=\"#{capture_device_string}\" -video_size 320x240 -t #{capture_duration} \"#{video_location}\" > NUL"
|
13
15
|
|
14
16
|
return unless File.exist?(video_location)
|
17
|
+
|
15
18
|
# convert raw video to png frames with ffmpeg
|
16
19
|
system_call "ffmpeg #{capture_delay_string} -v quiet -i \"#{video_location}\" -t #{animated_duration} \"#{frames_location}/%09d.png\" > NUL"
|
17
20
|
|
@@ -48,6 +51,7 @@ module Lolcommits
|
|
48
51
|
cmd_output = system_call(ffpmeg_list_devices_cmd, true)
|
49
52
|
count += 1
|
50
53
|
raise 'failed to find a video capture device with ffmpeg -list_devices' if count == 5
|
54
|
+
|
51
55
|
sleep 0.1
|
52
56
|
end
|
53
57
|
cmd_output.gsub!("\r\n", "\n")
|
data/lib/lolcommits/cli.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lolcommits/platform'
|
2
4
|
require 'methadone'
|
3
5
|
|
@@ -16,6 +18,7 @@ module Lolcommits
|
|
16
18
|
if Platform.platform_mac?
|
17
19
|
%w(imagesnap videosnap).each do |executable|
|
18
20
|
next if File.executable? File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', executable, executable)
|
21
|
+
|
19
22
|
fatal "Couldn't properly execute #{executable} for some reason, "\
|
20
23
|
'please file a bug?!'
|
21
24
|
exit 1
|
@@ -36,6 +39,7 @@ module Lolcommits
|
|
36
39
|
|
37
40
|
# check for a error condition with git config affecting ruby-git
|
38
41
|
return unless Platform.git_config_color_always?
|
42
|
+
|
39
43
|
fatal 'Due to a bug in the ruby-git library, git config for color.ui'\
|
40
44
|
" cannot be set to 'always'."
|
41
45
|
fatal "Try setting it to 'auto' instead!"
|
@@ -47,6 +51,7 @@ module Lolcommits
|
|
47
51
|
# this when you know the user wants to perform one of them.
|
48
52
|
def self.die_if_no_valid_ffmpeg_installed!
|
49
53
|
return if Platform.valid_ffmpeg_installed?
|
54
|
+
|
50
55
|
fatal 'FATAL: ffmpeg does not appear to be properly installed!'
|
51
56
|
exit 1
|
52
57
|
end
|
@@ -59,6 +64,7 @@ module Lolcommits
|
|
59
64
|
parent = File.dirname(current)
|
60
65
|
while current != parent
|
61
66
|
return if VCSInfo.repo_root?(current)
|
67
|
+
|
62
68
|
current = parent
|
63
69
|
parent = File.dirname(current)
|
64
70
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Lolcommits
|
2
4
|
class Configuration
|
3
5
|
LOLCOMMITS_BASE = ENV['LOLCOMMITS_DIR'] || File.join(ENV['HOME'], '.lolcommits')
|
@@ -14,6 +16,7 @@ module Lolcommits
|
|
14
16
|
def yaml
|
15
17
|
@yaml ||= begin
|
16
18
|
return Hash.new({}) unless File.exist?(configuration_file)
|
19
|
+
|
17
20
|
YAML.safe_load(File.open(configuration_file), [Symbol]) || Hash.new({})
|
18
21
|
end
|
19
22
|
end
|
@@ -24,6 +27,7 @@ module Lolcommits
|
|
24
27
|
|
25
28
|
def loldir
|
26
29
|
return @loldir if @loldir
|
30
|
+
|
27
31
|
basename ||= if VCSInfo.repo_root?
|
28
32
|
VCSInfo.local_name
|
29
33
|
else
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Lolcommits
|
2
4
|
#
|
3
5
|
# Methods to handle enabling and disabling of lolcommits
|
@@ -42,6 +44,7 @@ module Lolcommits
|
|
42
44
|
def self.extract_capture_args(options)
|
43
45
|
options.map do |k, v|
|
44
46
|
next unless %w(device animate delay stealth fork).include?(k)
|
47
|
+
|
45
48
|
if k == 'device'
|
46
49
|
"--device '#{v}'"
|
47
50
|
else
|
data/lib/lolcommits/platform.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'mini_magick'
|
2
4
|
require 'rbconfig'
|
3
5
|
|
@@ -61,7 +63,9 @@ module Lolcommits
|
|
61
63
|
# @return Boolean
|
62
64
|
def self.valid_imagemagick_installed?
|
63
65
|
return false unless command_which('identify')
|
66
|
+
|
64
67
|
return false unless command_which('mogrify')
|
68
|
+
|
65
69
|
# cli_version check will throw a MiniMagick::Error exception if IM is not
|
66
70
|
# installed in PATH, since it attempts to parse output from `identify`
|
67
71
|
!MiniMagick.cli_version.nil?
|
@@ -118,6 +122,7 @@ module Lolcommits
|
|
118
122
|
def self.device_list
|
119
123
|
# TODO: handle other platforms here (linux/windows) e.g with ffmpeg -list_devices
|
120
124
|
return unless Platform.platform_mac?
|
125
|
+
|
121
126
|
capturer = Lolcommits::CaptureMacAnimated.new
|
122
127
|
`#{capturer.executable_path} -l`
|
123
128
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lolcommits/plugin/configuration_helper'
|
2
4
|
|
3
5
|
module Lolcommits
|
@@ -75,11 +77,13 @@ module Lolcommits
|
|
75
77
|
# dont puts or print if the runner wants to be silent (stealth mode)
|
76
78
|
def puts(*args)
|
77
79
|
return if runner && runner.capture_stealth
|
80
|
+
|
78
81
|
super(*args)
|
79
82
|
end
|
80
83
|
|
81
84
|
def print(*args)
|
82
85
|
return if runner && runner.capture_stealth
|
86
|
+
|
83
87
|
super(*args)
|
84
88
|
end
|
85
89
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Lolcommits
|
2
4
|
module Plugin
|
3
5
|
module ConfigurationHelper
|
@@ -43,6 +45,7 @@ module Lolcommits
|
|
43
45
|
|
44
46
|
while (line = Readline.readline(prompt, true).strip)
|
45
47
|
return line if words.include?(line)
|
48
|
+
|
46
49
|
puts "'#{line}' not found"
|
47
50
|
end
|
48
51
|
end
|
data/lib/lolcommits/runner.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lolcommits/platform'
|
2
4
|
|
3
5
|
module Lolcommits
|
@@ -12,6 +14,7 @@ module Lolcommits
|
|
12
14
|
end
|
13
15
|
|
14
16
|
return unless sha.nil? || message.nil?
|
17
|
+
|
15
18
|
if GitInfo.repo_root?
|
16
19
|
self.vcs_info = GitInfo.new
|
17
20
|
elsif MercurialInfo.repo_root?
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Lolcommits
|
2
4
|
module TestHelpers
|
3
5
|
module GitRepo
|
@@ -19,6 +21,7 @@ module Lolcommits
|
|
19
21
|
|
20
22
|
def setup_repo
|
21
23
|
return if repo_exists?
|
24
|
+
|
22
25
|
`git init --quiet #{repo_path}`
|
23
26
|
end
|
24
27
|
|
@@ -31,6 +34,7 @@ module Lolcommits
|
|
31
34
|
|
32
35
|
def in_repo
|
33
36
|
return unless repo_exists?
|
37
|
+
|
34
38
|
Dir.chdir(File.expand_path(repo_path)) do
|
35
39
|
yield
|
36
40
|
end
|
data/lib/lolcommits/vcs_info.rb
CHANGED
data/lib/lolcommits/version.rb
CHANGED
data/lolcommits.gemspec
CHANGED
@@ -8,7 +8,6 @@ Gem::Specification.new do |s|
|
|
8
8
|
|
9
9
|
s.authors = ['Matthew Rothenberg', 'Matthew Hutchinson']
|
10
10
|
s.email = ['mrothenberg@gmail.com', 'matt@hiddenloop.com']
|
11
|
-
s.homepage = 'http://mroth.github.com/lolcommits/'
|
12
11
|
s.license = 'LGPL-3'
|
13
12
|
s.summary = 'Capture webcam image on git commit for lulz.'
|
14
13
|
|
@@ -16,7 +15,15 @@ Gem::Specification.new do |s|
|
|
16
15
|
lolcommits takes a snapshot with your webcam every time you git commit code,
|
17
16
|
and archives a lolcat style image with it. It's selfies for software
|
18
17
|
developers. `git blame` has never been so much fun.
|
19
|
-
DESC
|
18
|
+
DESC
|
19
|
+
|
20
|
+
s.metadata = {
|
21
|
+
'homepage_uri' => 'https://lolcommits.github.io',
|
22
|
+
'source_code_uri' => 'https://github.com/mroth/lolcommits',
|
23
|
+
'changelog_uri' => 'https://github.com/mroth/lolcommits/blob/master/CHANGELOG.md',
|
24
|
+
'bug_tracker_uri' => 'https://github.com/mroth/lolcommits/issues',
|
25
|
+
'allowed_push_host' => 'https://rubygems.org'
|
26
|
+
}
|
20
27
|
|
21
28
|
s.post_install_message = <<-POSTINSTALL
|
22
29
|
-------------------------------------------------------------------------------
|
@@ -36,7 +43,7 @@ DESC
|
|
36
43
|
Happy Lol'ing!
|
37
44
|
|
38
45
|
-------------------------------------------------------------------------------
|
39
|
-
POSTINSTALL
|
46
|
+
POSTINSTALL
|
40
47
|
|
41
48
|
s.files = `git ls-files`.split("\n")
|
42
49
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -44,17 +51,17 @@ POSTINSTALL
|
|
44
51
|
s.require_paths = ['lib']
|
45
52
|
|
46
53
|
# non-gem dependencies
|
47
|
-
s.required_ruby_version = '>= 2.
|
54
|
+
s.required_ruby_version = '>= 2.3'
|
48
55
|
s.requirements << 'imagemagick'
|
49
56
|
s.requirements << 'a webcam'
|
50
57
|
|
51
58
|
# core
|
52
59
|
s.add_runtime_dependency('methadone', '~> 1.9.5')
|
53
60
|
s.add_runtime_dependency('mercurial-ruby', '~> 0.7.12')
|
54
|
-
s.add_runtime_dependency('mini_magick', '~> 4.
|
61
|
+
s.add_runtime_dependency('mini_magick', '~> 4.9.3')
|
55
62
|
s.add_runtime_dependency('launchy', '~> 2.4.3')
|
56
63
|
s.add_runtime_dependency('open4', '~> 1.3.4')
|
57
|
-
s.add_runtime_dependency('git', '~> 1.
|
64
|
+
s.add_runtime_dependency('git', '~> 1.5.0')
|
58
65
|
|
59
66
|
# included plugins
|
60
67
|
s.add_runtime_dependency('lolcommits-loltext', '~> 0.0.5')
|
data/test/permissions_test.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
|
2
4
|
|
3
5
|
class PermissionsTest < Minitest::Test
|
@@ -10,11 +12,8 @@ class PermissionsTest < Minitest::Test
|
|
10
12
|
videosnap_perms = File.lstat(File.join(Lolcommits::Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'videosnap', 'videosnap')).mode & 0o777
|
11
13
|
commandcam_perms = File.lstat(File.join(Lolcommits::Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'CommandCam', 'CommandCam.exe')).mode & 0o777
|
12
14
|
|
13
|
-
assert imagesnap_perms
|
14
|
-
|
15
|
-
assert
|
16
|
-
"expected perms of 755/775 but instead got #{format '%<perms>o', perms: videosnap_perms}"
|
17
|
-
assert commandcam_perms == 0o755 || commandcam_perms == 0o775,
|
18
|
-
"expected perms of 755/775 but instead got #{format '%<perms>o', perms: commandcam_perms}"
|
15
|
+
assert [0o755, 0o775].include?(imagesnap_perms), "expected perms of 755/775 but instead got #{format '%<perms>o', perms: imagesnap_perms}"
|
16
|
+
assert [0o755, 0o775].include?(videosnap_perms), "expected perms of 755/775 but instead got #{format '%<perms>o', perms: videosnap_perms}"
|
17
|
+
assert [0o755, 0o775].include?(commandcam_perms), "expected perms of 755/775 but instead got #{format '%<perms>o', perms: commandcam_perms}"
|
19
18
|
end
|
20
19
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolcommits
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Rothenberg
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: methadone
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 4.
|
48
|
+
version: 4.9.3
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 4.
|
55
|
+
version: 4.9.3
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: launchy
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,14 +87,14 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 1.
|
90
|
+
version: 1.5.0
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 1.
|
97
|
+
version: 1.5.0
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: lolcommits-loltext
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -245,6 +245,7 @@ files:
|
|
245
245
|
- CONTRIBUTING.md
|
246
246
|
- Gemfile
|
247
247
|
- LICENSE
|
248
|
+
- PULL_REQUEST_TEMPLATE.md
|
248
249
|
- README.md
|
249
250
|
- Rakefile
|
250
251
|
- appveyor.yml
|
@@ -256,10 +257,8 @@ files:
|
|
256
257
|
- features/step_definitions/lolcommits_steps.rb
|
257
258
|
- features/support/env.rb
|
258
259
|
- features/support/path_helpers.rb
|
259
|
-
- lib/core_ext/hash/hash_dig.rb
|
260
260
|
- lib/core_ext/mercurial-ruby/command.rb
|
261
261
|
- lib/core_ext/mercurial-ruby/shell.rb
|
262
|
-
- lib/core_ext/mini_magick/utilities.rb
|
263
262
|
- lib/lolcommits.rb
|
264
263
|
- lib/lolcommits/backends/git_info.rb
|
265
264
|
- lib/lolcommits/backends/installation_git.rb
|
@@ -285,7 +284,6 @@ files:
|
|
285
284
|
- lib/lolcommits/platform.rb
|
286
285
|
- lib/lolcommits/plugin/base.rb
|
287
286
|
- lib/lolcommits/plugin/configuration_helper.rb
|
288
|
-
- lib/lolcommits/plugin/lol_yammer.rb
|
289
287
|
- lib/lolcommits/plugin_manager.rb
|
290
288
|
- lib/lolcommits/runner.rb
|
291
289
|
- lib/lolcommits/test_helpers/fake_io.rb
|
@@ -302,10 +300,15 @@ files:
|
|
302
300
|
- vendor/ext/imagesnap/ReadMeOrDont.rtf
|
303
301
|
- vendor/ext/imagesnap/imagesnap
|
304
302
|
- vendor/ext/videosnap/videosnap
|
305
|
-
homepage:
|
303
|
+
homepage:
|
306
304
|
licenses:
|
307
305
|
- LGPL-3
|
308
|
-
metadata:
|
306
|
+
metadata:
|
307
|
+
homepage_uri: https://lolcommits.github.io
|
308
|
+
source_code_uri: https://github.com/mroth/lolcommits
|
309
|
+
changelog_uri: https://github.com/mroth/lolcommits/blob/master/CHANGELOG.md
|
310
|
+
bug_tracker_uri: https://github.com/mroth/lolcommits/issues
|
311
|
+
allowed_push_host: https://rubygems.org
|
309
312
|
post_install_message: |2
|
310
313
|
-------------------------------------------------------------------------------
|
311
314
|
|
@@ -331,7 +334,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
331
334
|
requirements:
|
332
335
|
- - ">="
|
333
336
|
- !ruby/object:Gem::Version
|
334
|
-
version: '2.
|
337
|
+
version: '2.3'
|
335
338
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
336
339
|
requirements:
|
337
340
|
- - ">="
|
@@ -340,17 +343,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
340
343
|
requirements:
|
341
344
|
- imagemagick
|
342
345
|
- a webcam
|
343
|
-
|
344
|
-
rubygems_version: 2.7.3
|
346
|
+
rubygems_version: 3.0.3
|
345
347
|
signing_key:
|
346
348
|
specification_version: 4
|
347
349
|
summary: Capture webcam image on git commit for lulz.
|
348
|
-
test_files:
|
349
|
-
- features/bugs.feature
|
350
|
-
- features/lolcommits.feature
|
351
|
-
- features/step_definitions/lolcommits_steps.rb
|
352
|
-
- features/support/env.rb
|
353
|
-
- features/support/path_helpers.rb
|
354
|
-
- test/images/test_image.jpg
|
355
|
-
- test/permissions_test.rb
|
356
|
-
- test/test_helper.rb
|
350
|
+
test_files: []
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# Backport Hash#dig to Ruby < 2.3
|
2
|
-
# inspired by https://github.com/Invoca/ruby_dig
|
3
|
-
|
4
|
-
module HashDig
|
5
|
-
def dig(key, *rest)
|
6
|
-
value = self[key]
|
7
|
-
if value.nil? || rest.empty?
|
8
|
-
value
|
9
|
-
elsif value.respond_to?(:dig)
|
10
|
-
value.dig(*rest)
|
11
|
-
else
|
12
|
-
raise TypeError, "#{value.class} does not have #dig method"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
if RUBY_VERSION < '2.3'
|
18
|
-
class Hash
|
19
|
-
include HashDig
|
20
|
-
end
|
21
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# To maintain MiniMagick compatibility on Windows for v3.8.1 we need this patch
|
2
|
-
# If/when we upgrade MiniMagick to 4.2+ this patch can be removed
|
3
|
-
# We are locked at v3.8.1 since MiniMagick 4+ dropped support for Ruby 1.8.7
|
4
|
-
module MiniMagick
|
5
|
-
module Utilities
|
6
|
-
class << self
|
7
|
-
# fixes issue introduced in this commit
|
8
|
-
# https://github.com/minimagick/minimagick/commit/65b6427395cbfe6
|
9
|
-
def windows_escape(cmdline)
|
10
|
-
'"' + cmdline.gsub(/\\(?=\\*\")/, '\\\\\\').gsub(/\"/, '\\"').gsub(/\\$/, '\\\\\\').gsub('%', '%%') + '"'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
File without changes
|