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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2379fcb9aa1d9303fffe4b571cf638ce5707b7b937f7d5b64be6c08f4a7b128a
4
- data.tar.gz: 4d971d9e7ef33bc4a111f3c0b13794a71ad8fdb9590bed4c4719adacd811376b
3
+ metadata.gz: 3ae550e3afc8a28f05357eb39bc55721eee09ecac0712d39ea291d93105e6d44
4
+ data.tar.gz: ae046fb5b4e7fc06dd0473a24482ba7d9a0a3617e45c95977ea34dff5b1d55ee
5
5
  SHA512:
6
- metadata.gz: 25a1254cf0c9bb81cc701c631596fe80e33de7254c8c9d1d5622edfc7a5ac71b86ee1eb57952d3f5ba0423043da038ba64e0bbf014661a0138381ad41b67070e
7
- data.tar.gz: 1ba47cca44f55cca6ed659ff97d78b1a4d8645236d9a7aeba0b19e5d7530f63ae8b0accaa560f6443fb993519d62cb05b8a2aaac3bfc7ca9dd03c65a5d73ffb7
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 project
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.2.0...HEAD
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://travis-ci.org/lolcommits/lolcommits-term_output.svg?branch=master)](https://travis-ci.org/lolcommits/lolcommits-term_output)
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 webcam
10
- every time you git commit code, and archives a lolcat style image with it. Git
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 image](http://iterm2.com/documentation-images.html)
14
- feature available in [iTerm2](http://iterm2.com/index.html) to display each
15
- lolcommit image in your terminal (after committing). For example:
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. To
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 dependencies and
47
- generate docs. Use `bundle exec rake` to run all tests and generate a coverage
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 you to
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). Take
69
- a moment to check it hasn't been raised in the past (and possibly closed).
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 [reports](https://github.com/lolcommits/lolcommits-term_output/issues) and [pull
74
- requests](https://github.com/lolcommits/lolcommits-term_output/pulls) are welcome on
75
- GitHub.
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 behaviour,
78
- and ensure all tests are passing on [Travis
79
- CI](https://travis-ci.org/lolcommits/lolcommits-term_output). Read the
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 collaboration, and
85
- contributors are expected to adhere to the [Contributor
86
- Covenant](http://contributor-covenant.org) code of conduct. See
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.org/lolcommits/lolcommits-term_output)
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 the
27
- # terminal is supported (and we have commits) the lolcommit image is
28
- # rendered inline to the terminal output (with the commit message).
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
- base64 = Base64.encode64(open(runner.main_image, &:read).to_s)
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
- # Generate starting escape character sequence. Terminals running Tmux
49
- # sessions require a different escape code.
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 Tmux
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 the TMUX
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
  #
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lolcommits
4
4
  module TermOutput
5
- VERSION = "0.2.0".freeze
5
+ VERSION = "0.3.0".freeze
6
6
  end
7
7
  end
@@ -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" => "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",
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.add_development_dependency "lolcommits", ">= 0.12.0"
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
- main_image: Tempfile.new('main_image.jpg')
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.2.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-04-24 00:00:00.000000000 Z
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.12.0
20
- type: :development
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.12.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