lolcommits-term_output 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -3
- data/README.md +31 -26
- data/lib/lolcommits/plugin/term_output.rb +28 -10
- data/lib/lolcommits/term_output/version.rb +1 -1
- data/lolcommits-term_output.gemspec +8 -15
- data/test/lolcommits/plugin/term_output_test.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ae550e3afc8a28f05357eb39bc55721eee09ecac0712d39ea291d93105e6d44
|
4
|
+
data.tar.gz: ae046fb5b4e7fc06dd0473a24482ba7d9a0a3617e45c95977ea34dff5b1d55ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ffe0d92834700718178a23131a6fe326ca3643ea3251fb199477571cb4fb6c8a68959b458e5048eab85e36aac410efbeb6fdebff17bfed05311356e8e975906
|
7
|
+
data.tar.gz: 12c7c95e7a8979975a4b12406a8f16c8a2b35fc7dc42d8f3ef16c902e7f9fc5ddf7a8a9b1ad69cf3fbea364dfcca8e744767b2faa87240888c6d6b271d47ab33
|
data/CHANGELOG.md
CHANGED
@@ -2,13 +2,23 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
The format is based on [Keep a Changelog][KeepAChangelog] and this
|
6
|
-
adheres to [Semantic Versioning][Semver].
|
5
|
+
The format is based on [Keep a Changelog][KeepAChangelog] and this
|
6
|
+
project adheres to [Semantic Versioning][Semver].
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
10
|
- Your contribution here!
|
11
11
|
|
12
|
+
## [0.3.0] - 2019-05-20
|
13
|
+
### Changed
|
14
|
+
- lolcommits gem is a runtime dependency
|
15
|
+
- Use `lolcommit_path` (instead of `main_image`)
|
16
|
+
- Requires at least lolcommits >= `0.14.2`
|
17
|
+
- Updated README and gemspec
|
18
|
+
|
19
|
+
### Removed
|
20
|
+
- Support for lolcommits < `0.14.2`
|
21
|
+
|
12
22
|
## [0.2.0] - 2019-04-24
|
13
23
|
### Removed
|
14
24
|
- Support for Ruby < 2.3 (older rubies no longer supported)
|
@@ -50,7 +60,8 @@ adheres to [Semantic Versioning][Semver].
|
|
50
60
|
### Changed
|
51
61
|
- Initial release
|
52
62
|
|
53
|
-
[Unreleased]: https://github.com/lolcommits/lolcommits-term_output/compare/v0.
|
63
|
+
[Unreleased]: https://github.com/lolcommits/lolcommits-term_output/compare/v0.3.0...HEAD
|
64
|
+
[0.3.0]: https://github.com/lolcommits/lolcommits-term_output/compare/v0.2.0...v0.3.0
|
54
65
|
[0.2.0]: https://github.com/lolcommits/lolcommits-term_output/compare/v0.1.1...v0.2.0
|
55
66
|
[0.1.1]: https://github.com/lolcommits/lolcommits-term_output/compare/v0.1.0...v0.1.1
|
56
67
|
[0.1.0]: https://github.com/lolcommits/lolcommits-term_output/compare/v0.0.6...v0.1.0
|
data/README.md
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
# Lolcommits Term Output
|
2
2
|
|
3
3
|
[![Gem](https://img.shields.io/gem/v/lolcommits-term_output.svg?style=flat)](http://rubygems.org/gems/lolcommits-term_output)
|
4
|
-
[![Travis](https://
|
4
|
+
[![Travis](https://img.shields.io/travis/com/lolcommits/lolcommits-term_output/master.svg?style=flat)](https://travis-ci.com/lolcommits/lolcommits-term_output)
|
5
5
|
[![Depfu](https://img.shields.io/depfu/lolcommits/lolcommits-term_output.svg?style=flat)](https://depfu.com/github/lolcommits/lolcommits-term_output)
|
6
6
|
[![Maintainability](https://api.codeclimate.com/v1/badges/3f2a468adb10524add39/maintainability)](https://codeclimate.com/github/lolcommits/lolcommits-term_output/maintainability)
|
7
7
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/3f2a468adb10524add39/test_coverage)](https://codeclimate.com/github/lolcommits/lolcommits-term_output/test_coverage)
|
8
8
|
|
9
|
-
[lolcommits](https://lolcommits.github.io/) takes a snapshot with your
|
10
|
-
every time you git commit code, and archives a lolcat style image
|
11
|
-
blame has never been so much fun!
|
9
|
+
[lolcommits](https://lolcommits.github.io/) takes a snapshot with your
|
10
|
+
webcam every time you git commit code, and archives a lolcat style image
|
11
|
+
with it. Git blame has never been so much fun!
|
12
12
|
|
13
|
-
This plugin uses the [inline
|
14
|
-
|
15
|
-
|
13
|
+
This plugin uses the [inline
|
14
|
+
image](http://iterm2.com/documentation-images.html) feature available in
|
15
|
+
[iTerm2](http://iterm2.com/index.html) to display each lolcommit (images
|
16
|
+
only) in your terminal (after committing). For example:
|
16
17
|
|
17
18
|
![iterm inline sample screenshot](./assets/images/sample.png)
|
18
19
|
|
@@ -35,20 +36,20 @@ Then configure to enable and set the remote endpoint:
|
|
35
36
|
$ lolcommits --config -p term_output
|
36
37
|
# set enabled to `true`
|
37
38
|
|
38
|
-
That's it! Your next lolcommit will be displayed within your terminal.
|
39
|
-
disable use:
|
39
|
+
That's it! Your next lolcommit will be displayed within your terminal.
|
40
|
+
To disable use:
|
40
41
|
|
41
42
|
$ lolcommits --config -p term_output
|
42
43
|
# and set enabled to `false`
|
43
44
|
|
44
45
|
## Development
|
45
46
|
|
46
|
-
Check out this repo and run `bin/setup`, this will install all
|
47
|
-
generate docs. Use `bundle exec rake` to run all tests
|
48
|
-
report.
|
47
|
+
Check out this repo and run `bin/setup`, this will install all
|
48
|
+
dependencies and generate docs. Use `bundle exec rake` to run all tests
|
49
|
+
and generate a coverage report.
|
49
50
|
|
50
|
-
You can also run `bin/console` for an interactive prompt that will allow
|
51
|
-
experiment with the gem code.
|
51
|
+
You can also run `bin/console` for an interactive prompt that will allow
|
52
|
+
you to experiment with the gem code.
|
52
53
|
|
53
54
|
## Tests
|
54
55
|
|
@@ -65,25 +66,29 @@ Generate docs for this gem with:
|
|
65
66
|
## Troubles?
|
66
67
|
|
67
68
|
If you think something is broken or missing, please raise a new
|
68
|
-
[issue](https://github.com/lolcommits/lolcommits-term_output/issues).
|
69
|
-
a moment to check it hasn't been raised in the past (and possibly
|
69
|
+
[issue](https://github.com/lolcommits/lolcommits-term_output/issues).
|
70
|
+
Take a moment to check it hasn't been raised in the past (and possibly
|
71
|
+
closed).
|
70
72
|
|
71
73
|
## Contributing
|
72
74
|
|
73
|
-
Bug
|
74
|
-
|
75
|
-
|
75
|
+
Bug
|
76
|
+
[reports](https://github.com/lolcommits/lolcommits-term_output/issues)
|
77
|
+
and [pull
|
78
|
+
requests](https://github.com/lolcommits/lolcommits-term_output/pulls)
|
79
|
+
are welcome on GitHub.
|
76
80
|
|
77
|
-
When submitting pull requests, remember to add tests covering any new
|
78
|
-
and ensure all tests are passing on [Travis
|
79
|
-
CI](https://travis-ci.
|
81
|
+
When submitting pull requests, remember to add tests covering any new
|
82
|
+
behaviour, and ensure all tests are passing on [Travis
|
83
|
+
CI](https://travis-ci.com/lolcommits/lolcommits-term_output). Read the
|
80
84
|
[contributing
|
81
85
|
guidelines](https://github.com/lolcommits/lolcommits-term_output/blob/master/CONTRIBUTING.md)
|
82
86
|
for more details.
|
83
87
|
|
84
|
-
This project is intended to be a safe, welcoming space for
|
85
|
-
contributors are expected to adhere to the
|
86
|
-
Covenant](http://contributor-covenant.org) code of conduct.
|
88
|
+
This project is intended to be a safe, welcoming space for
|
89
|
+
collaboration, and contributors are expected to adhere to the
|
90
|
+
[Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
91
|
+
See
|
87
92
|
[here](https://github.com/lolcommits/lolcommits-term_output/blob/master/CODE_OF_CONDUCT.md)
|
88
93
|
for more details.
|
89
94
|
|
@@ -94,7 +99,7 @@ The gem is available as open source under the terms of
|
|
94
99
|
|
95
100
|
## Links
|
96
101
|
|
97
|
-
* [Travis CI](https://travis-ci.
|
102
|
+
* [Travis CI](https://travis-ci.com/lolcommits/lolcommits-term_output)
|
98
103
|
* [Code Climate](https://codeclimate.com/github/lolcommits/lolcommits-term_output)
|
99
104
|
* [Test Coverage](https://codeclimate.com/github/lolcommits/lolcommits-term_output/coverage)
|
100
105
|
* [RDoc](http://rdoc.info/projects/lolcommits/lolcommits-term_output)
|
@@ -23,9 +23,10 @@ module Lolcommits
|
|
23
23
|
end
|
24
24
|
|
25
25
|
##
|
26
|
-
# Post-capture hook, runs after lolcommits captures a snapshot. If
|
27
|
-
# terminal is supported (and we have commits) the lolcommit
|
28
|
-
# rendered inline to the terminal output (with the
|
26
|
+
# Post-capture hook, runs after lolcommits captures a snapshot. If
|
27
|
+
# the # terminal is supported (and we have commits) the lolcommit
|
28
|
+
# image is rendered inline to the terminal output (with the
|
29
|
+
# commit message).
|
29
30
|
#
|
30
31
|
# See here for more details: https://iterm2.com/documentation-images.html
|
31
32
|
#
|
@@ -33,8 +34,11 @@ module Lolcommits
|
|
33
34
|
if terminal_supported?
|
34
35
|
if !runner.vcs_info || runner.vcs_info.repo.empty?
|
35
36
|
debug 'repo is empty, skipping term output'
|
37
|
+
elsif !image_path
|
38
|
+
debug 'lolcommit videos not supported'
|
36
39
|
else
|
37
|
-
|
40
|
+
debug "rendering image in iTerm"
|
41
|
+
base64 = Base64.encode64(open(image_path, &:read).to_s)
|
38
42
|
puts "#{begin_escape}1337;File=inline=1:#{base64};alt=#{runner.message};#{end_escape}\n"
|
39
43
|
end
|
40
44
|
else
|
@@ -45,8 +49,22 @@ module Lolcommits
|
|
45
49
|
private
|
46
50
|
|
47
51
|
##
|
48
|
-
#
|
49
|
-
#
|
52
|
+
# The full path to the lolcommit image (gif or jpg), returns nil
|
53
|
+
# if runner only captured a video
|
54
|
+
#
|
55
|
+
# @return [String] file path
|
56
|
+
#
|
57
|
+
def image_path
|
58
|
+
@image_path ||= if runner.capture_video && !runner.capture_gif
|
59
|
+
nil
|
60
|
+
else
|
61
|
+
runner.capture_gif ? runner.lolcommit_gif_path : runner.lolcommit_path
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# Generate starting escape character sequence. Terminals running
|
67
|
+
# Tmux sessions require a different escape code.
|
50
68
|
#
|
51
69
|
# @return [String] escape char sequence for inline images
|
52
70
|
#
|
@@ -55,8 +73,8 @@ module Lolcommits
|
|
55
73
|
end
|
56
74
|
|
57
75
|
##
|
58
|
-
# Generate ending escape character sequence. Terminals running
|
59
|
-
# sessions require a different escape code.
|
76
|
+
# Generate ending escape character sequence. Terminals running
|
77
|
+
# Tmux sessions require a different escape code.
|
60
78
|
#
|
61
79
|
# @return [String] escape char sequence for inline images
|
62
80
|
#
|
@@ -65,8 +83,8 @@ module Lolcommits
|
|
65
83
|
end
|
66
84
|
|
67
85
|
##
|
68
|
-
# Determine if the terminal is running a Tmux session (checks for
|
69
|
-
# env var to be set).
|
86
|
+
# Determine if the terminal is running a Tmux session (checks for
|
87
|
+
# the TMUX env var to be set).
|
70
88
|
#
|
71
89
|
# @return [Boolan] true when running within a Tmux session
|
72
90
|
#
|
@@ -9,25 +9,17 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ["matt@hiddenloop.com"]
|
10
10
|
spec.summary = "Display lolcommits within your iTerm terminal"
|
11
11
|
spec.homepage = "https://github.com/lolcommits/lolcommits-term_output"
|
12
|
-
spec.license = "LGPL-3"
|
12
|
+
spec.license = "LGPL-3.0"
|
13
13
|
spec.description = "Display lolcommits within your iTerm terminal"
|
14
14
|
|
15
15
|
spec.metadata = {
|
16
|
-
"homepage_uri"
|
17
|
-
"changelog_uri"
|
18
|
-
"source_code_uri"
|
19
|
-
"bug_tracker_uri"
|
16
|
+
"homepage_uri" => "https://github.com/lolcommits/lolcommits-term_output",
|
17
|
+
"changelog_uri" => "https://github.com/lolcommits/lolcommits-term_output/blob/master/CHANGELOG.md",
|
18
|
+
"source_code_uri" => "https://github.com/lolcommits/lolcommits-term_output",
|
19
|
+
"bug_tracker_uri" => "https://github.com/lolcommits/lolcommits-term_output/issues",
|
20
|
+
"allowed_push_host" => "https://rubygems.org"
|
20
21
|
}
|
21
22
|
|
22
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
23
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
24
|
-
if spec.respond_to?(:metadata)
|
25
|
-
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
26
|
-
else
|
27
|
-
raise "RubyGems 2.0 or newer is required to protect against " \
|
28
|
-
"public gem pushes."
|
29
|
-
end
|
30
|
-
|
31
23
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(assets|test|features)/}) }
|
32
24
|
spec.test_files = `git ls-files -- {test,features}/*`.split("\n")
|
33
25
|
spec.bindir = "bin"
|
@@ -36,7 +28,8 @@ Gem::Specification.new do |spec|
|
|
36
28
|
|
37
29
|
spec.required_ruby_version = ">= 2.3"
|
38
30
|
|
39
|
-
spec.
|
31
|
+
spec.add_runtime_dependency "lolcommits", ">= 0.14.2"
|
32
|
+
|
40
33
|
spec.add_development_dependency "bundler"
|
41
34
|
spec.add_development_dependency "pry"
|
42
35
|
spec.add_development_dependency "rake"
|
@@ -24,7 +24,7 @@ describe Lolcommits::Plugin::TermOutput do
|
|
24
24
|
def runner
|
25
25
|
# a simple lolcommits runner with an empty configuration Hash
|
26
26
|
@runner ||= Lolcommits::Runner.new(
|
27
|
-
|
27
|
+
lolcommit_path: Tempfile.new('lolcommit.jpg')
|
28
28
|
)
|
29
29
|
end
|
30
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolcommits-term_output
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.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: 2019-
|
11
|
+
date: 2019-05-20 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.
|
20
|
-
type: :
|
19
|
+
version: 0.14.2
|
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.14.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ files:
|
|
122
122
|
- test/test_helper.rb
|
123
123
|
homepage: https://github.com/lolcommits/lolcommits-term_output
|
124
124
|
licenses:
|
125
|
-
- LGPL-3
|
125
|
+
- LGPL-3.0
|
126
126
|
metadata:
|
127
127
|
homepage_uri: https://github.com/lolcommits/lolcommits-term_output
|
128
128
|
changelog_uri: https://github.com/lolcommits/lolcommits-term_output/blob/master/CHANGELOG.md
|