Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e30ef4

Browse files
bump gems, indent private, update README, adjust CI actions
1 parent 693cac4 commit 6e30ef4

23 files changed

Lines changed: 409 additions & 397 deletions

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
ruby-version: 3.4
2323
bundler-cache: true
2424
- name: Run rubocop
25-
run: bundle exec rubocop --parallel
25+
run: bin/rubocop --parallel
2626
tests:
2727
name: Unit tests
2828
runs-on: ubuntu-latest
@@ -34,7 +34,7 @@ jobs:
3434
ruby-version: 3.4
3535
bundler-cache: true
3636
- name: Run tests
37-
run: bundle exec rake test
37+
run: rake test
3838
features:
3939
name: ${{ format('Features (Ruby {0})', matrix.ruby-version) }}
4040
runs-on: ubuntu-latest

README.md

Lines changed: 101 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,17 @@
66

77
> git-based selfies for software developers
88
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-
13-
By default these lol images are stored with a short SHA filename in a
14-
`~/.lolcommits` directory created just for you.
15-
16-
## History
17-
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-
22-
Thanks to all the [contributors] and users throughout the years!
23-
24-
[@matthutchinson]: https://github.com/matthutchinson
25-
[@mroth]: https://github.com/mroth
26-
[Hack && Tell]: https://hackandtell.org
27-
[contributors]: https://github.com/lolcommits/lolcommits/graphs/contributors
9+
[lolcommits](https://lolcommits.github.io/) takes a snapshot with your webcam
10+
every time you git commit, archiving a
11+
"[LOLcat](https://en.wikipedia.org/wiki/Lolcat)" style image. Git blame has
12+
never been so much fun!
2813

2914
## Sample images
3015

31-
<img src="https://lolcommits.github.io/assets/img/gallery.jpeg" />
16+
<img src="https://lolcommits.github.io/assets/img/gallery.jpeg" alt="Gallery
17+
grid of captured lolcommit images" />
3218

33-
Please add your own lolcommit to the [People Using
19+
Feel free to add your own lolcommit to the [People Using
3420
Lolcommits](https://github.com/lolcommits/lolcommits/wiki/Lolcommits-from-around-the-world%21)
3521
page!
3622

@@ -47,24 +33,27 @@ page!
4733

4834
### macOS
4935

50-
You'll need ImageMagick installed.
51-
[Homebrew](https://brew.sh) makes this easy.
36+
You'll need ImageMagick installed. [Homebrew](https://brew.sh) makes this easy.
5237

5338
brew install imagemagick
5439

5540
Then install with:
5641

5742
gem install lolcommits
5843

44+
Optionally add ffmpeg if you plan on capturing animated gifs or videos.
45+
46+
brew install ffmpeg
47+
5948
### Linux
6049

61-
Install dependencies using your package manager of choice, for
62-
example in Ubuntu:
50+
Install dependencies using your package manager of choice. For example in
51+
Ubuntu:
6352

6453
sudo apt-get install mplayer imagemagick libmagickwand-dev
6554

66-
For Ubuntu 14.04 or newer, you need to manually install ffmpeg since it
67-
no longer ships with the default Ubuntu sources ([downloads
55+
For Ubuntu 14.04 or newer, you'll need to manually install ffmpeg, as it no
56+
longer ships with the base image ([download
6857
here](http://ffmpeg.org/download.html)).
6958

7059
Then install with:
@@ -76,27 +65,30 @@ Linux](https://github.com/lolcommits/lolcommits/wiki/Installing-on-Linux).
7665

7766
### Windows - here be dragons!
7867

79-
It works, but you'll need some more detailed instructions to get the
80-
dependencies installed. See the wiki page for [Installing on
68+
It works, but you'll need to follow some extra instructions to get dependencies
69+
installed. See [Installing on
8170
Windows](https://github.com/lolcommits/lolcommits/wiki/Installing-on-Windows).
8271

8372

8473
## Usage
8574

8675
### Enabling and basic usage
8776

88-
Within any git repository, simply run `lolcommits --enable`. From that
89-
point on, any git commit will automatically trigger a lolcommit capture!
90-
By default, all lolcommits are stored in `~/.lolcommits` and placed in a
91-
subdirectory by project name, with a filename matching the commit hash.
77+
Within any git repository, simply run
78+
79+
lolcommits --enable
80+
81+
Now any git commit will automatically trigger a lolcommit capture! lolcommits
82+
are stored in `~/.lolcommits` with a short sha filename and organized into
83+
folders for each git repo.
9284

9385
Follow [these
9486
steps](https://github.com/lolcommits/lolcommits/wiki/Enabling-Lolcommits-for-all-your-Git-Repositories)
9587
to enable lolcommits across all your repos; using `git init` and the
9688
`init.templatedir` setting.
9789

9890
Don't worry about it too much, half the fun of lolcommits is forgetting
99-
it's installed!
91+
it's even installed!
10092

10193

10294
### Other commands
@@ -108,17 +100,17 @@ can guess what that does.
108100
Other handy common commands include `--last`, which will open for
109101
display your most recent lolcommit, or `--browse`, which pops open the
110102
directory containing all the lolcommit images for your current
111-
repository. You can always do `--help` for a full list of available
112-
commands.
103+
repository.
104+
105+
Use `--help` for a full list of available commands.
113106

114-
**NOTE**: Any extra arguments you pass with `--enable` are appended to
115-
the git post-hook capture command. For example;
107+
**TIP**: Any extra args you pass with `--enable` are auto-appended to
108+
the git hook capture command. For example;
116109

117-
lolcommits --enable --delay 5 --animate 4 --fork
110+
lolcommits --enable --delay 2 --animate 4 --fork
118111

119-
Will configure capturing of an animated gif (4 secs) after a 5 sec delay
120-
in a forked process. See the section below for more capture
121-
configuration options.
112+
Configures capturing of an animated gif (4 secs) after a 2 sec delay in a forked
113+
process.
122114

123115

124116
### Capture configuration options
@@ -142,7 +134,7 @@ these via environment variables like so;
142134
* `LOLCOMMITS_CAPTURE_DISABLED` disables lolcommit capturing in the
143135
commit hook (when set as 'true')
144136

145-
Or they can be set with arguments to the capture command (located in
137+
Or apply arguments directly on the git hook capture command (located in
146138
your repository's `.git/hooks/post-commit` file).
147139

148140
* `--device {name}` or `-d {name}`
@@ -152,20 +144,19 @@ your repository's `.git/hooks/post-commit` file).
152144
* `--fork`
153145
* `--stealth`
154146

155-
You can configure lolcommit text positions, font styles (type, size,
156-
color etc.) or add a transparent overlay to your images. Simply
157-
configure the default loltext plugin with this command:
147+
You can configure lolcommit text layout, font styles (type, size, color etc.) or
148+
add a transparent overlay to your images. Simply configure the default loltext
149+
plugin with this command:
158150

159151
lolcommits --config -p loltext
160152

161153
To find out more about styling, read about the [loltext
162154
options](https://github.com/lolcommits/lolcommits/wiki/Configure-Commit-Capturing#loltext-options).
163155

164-
Use `lolcommits --devices` to list all attached video devices available
165-
for capturing.
156+
Use `lolcommits --devices` to list all attached video devices available for
157+
capturing.
166158

167-
Finally, run `lolcommits --help` for details on all the available
168-
arguments.
159+
Finally, `lolcommits --help` has details on all available arguments.
169160

170161

171162
### Videos
@@ -174,9 +165,9 @@ You can tell lolcommits to capture an mp4 video (instead of an image).
174165
[ffmpeg](https://www.ffmpeg.org) is required and can be installed like
175166
so;
176167

168+
* macOS - `brew install ffmpeg`
177169
* Linux - [follow this
178170
guide](https://www.ffmpeg.org/download.html#build-linux)
179-
* macOS - `brew install ffmpeg`
180171
* Windows - [follow this
181172
guide](https://ffmpeg.org/download.html#build-windows)
182173

@@ -197,18 +188,20 @@ animated capturing takes too long, try setting `LOLCOMMITS_FORK=true`.
197188
gif](http://cdn2.usa.bugleblogs.com/blogs/000/000/003/de0eb9aa695.gif
198189
"Example animated lolcommit gif")
199190

200-
**NOTE**: If both `LOLCOMMITS_ANIMATE` and `LOLCOMMITS_VIDEO` options are set, the
201-
video duration takes precedence and is applied to both captures.
191+
**NOTE**: If both `LOLCOMMITS_ANIMATE` and `LOLCOMMITS_VIDEO` options are set,
192+
the video duration takes precedence and is applied to both captures.
202193

203194

204195
### Plugins
205196

206-
A growing number of plugins are available, allowing you to transform or
207-
share your lolcommits with others. The default plugin simply appends
208-
your commit message and sha to the captured image. Others can post to
209-
Twitter, Tumblr (and other services), or even translate your commit
210-
messages to
197+
A growing number of plugins are available, allowing you to transform or share
198+
your lolcommits with others.
199+
200+
The default `loltxt` plugin simply appends your commit message and sha to the
201+
captured image. Others can post to Twitter, Tumblr or HTTP Post anywhere. You
202+
can even translate your commit messages to
211203
[lolspeak](http://www.urbandictionary.com/define.php?term=lolspeak).
204+
212205
Check them out on our [plugins
213206
page](https://github.com/lolcommits/lolcommits/wiki/Configuring-Plugins).
214207

@@ -223,30 +216,69 @@ Installed plugins can be easily enabled, configured or disabled with the
223216
# or
224217
lolcommits --config -p loltext
225218

226-
Interested in developing your own plugin? Follow [this simple
227-
guide](https://github.com/lolcommits/lolcommits-sample_plugin#developing-your-own-plugin)
228-
at the Lolcommits Sample Plugin README.
219+
Interested in developing your own? Follow [this plugin developers
220+
guide](https://github.com/lolcommits/lolcommits-sample_plugin#developing-your-own-plugin).
229221

230222

231223
## Timelapse
232224

233-
Watch your face decay while you program, with an animated timelapse gif!
225+
Watch your face rapidly decay while you program! Enjoy (or despair) with:
234226

235227
lolcommits --timelapse
236228
# or for just today's lolcommits
237229
lolcommits --timelapse --period today
238230

231+
## Development
232+
233+
Check out this repo and run `bundle install` to install dependencies.
234+
235+
### Tests
236+
237+
Cucumber is used for testing. Run the full suite with:
238+
239+
$ cucumber
240+
241+
Some MiniTest unit tests can also be ran with:
242+
243+
$ rake test
244+
245+
### Linting
246+
247+
[Rubocop](https://github.com/rubocop/rubocop) is used for linting, and a git
248+
[quickhook](https://github.com/dirk/quickhook) can be installed to check this on
249+
a pre-commit.
250+
251+
$ rubocop
252+
253+
$ quickhook install
254+
255+
### Docs
256+
257+
Generate docs for this gem with:
258+
259+
$ rake rdoc
260+
239261
## Troubles?
240262

241263
Try our trouble-shooting
242-
[FAQ](https://github.com/lolcommits/lolcommits/wiki/FAQ), or take a read
243-
through our [wiki](https://github.com/lolcommits/lolcommits/wiki). If
244-
you think something is broken or missing, please raise a [Github
245-
issue](https://github.com/lolcommits/lolcommits/issues) (and please
246-
check if we haven't [already
247-
addressed](https://github.com/lolcommits/lolcommits/issues?q=is%3Aissue+is%3Aclosed)
248-
it).
264+
[FAQ](https://github.com/lolcommits/lolcommits/wiki/FAQ), or take a read through
265+
our [wiki](https://github.com/lolcommits/lolcommits/wiki).
266+
267+
If you think something is broken or missing, please raise a [Github
268+
issue](https://github.com/lolcommits/lolcommits/issues).
249269

270+
## History
271+
272+
Originally created by [@mroth] in 2011 (as a joke project for [Hack && Tell]),
273+
lolcommits has grown considerably, has a plugin ecosystem and is now maintained
274+
by [@matthutchinson].
275+
276+
Thanks to all the [contributors] and users throughout the years!
277+
278+
[@matthutchinson]: https://github.com/matthutchinson
279+
[@mroth]: https://github.com/mroth
280+
[Hack && Tell]: https://hackandtell.org
281+
[contributors]: https://github.com/lolcommits/lolcommits/graphs/contributors
250282

251283
## License
252284

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
module Mercurial
22
class ChangedFile
33
private
4-
5-
def enforce_unicode(str)
6-
# String#encode patched to be Ruby 3.0+ compatible
7-
str.encode("utf-8", invalid: :replace, undef: :replace, replace: "?")
8-
end
4+
def enforce_unicode(str)
5+
# String#encode patched to be Ruby 3.0+ compatible
6+
str.encode("utf-8", invalid: :replace, undef: :replace, replace: "?")
7+
end
98
end
109
end

lib/core_ext/mercurial-ruby/command.rb

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,29 @@
22
module Mercurial
33
class Command
44
private
5-
6-
# need to use popen3 on windows - popen4 always eventually calls fork
7-
def execution_proc
8-
proc do
9-
debug(command)
10-
result = ""
11-
error = ""
12-
status = nil
13-
Open3.popen3(command) do |_stdin, stdout, stderr, wait_thread|
14-
Timeout.timeout(timeout) do
15-
while (tmp = stdout.read(102_400))
16-
result += tmp
5+
# need to use popen3 on windows - popen4 always eventually calls fork
6+
def execution_proc
7+
proc do
8+
debug(command)
9+
result = ""
10+
error = ""
11+
status = nil
12+
Open3.popen3(command) do |_stdin, stdout, stderr, wait_thread|
13+
Timeout.timeout(timeout) do
14+
while (tmp = stdout.read(102_400))
15+
result += tmp
16+
end
1717
end
18-
end
1918

20-
while (tmp = stderr.read(1024))
21-
error += tmp
19+
while (tmp = stderr.read(1024))
20+
error += tmp
21+
end
22+
status = wait_thread.value
2223
end
23-
status = wait_thread.value
24+
raise_error_if_needed(status, error)
25+
result
2426
end
25-
raise_error_if_needed(status, error)
26-
result
2727
end
28-
end
2928
end
3029
end
3130
end

0 commit comments

Comments
 (0)