lolcommits 0.17.2 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +309 -9
  3. data/README.md +14 -26
  4. data/bin/lolcommits +2 -12
  5. data/lib/core_ext/mercurial-ruby/changed_file.rb +1 -3
  6. data/lib/core_ext/mercurial-ruby/command.rb +2 -4
  7. data/lib/core_ext/mercurial-ruby/config_file.rb +0 -2
  8. data/lib/core_ext/mercurial-ruby/repository.rb +0 -2
  9. data/lib/core_ext/mercurial-ruby/shell.rb +1 -3
  10. data/lib/lolcommits/animated_gif.rb +12 -7
  11. data/lib/lolcommits/backends/git_info.rb +6 -8
  12. data/lib/lolcommits/backends/installation_git.rb +8 -10
  13. data/lib/lolcommits/backends/installation_mercurial.rb +8 -10
  14. data/lib/lolcommits/backends/mercurial_info.rb +9 -11
  15. data/lib/lolcommits/capturer/capture_cygwin.rb +0 -2
  16. data/lib/lolcommits/capturer/capture_fake.rb +2 -4
  17. data/lib/lolcommits/capturer/capture_linux.rb +4 -6
  18. data/lib/lolcommits/capturer/capture_linux_video.rb +1 -3
  19. data/lib/lolcommits/capturer/capture_mac.rb +2 -4
  20. data/lib/lolcommits/capturer/capture_mac_video.rb +1 -3
  21. data/lib/lolcommits/capturer/capture_windows.rb +2 -4
  22. data/lib/lolcommits/capturer/capture_windows_video.rb +5 -7
  23. data/lib/lolcommits/capturer.rb +9 -12
  24. data/lib/lolcommits/cli/fatals.rb +11 -16
  25. data/lib/lolcommits/cli/launcher.rb +1 -3
  26. data/lib/lolcommits/cli/process_runner.rb +2 -4
  27. data/lib/lolcommits/cli/timelapse_gif.rb +11 -11
  28. data/lib/lolcommits/cli.rb +6 -6
  29. data/lib/lolcommits/configuration.rb +32 -36
  30. data/lib/lolcommits/gem_plugin.rb +5 -7
  31. data/lib/lolcommits/installation.rb +5 -7
  32. data/lib/lolcommits/platform.rb +14 -18
  33. data/lib/lolcommits/plugin/base.rb +4 -8
  34. data/lib/lolcommits/plugin/configuration_helper.rb +4 -6
  35. data/lib/lolcommits/plugin_manager.rb +1 -3
  36. data/lib/lolcommits/runner.rb +21 -24
  37. data/lib/lolcommits/test_helpers/fake_io.rb +0 -2
  38. data/lib/lolcommits/test_helpers/git_repo.rb +3 -5
  39. data/lib/lolcommits/vcs_info.rb +2 -4
  40. data/lib/lolcommits/version.rb +1 -3
  41. data/lib/lolcommits.rb +26 -30
  42. metadata +42 -83
  43. data/.gitattributes +0 -1
  44. data/.github/workflows/build.yml +0 -64
  45. data/.github/workflows/push_gem.yml +0 -25
  46. data/.gitignore +0 -15
  47. data/.rubocop_todo.yml +0 -97
  48. data/.travis.yml +0 -45
  49. data/CHANGELOG.md +0 -637
  50. data/CODE_OF_CONDUCT.md +0 -73
  51. data/CONTRIBUTING.md +0 -44
  52. data/Gemfile +0 -4
  53. data/PULL_REQUEST_TEMPLATE.md +0 -16
  54. data/Rakefile +0 -53
  55. data/bin/console +0 -12
  56. data/features/bugs.feature +0 -52
  57. data/features/lolcommits.feature +0 -376
  58. data/features/step_definitions/lolcommits_steps.rb +0 -238
  59. data/features/support/env.rb +0 -56
  60. data/features/support/path_helpers.rb +0 -38
  61. data/lolcommits.gemspec +0 -62
  62. data/test/assets/test_image.jpg +0 -0
  63. data/test/assets/test_video.mp4 +0 -0
  64. data/test/images/test_image.jpg +0 -0
  65. data/test/permissions_test.rb +0 -19
  66. data/test/test_helper.rb +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '088cc7f1206089c7bd38c2fcddfb70b66564cf7ad9aec31d431515107ab8443f'
4
- data.tar.gz: fa276c54847eef35ad780762328f15748509bb741b04c5d96b6ebd2b2bea4e1c
3
+ metadata.gz: 3d68fc910621c20affe1a01a975da0c2b4165dec81689a69c347aab0121fc510
4
+ data.tar.gz: e32e2f3a25b64abac860446672eae4ec5a1b1c6af1fb14933d6f2965ab692e22
5
5
  SHA512:
6
- metadata.gz: f5e2796f8a1493519602e6027f39e6b6aa644a1dece4e5141de16a6a2d1bd81c677ba2079a4ccf335da0d60b37fa7a79e040cc6887f0c3bde46ce38df9fab7b4
7
- data.tar.gz: a17dcd832fcb303dac024e6d5b4a18782c3d58e073a9ae064c69785d2fd428c2b87756d865bcfd2d38fe0d69e2ad32aba62eb23026c0d13ec430c39461a26d23
6
+ metadata.gz: c35563bc2fa8ba6762f8e2c42fd41164968b1b121e0729be258834a009ca687199feb708c65044bc7ccb8a6b0d982086a1b948e7fb6099562573331b4246bf55
7
+ data.tar.gz: 374d4265eca8f0a3af139cdfde448e820c52379ce4600a1b9dc4c3be859916c224582153f8f6731400a3c2b01bf8517738356522d3a0e2083d74e045c66c46a5
data/.rubocop.yml CHANGED
@@ -1,20 +1,320 @@
1
+ require:
2
+ - rubocop-performance
3
+
1
4
  AllCops:
2
- SuggestExtensions: false
3
5
  NewCops: enable
4
6
  Exclude:
5
- - 'vendor/bundle/**/*'
6
- - 'vendor/bundle/**/.*'
7
- - '.bundle/**/*'
8
- - 'bin/lolcommits'
9
- - 'lolcommits.gemspec'
7
+ - 'vendor/**/*'
8
+ - 'tmp/**/*'
9
+ TargetRubyVersion: 3.1
10
+ SuggestExtensions: false
11
+
12
+ Naming/InclusiveLanguage:
13
+ Enabled: true
14
+ CheckStrings: true
15
+ FlaggedTerms:
16
+ ' a offense':
17
+ Suggestions:
18
+ - an offense
19
+ auto-correct:
20
+ Suggestions:
21
+ - autocorrect
22
+ auto_correct:
23
+ Suggestions:
24
+ - autocorrect
25
+ behaviour:
26
+ Suggestions:
27
+ - behavior
28
+ offence:
29
+ Suggestions:
30
+ - offense
31
+
32
+ Naming/PredicateName:
33
+ # Method define macros for dynamically generated method.
34
+ MethodDefinitionMacros:
35
+ - define_method
36
+ - define_singleton_method
37
+ - def_node_matcher
38
+ - def_node_search
39
+
40
+ Layout/HashAlignment:
41
+ EnforcedHashRocketStyle:
42
+ - key
43
+ - table
44
+ EnforcedColonStyle:
45
+ - key
46
+ - table
47
+
48
+ Layout/EndOfLine:
49
+ EnforcedStyle: lf
50
+
51
+ Layout/ClassStructure:
52
+ Enabled: true
53
+ Categories:
54
+ module_inclusion:
55
+ - include
56
+ - prepend
57
+ - extend
58
+ ExpectedOrder:
59
+ - module_inclusion
60
+ - constants
61
+ - public_class_methods
62
+ - initializer
63
+ - instance_methods
64
+ - protected_methods
65
+ - private_methods
66
+
67
+ Layout/RedundantLineBreak:
68
+ Enabled: true
69
+
70
+ Lint/UselessAccessModifier:
71
+ MethodCreatingMethods:
72
+ - 'def_matcher'
73
+ - 'def_node_matcher'
10
74
 
11
- Style/IfUnlessModifier:
75
+ Metrics/BlockLength:
76
+ Exclude:
77
+ - 'Rakefile'
78
+ - '**/*.rake'
79
+ - '*.gemspec'
80
+
81
+ Performance/DeletePrefix:
82
+ SafeMultiline: false
83
+
84
+ Performance/DeleteSuffix:
85
+ SafeMultiline: false
86
+
87
+ inherit_mode:
88
+ merge:
89
+ - Exclude
90
+
91
+ # All cops except your using extensions are disabled by default.
92
+ Bundler:
93
+ Enabled: false
94
+ Layout:
95
+ Enabled: false
96
+ Lint:
97
+ Enabled: false
98
+ Metrics:
99
+ Enabled: false
100
+ Naming:
101
+ Enabled: false
102
+ Performance:
103
+ Enabled: false
104
+ Exclude:
105
+ - "test/**/*"
106
+ Security:
107
+ Enabled: false
108
+ Style:
12
109
  Enabled: false
13
110
 
14
- Style/StringLiterals:
111
+ # Align `when` with `end`.
112
+ Layout/CaseIndentation:
113
+ Enabled: true
114
+ EnforcedStyle: end
115
+
116
+ # Align comments with method definitions.
117
+ Layout/CommentIndentation:
118
+ Enabled: true
119
+
120
+ Layout/ElseAlignment:
121
+ Enabled: true
122
+
123
+ Layout/EmptyLineAfterMagicComment:
124
+ Enabled: true
125
+
126
+ Layout/EmptyLinesAroundBlockBody:
127
+ Enabled: true
128
+
129
+ # In a regular class definition, no empty lines around the body.
130
+ Layout/EmptyLinesAroundClassBody:
131
+ Enabled: true
132
+
133
+ # In a regular method definition, no empty lines around the body.
134
+ Layout/EmptyLinesAroundMethodBody:
135
+ Enabled: true
136
+
137
+ # In a regular module definition, no empty lines around the body.
138
+ Layout/EmptyLinesAroundModuleBody:
139
+ Enabled: true
140
+
141
+ # Align `end` with the matching keyword or starting expression except for
142
+ # assignments, where it should be aligned with the LHS.
143
+ Layout/EndAlignment:
144
+ Enabled: true
145
+ EnforcedStyleAlignWith: variable
146
+
147
+ # Method definitions after `private` or `protected` isolated calls need one
148
+ # extra level of indentation.
149
+ #
150
+ # We break this rule in context, though, e.g. for private-only concerns,
151
+ # so we leave it disabled.
152
+ Layout/IndentationConsistency:
15
153
  Enabled: false
154
+ EnforcedStyle: indented_internal_methods
155
+
156
+ # Detect hard tabs, no hard tabs.
157
+ Layout/IndentationStyle:
158
+ Enabled: true
159
+
160
+ # Two spaces, no tabs (for indentation).
161
+ #
162
+ # Doesn't behave properly with private-only concerns, so it's disabled.
163
+ Layout/IndentationWidth:
164
+ Enabled: false
165
+
166
+ Layout/LeadingCommentSpace:
167
+ Enabled: true
16
168
 
169
+ Layout/SpaceAfterColon:
170
+ Enabled: true
171
+
172
+ Layout/SpaceAfterComma:
173
+ Enabled: true
174
+
175
+ Layout/SpaceAroundEqualsInParameterDefault:
176
+ Enabled: true
177
+
178
+ Layout/SpaceAroundKeyword:
179
+ Enabled: true
180
+
181
+ # Use `foo {}` not `foo{}`.
182
+ Layout/SpaceBeforeBlockBraces:
183
+ Enabled: true
184
+
185
+ Layout/SpaceBeforeComma:
186
+ Enabled: true
187
+
188
+ Layout/SpaceBeforeFirstArg:
189
+ Enabled: true
190
+
191
+ # Use `->(x, y) { x + y }` not `-> (x, y) { x + y }`
192
+ Layout/SpaceInLambdaLiteral:
193
+ Enabled: true
194
+
195
+ # Use `[ a, [ b, c ] ]` not `[a, [b, c]]`
196
+ # Use `[]` not `[ ]`
197
+ Layout/SpaceInsideArrayLiteralBrackets:
198
+ Enabled: true
199
+ EnforcedStyle: space
200
+ EnforcedStyleForEmptyBrackets: no_space
201
+
202
+ # Use `%w[ a b ]` not `%w[ a b ]`.
203
+ Layout/SpaceInsideArrayPercentLiteral:
204
+ Enabled: true
205
+
206
+ # Use `foo { bar }` not `foo {bar}`.
207
+ # Use `foo { }` not `foo {}`.
208
+ Layout/SpaceInsideBlockBraces:
209
+ Enabled: true
210
+ EnforcedStyleForEmptyBraces: space
211
+
212
+ # Use `{ a: 1 }` not `{a:1}`.
213
+ # Use `{}` not `{ }`.
214
+ Layout/SpaceInsideHashLiteralBraces:
215
+ Enabled: true
216
+ EnforcedStyle: space
217
+ EnforcedStyleForEmptyBraces: no_space
218
+
219
+ # Use `foo(bar)` not `foo( bar )`
220
+ Layout/SpaceInsideParens:
221
+ Enabled: true
222
+
223
+ # Requiring a space is not yet supported as of 0.59.2
224
+ # Use `%w[ foo ]` not `%w[foo]`
17
225
  Layout/SpaceInsidePercentLiteralDelimiters:
18
226
  Enabled: false
227
+ #EnforcedStyle: space
228
+
229
+ # Use `hash[:key]` not `hash[ :key ]`
230
+ Layout/SpaceInsideReferenceBrackets:
231
+ Enabled: true
232
+
233
+ # Blank lines should not have any spaces.
234
+ Layout/TrailingEmptyLines:
235
+ Enabled: true
236
+
237
+ # No trailing whitespace.
238
+ Layout/TrailingWhitespace:
239
+ Enabled: true
240
+
241
+ Lint/RedundantStringCoercion:
242
+ Enabled: true
243
+
244
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
245
+ Lint/RequireParentheses:
246
+ Enabled: true
247
+
248
+ Lint/UriEscapeUnescape:
249
+ Enabled: true
250
+
251
+ Performance/FlatMap:
252
+ Enabled: true
253
+
254
+ # We generally prefer &&/|| but like low-precedence and/or in context
255
+ Style/AndOr:
256
+ Enabled: false
257
+
258
+ # Prefer Foo.method over Foo::method
259
+ Style/ColonMethodCall:
260
+ Enabled: true
261
+
262
+ Style/DefWithParentheses:
263
+ Enabled: true
264
+
265
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
266
+ Style/HashSyntax:
267
+ Enabled: true
268
+ EnforcedShorthandSyntax: either
269
+
270
+ # Defining a method with parameters needs parentheses.
271
+ Style/MethodDefParentheses:
272
+ Enabled: true
273
+
274
+ Style/ParenthesesAroundCondition:
275
+ Enabled: true
276
+
277
+ Style/PercentLiteralDelimiters:
278
+ Enabled: true
279
+ PreferredDelimiters:
280
+ default: "()"
281
+ "%i": "[]"
282
+ "%I": "[]"
283
+ "%r": "{}"
284
+ "%w": "[]"
285
+ "%W": "[]"
286
+
287
+ # Use quotes for string literals when they are enough.
288
+ Style/RedundantPercentQ:
289
+ Enabled: false
290
+
291
+ Style/RedundantReturn:
292
+ Enabled: true
293
+ AllowMultipleReturnValues: true
294
+
295
+ Style/Semicolon:
296
+ Enabled: true
297
+ AllowAsExpressionSeparator: true
298
+
299
+ Style/StabbyLambdaParentheses:
300
+ Enabled: true
301
+
302
+ # Use `"foo"` not `'foo'` unless escaping is required
303
+ Style/StringLiterals:
304
+ Enabled: true
305
+ EnforcedStyle: double_quotes
306
+ Include:
307
+ - "app/**/*"
308
+ - "config/**/*"
309
+ - "lib/**/*"
310
+ - "test/**/*"
311
+ - "Gemfile"
312
+
313
+ Style/TrailingCommaInArrayLiteral:
314
+ Enabled: true
315
+
316
+ Style/TrailingCommaInHashLiteral:
317
+ Enabled: true
19
318
 
20
- inherit_from: .rubocop_todo.yml
319
+ Gemspec/DevelopmentDependencies:
320
+ EnforcedStyle: gemspec
data/README.md CHANGED
@@ -1,28 +1,28 @@
1
1
  # lolcommits
2
2
 
3
- [![Build](https://img.shields.io/github/actions/workflow/status/lolcommits/lolcommits/build.yml?branch=main&style=flat)](https://github.com/lolcommits/lolcommits/actions/workflows/build.yml)
3
+ [![CI](https://img.shields.io/github/actions/workflow/status/lolcommits/lolcommits/ci.yml?branch=main&style=flat&label=CI)](https://github.com/lolcommits/lolcommits/actions/workflows/ci.yml)
4
4
  [![Depfu](https://img.shields.io/depfu/lolcommits/lolcommits.svg?style=flat)](https://depfu.com/github/lolcommits/lolcommits)
5
5
  [![Gem](https://img.shields.io/gem/v/lolcommits.svg?style=flat)](http://rubygems.org/gems/lolcommits)
6
6
 
7
7
  > git-based selfies for software developers
8
8
 
9
- lolcommits takes a snapshot with your webcam every time you git commit
10
- code, and archives a lolcat style image with it. Git blame has never
11
- been so much fun.
9
+ lolcommits takes a snapshot with your webcam every time you git commit,
10
+ archiving a "[LOLcat](https://en.wikipedia.org/wiki/Lolcat)" style image. Git
11
+ blame has never been so much fun!
12
12
 
13
- By default, the lol images are stored by a Github style short SHA in a
14
- `~/.lolcommits` directory created for you.
13
+ By default these lol images are stored with a short SHA filename in a
14
+ `~/.lolcommits` directory created just for you.
15
15
 
16
16
  ## History
17
17
 
18
- Originally created by [@mroth] in 2011 as a joke project for [Hack &&
19
- Tell], lolcommits has grown considerably since then, and is now
20
- primarily maintained by [@matthutchinson].
18
+ Originally created by [@mroth] in 2011 (as a joke project for [Hack && Tell]),
19
+ lolcommits has grown considerably, has a plugin ecosystem and is now maintained
20
+ by [@matthutchinson].
21
21
 
22
- Thank you to all of the [contributors] throughout the years!
22
+ Thanks to all the [contributors] and users throughout the years!
23
23
 
24
- [@mroth]: https://github.com/mroth
25
24
  [@matthutchinson]: https://github.com/matthutchinson
25
+ [@mroth]: https://github.com/mroth
26
26
  [Hack && Tell]: https://hackandtell.org
27
27
  [contributors]: https://github.com/lolcommits/lolcommits/graphs/contributors
28
28
 
@@ -32,7 +32,7 @@ Thank you to all of the [contributors] throughout the years!
32
32
 
33
33
  Please add your own lolcommit to the [People Using
34
34
  Lolcommits](https://github.com/lolcommits/lolcommits/wiki/Lolcommits-from-around-the-world%21)
35
- page on our wiki!
35
+ page!
36
36
 
37
37
 
38
38
  ## Requirements
@@ -54,21 +54,11 @@ You'll need ImageMagick installed.
54
54
 
55
55
  Then install with:
56
56
 
57
- [sudo] gem install lolcommits
58
-
59
- If you're using RVM (or rbenv), you can/should probably omit the sudo,
60
- but the default macOS Ruby install usually requires it.
61
-
62
- Lolcommits v0.8.1 was the last release to support Ruby < 2.0. If you'd
63
- like to use older Rubies try:
64
-
65
- [sudo] gem install lolcommits --version 0.8.1 # for Ruby 1.9
66
- [sudo] gem install lolcommits --version 0.7.0 # for Ruby 1.8
67
-
57
+ gem install lolcommits
68
58
 
69
59
  ### Linux
70
60
 
71
- Install these dependencies using your package manager of choice, for
61
+ Install dependencies using your package manager of choice, for
72
62
  example in Ubuntu:
73
63
 
74
64
  sudo apt-get install mplayer imagemagick libmagickwand-dev
@@ -84,7 +74,6 @@ Then install with:
84
74
  For more details, see [Installing on
85
75
  Linux](https://github.com/lolcommits/lolcommits/wiki/Installing-on-Linux).
86
76
 
87
-
88
77
  ### Windows - here be dragons!
89
78
 
90
79
  It works, but you'll need some more detailed instructions to get the
@@ -94,7 +83,6 @@ Windows](https://github.com/lolcommits/lolcommits/wiki/Installing-on-Windows).
94
83
 
95
84
  ## Usage
96
85
 
97
-
98
86
  ### Enabling and basic usage
99
87
 
100
88
  Within any git repository, simply run `lolcommits --enable`. From that
data/bin/lolcommits CHANGED
@@ -1,22 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- begin
4
- require 'lolcommits'
5
- rescue LoadError
6
- require 'rubygems'
7
- require 'lolcommits'
8
- end
9
-
10
- require 'optparse'
11
- require 'optparse_plus'
12
- require 'lolcommits/cli.rb'
3
+ require 'lolcommits'
13
4
 
14
5
  # allow logging from everywhere
15
6
  include OptparsePlus::CLILogging
16
7
 
17
8
  class App
18
9
  include OptparsePlus::Main
19
-
20
10
  include Lolcommits
21
11
  include Lolcommits::CLI
22
12
 
@@ -37,7 +27,7 @@ class App
37
27
  end
38
28
 
39
29
  plugin_manager = PluginManager.init
40
- config = Configuration.new(plugin_manager, test_mode: options[:test])
30
+ config = Configuration.new(plugin_manager, test_mode: options[:test])
41
31
 
42
32
  if options[:version]
43
33
  puts Lolcommits::VERSION
@@ -1,12 +1,10 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Mercurial
4
2
  class ChangedFile
5
3
  private
6
4
 
7
5
  def enforce_unicode(str)
8
6
  # String#encode patched to be Ruby 3.0+ compatible
9
- str.encode('utf-8', invalid: :replace, undef: :replace, replace: '?')
7
+ str.encode("utf-8", invalid: :replace, undef: :replace, replace: "?")
10
8
  end
11
9
  end
12
10
  end
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  if Lolcommits::Platform.platform_windows?
4
2
  module Mercurial
5
3
  class Command
@@ -9,8 +7,8 @@ if Lolcommits::Platform.platform_windows?
9
7
  def execution_proc
10
8
  proc do
11
9
  debug(command)
12
- result = ''
13
- error = ''
10
+ result = ""
11
+ error = ""
14
12
  status = nil
15
13
  Open3.popen3(command) do |_stdin, stdout, stderr, wait_thread|
16
14
  Timeout.timeout(timeout) do
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Mercurial
4
2
  class ConfigFile
5
3
  def exists?
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Mercurial
4
2
  class Repository
5
3
  def self.open(destination)
@@ -1,11 +1,9 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Mercurial
4
2
  class Shell
5
3
  # windows command line doesn't like single quotes
6
4
  def self.interpolate_arguments(cmd_with_args)
7
5
  cmd_with_args.shift.tap do |cmd|
8
- cmd.gsub!('?') do
6
+ cmd.gsub!("?") do
9
7
  if Lolcommits::Platform.platform_windows?
10
8
  "\"#{cmd_with_args.shift}\""
11
9
  else
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Lolcommits
4
2
  class AnimatedGif
5
3
  def create(video_path:, output_path:)
@@ -20,12 +18,19 @@ module Lolcommits
20
18
  # create the looping animated gif from frames (delete frame files except every #{skip} frame)
21
19
  Dir["#{frames_dir}/*.png"].each do |frame_filename|
22
20
  basename = File.basename(frame_filename)
23
- frame_number = basename.split('.').first.to_i
21
+ frame_number = basename.split(".").first.to_i
24
22
  File.delete(frame_filename) if frame_number % skip != 0
25
23
  end
26
24
 
27
- # convert to animated gif with delay and gif optimisation
28
- system_call "convert -layers OptimizeTransparency -delay #{delay} -loop 0 \"#{frames_dir}/*.png\" -coalesce \"#{output_path}\""
25
+ # convert to animated gif with delay and transparency optimising
26
+ MiniMagick.convert do |convert|
27
+ convert << "#{frames_dir}/*.png"
28
+ convert.layers "OptimizeTransparency"
29
+ convert.delay delay
30
+ convert.loop 0
31
+ convert.coalesce
32
+ convert << output_path
33
+ end
29
34
 
30
35
  # remove tmp frames dir
31
36
  FileUtils.rm_rf(frames_dir)
@@ -38,13 +43,13 @@ module Lolcommits
38
43
  end
39
44
 
40
45
  def null_string
41
- Lolcommits::Platform.platform_windows? ? 'nul' : '/dev/null'
46
+ Lolcommits::Platform.platform_windows? ? "nul" : "/dev/null"
42
47
  end
43
48
 
44
49
  def frame_delay(fps, skip)
45
50
  # calculate frame delay
46
51
  delay = ((100.0 * skip) / fps.to_f).to_i
47
- [delay, 6].max # hard limit for IE browsers
52
+ [ delay, 6 ].max # hard limit for IE browsers
48
53
  end
49
54
 
50
55
  def video_fps(file)
@@ -1,19 +1,17 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Lolcommits
4
2
  class GitInfo
5
3
  GIT_URL_REGEX = %r{.*:([/\w-]*).git}
6
4
 
7
- def self.repo_root?(path = '.')
8
- File.directory?(File.join(path, '.git'))
5
+ def self.repo_root?(path = ".")
6
+ File.directory?(File.join(path, ".git"))
9
7
  end
10
8
 
11
- def self.local_name(path = '.')
9
+ def self.local_name(path = ".")
12
10
  File.basename(Git.open(path).dir.to_s)
13
11
  end
14
12
 
15
13
  def initialize
16
- debug 'parsed the following values from commit:'
14
+ debug "parsed the following values from commit:"
17
15
  debug "\t#{message}"
18
16
  debug "\t#{sha}"
19
17
  debug "\t#{repo_internal_path}"
@@ -30,7 +28,7 @@ module Lolcommits
30
28
 
31
29
  def message
32
30
  @message ||= begin
33
- message = last_commit.message || ''
31
+ message = last_commit.message || ""
34
32
  message.split("\n").first
35
33
  end
36
34
  end
@@ -81,7 +79,7 @@ module Lolcommits
81
79
  "#{url.tr(':', '/').gsub(/^git@/, 'https://').gsub(/\.git$/, '')}/commit/"
82
80
  end
83
81
 
84
- def repository(path = '.')
82
+ def repository(path = ".")
85
83
  @repository ||= Git.open(path)
86
84
  end
87
85
 
@@ -1,17 +1,15 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Lolcommits
4
2
  #
5
3
  # Methods to handle enabling and disabling of lolcommits
6
4
  #
7
5
  class InstallationGit
8
- HOOK_PATH = File.join '.git', 'hooks', 'post-commit'
9
- HOOK_DIR = File.join '.git', 'hooks'
6
+ HOOK_PATH = File.join ".git", "hooks", "post-commit"
7
+ HOOK_DIR = File.join ".git", "hooks"
10
8
 
11
9
  #
12
10
  # IF --ENABLE, DO ENABLE
13
11
  #
14
- def self.do_enable(capture_args = '')
12
+ def self.do_enable(capture_args = "")
15
13
  # its possible a hooks dir doesnt exist, so create it if so
16
14
  Dir.mkdir(HOOK_DIR) unless File.directory?(HOOK_DIR)
17
15
 
@@ -33,7 +31,7 @@ module Lolcommits
33
31
  add_shebang = true
34
32
  end
35
33
 
36
- File.open(HOOK_PATH, add_shebang ? 'w' : 'a') do |f|
34
+ File.open(HOOK_PATH, add_shebang ? "w" : "a") do |f|
37
35
  f.write("#!/bin/sh\n") if add_shebang
38
36
  f.write(hook_script(capture_args))
39
37
  end
@@ -59,9 +57,9 @@ module Lolcommits
59
57
  end
60
58
  end
61
59
 
62
- def self.hook_script(capture_args = '')
63
- ruby_path = Lolcommits::Platform.command_which('ruby', only_path: true)
64
- imagick_path = Lolcommits::Platform.command_which('identify', only_path: true)
60
+ def self.hook_script(capture_args = "")
61
+ ruby_path = Lolcommits::Platform.command_which("ruby", only_path: true)
62
+ imagick_path = Lolcommits::Platform.command_which("identify", only_path: true)
65
63
  capture_cmd = "if [ ! -d \"$GIT_DIR/rebase-merge\" ] && [ \"$LOLCOMMITS_CAPTURE_DISABLED\" != \"true\" ]; then lolcommits --capture #{capture_args}; fi"
66
64
  exports = "GIT_DIR=${GIT_DIR-`git rev-parse --git-dir`} && LANG=\"#{ENV.fetch('LANG', nil)}\" && PATH=\"$PATH:#{ruby_path}:#{imagick_path}\""
67
65
 
@@ -95,7 +93,7 @@ module Lolcommits
95
93
 
96
94
  def self.remove_existing_hook!
97
95
  hook = File.read(HOOK_PATH)
98
- out = File.open(HOOK_PATH, 'w')
96
+ out = File.open(HOOK_PATH, "w")
99
97
  skip = false
100
98
 
101
99
  hook.lines.each do |line|