lolcommits 0.4.4 → 0.4.5
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.
- data/CHANGELOG +5 -0
- data/README.md +3 -1
- data/bin/lolcommits +35 -19
- data/features/lolcommits.feature +10 -0
- data/features/step_definitions/lolcommits_steps.rb +7 -1
- data/lib/lolcommits.rb +0 -1
- data/lib/lolcommits/runner.rb +0 -1
- data/lib/lolcommits/version.rb +1 -1
- data/lolcommits.gemspec +0 -1
- metadata +4 -21
- data/lib/lolcommits/plugins/statsd.rb +0 -25
data/CHANGELOG
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
0.5.0 (in development)
|
2
2
|
* TODO: figure out problems with GUI clients
|
3
3
|
|
4
|
+
0.4.5 (8 July 2013)
|
5
|
+
* disable&remove statsd plugin (as per #94)
|
6
|
+
* fix issues with animated gif generation (#107)
|
7
|
+
* added new LOLCOMMITS_FORK (or --fork) option to fork the runner capturing (#109)
|
8
|
+
|
4
9
|
0.4.4 (28 June 2013)
|
5
10
|
* add -g option to produce animated gifs! (thx @hSATAC, #95)
|
6
11
|
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ By default, the lolimages are stored by a Github style short SHA in a `~/.lolcom
|
|
14
14
|
|
15
15
|
Please add your own lolcommit! Add to the [People Using Lolcommits](https://github.com/mroth/lolcommits/wiki/People-Using-Lolcommits) page on the Wiki.
|
16
16
|
|
17
|
-
## Installation
|
17
|
+
## Installation
|
18
18
|
### Mac OS X
|
19
19
|
You'll need ImageMagick installed. [Homebrew](http://mxcl.github.com/homebrew/) makes this easy. Simply do:
|
20
20
|
|
@@ -57,6 +57,8 @@ environment variables.
|
|
57
57
|
* Set delay persistently (for slow to warmup webcams) - set
|
58
58
|
`LOLCOMMITS_DELAY` var to time in seconds.
|
59
59
|
* Set font file location - set `LOLCOMMITS_FONT` environment variable.
|
60
|
+
* Fork lolcommits runner - set `LOLCOMMITS_FORK` environment variable
|
61
|
+
(causes capturing command to fork to a new process, speedily returning you to your terminal).
|
60
62
|
|
61
63
|
For the full list, see the [configuration variables](https://github.com/mroth/lolcommits/wiki/Configuration-Variables).
|
62
64
|
|
data/bin/lolcommits
CHANGED
@@ -134,25 +134,35 @@ def do_capture
|
|
134
134
|
capture_device = Choice.choices[:device] || ENV['LOLCOMMITS_DEVICE'] || nil
|
135
135
|
capture_font = Choice.choices[:font] || ENV['LOLCOMMITS_FONT'] || nil
|
136
136
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
:
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
runner.run
|
147
|
-
|
148
|
-
Launchy.open(runner.main_image)
|
149
|
-
else
|
150
|
-
runner = Lolcommits::Runner.new(:capture_delay => capture_delay,
|
151
|
-
:capture_device => capture_device,
|
152
|
-
:config => configuration,
|
153
|
-
:font => capture_font
|
137
|
+
fork_me? do
|
138
|
+
if Choice.choices[:test]
|
139
|
+
info "*** Capturing in test mode."
|
140
|
+
runner = Lolcommits::Runner.new(:capture_delay => capture_delay,
|
141
|
+
:capture_device => capture_device,
|
142
|
+
:message => Choice.choices[:msg],
|
143
|
+
:sha => Choice.choices[:sha],
|
144
|
+
:config => configuration,
|
145
|
+
:font => capture_font
|
154
146
|
)
|
155
|
-
|
147
|
+
runner.run
|
148
|
+
|
149
|
+
Launchy.open(runner.main_image)
|
150
|
+
else
|
151
|
+
runner = Lolcommits::Runner.new(:capture_delay => capture_delay,
|
152
|
+
:capture_device => capture_device,
|
153
|
+
:config => configuration,
|
154
|
+
:font => capture_font
|
155
|
+
)
|
156
|
+
runner.run
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
def fork_me?(&block)
|
162
|
+
if Choice.choices[:fork] || ENV['LOLCOMMITS_FORK']
|
163
|
+
fork { yield block }
|
164
|
+
else
|
165
|
+
yield block
|
156
166
|
end
|
157
167
|
end
|
158
168
|
|
@@ -190,7 +200,9 @@ def do_gif
|
|
190
200
|
puts "*** Generating animated gif."
|
191
201
|
|
192
202
|
gif = MiniMagick::Image.new File.join configuration.archivedir, filename
|
193
|
-
|
203
|
+
|
204
|
+
# This is for ruby 1.8.7, *lolimages just doesn't work with ruby 187
|
205
|
+
gif.run_command("convert", *[ "-delay", "50", "-loop", "0", lolimages, "#{gif.path}"].flatten)
|
194
206
|
|
195
207
|
puts "*** #{gif.path} generated."
|
196
208
|
end
|
@@ -303,6 +315,10 @@ Choice.options do
|
|
303
315
|
desc "generate animated gif"
|
304
316
|
end
|
305
317
|
|
318
|
+
option :fork do
|
319
|
+
long "--fork"
|
320
|
+
desc "fork the lolcommits runner to the background"
|
321
|
+
end
|
306
322
|
end
|
307
323
|
|
308
324
|
# Set debug level if needed
|
data/features/lolcommits.feature
CHANGED
@@ -27,6 +27,16 @@ Feature: Basic UI functionality
|
|
27
27
|
Then the output should contain "You don't appear to be in the base directory of a git project."
|
28
28
|
And the exit status should be 1
|
29
29
|
|
30
|
+
Scenario: Capture doesnt break in forked mode
|
31
|
+
Given I am in a git repository named "testforkcapture"
|
32
|
+
And I do a git commit
|
33
|
+
When I successfully run `lolcommits --capture --fork`
|
34
|
+
And I run `sleep 3` #give fork enough time to complete
|
35
|
+
Then the output should contain "*** Preserving this moment in history."
|
36
|
+
And a directory named "../.lolcommits/testforkcapture" should exist
|
37
|
+
And a file named "../.lolcommits/testforkcapture/tmp_snapshot.jpg" should not exist
|
38
|
+
And there should be exactly 1 jpg in "../.lolcommits/testforkcapture"
|
39
|
+
|
30
40
|
Scenario: Commiting in an enabled repo triggers successful capture
|
31
41
|
Given I am in a git repository named "testcapture" with lolcommits enabled
|
32
42
|
When I do a git commit
|
@@ -32,10 +32,16 @@ Given /^a git repository named "(.*?)" with (a|no) "(.*?)" hook$/ do |repo_name,
|
|
32
32
|
step %{the git repository named "#{repo_name}" has #{yesno_modifier} "#{hook_name}" hook}
|
33
33
|
end
|
34
34
|
|
35
|
-
Given /^I am in a git repository named "(.*?)"
|
35
|
+
Given /^I am in a git repository named "(.*?)"$/ do |repo_name|
|
36
36
|
steps %Q{
|
37
37
|
Given a git repository named "#{repo_name}"
|
38
38
|
And I cd to "#{repo_name}"
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
Given /^I am in a git repository named "(.*?)" with lolcommits enabled$/ do |repo_name|
|
43
|
+
steps %Q{
|
44
|
+
Given I am in a git repository named "#{repo_name}"
|
39
45
|
And I successfully run `lolcommits --enable`
|
40
46
|
}
|
41
47
|
end
|
data/lib/lolcommits.rb
CHANGED
@@ -23,7 +23,6 @@ require 'lolcommits/plugin'
|
|
23
23
|
require 'lolcommits/plugins/loltext'
|
24
24
|
require 'lolcommits/plugins/dot_com'
|
25
25
|
require 'lolcommits/plugins/tranzlate'
|
26
|
-
require 'lolcommits/plugins/statsd'
|
27
26
|
require 'lolcommits/plugins/lol_twitter'
|
28
27
|
require 'lolcommits/plugins/uploldz'
|
29
28
|
require 'lolcommits/plugins/lolsrv'
|
data/lib/lolcommits/runner.rb
CHANGED
@@ -16,7 +16,6 @@ module Lolcommits
|
|
16
16
|
set_callback :run, :after, :execute_lolcommits_uploldz
|
17
17
|
set_callback :run, :after, :execute_lolcommits_lolsrv
|
18
18
|
set_callback :run, :after, :execute_lolcommits_lol_twitter
|
19
|
-
set_callback :run, :after, :execute_lolcommits_stats_d
|
20
19
|
set_callback :run, :after, :execute_lolcommits_dot_com
|
21
20
|
set_callback :run, :after, :execute_lolcommits_loltext
|
22
21
|
# Executed First
|
data/lib/lolcommits/version.rb
CHANGED
data/lolcommits.gemspec
CHANGED
@@ -39,7 +39,6 @@ Gem::Specification.new do |s|
|
|
39
39
|
s.add_runtime_dependency('oauth') #twitter
|
40
40
|
s.add_runtime_dependency('rest-client') #uploldz
|
41
41
|
s.add_runtime_dependency('httmultiparty') #dot_com
|
42
|
-
s.add_runtime_dependency('statsd-ruby', '~> 1.2.0') #statsd
|
43
42
|
s.add_runtime_dependency('json', '~> 1.7.6') #lolsrv
|
44
43
|
|
45
44
|
end
|
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.
|
4
|
+
version: 0.4.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mini_magick
|
@@ -267,22 +267,6 @@ dependencies:
|
|
267
267
|
- - ! '>='
|
268
268
|
- !ruby/object:Gem::Version
|
269
269
|
version: '0'
|
270
|
-
- !ruby/object:Gem::Dependency
|
271
|
-
name: statsd-ruby
|
272
|
-
requirement: !ruby/object:Gem::Requirement
|
273
|
-
none: false
|
274
|
-
requirements:
|
275
|
-
- - ~>
|
276
|
-
- !ruby/object:Gem::Version
|
277
|
-
version: 1.2.0
|
278
|
-
type: :runtime
|
279
|
-
prerelease: false
|
280
|
-
version_requirements: !ruby/object:Gem::Requirement
|
281
|
-
none: false
|
282
|
-
requirements:
|
283
|
-
- - ~>
|
284
|
-
- !ruby/object:Gem::Version
|
285
|
-
version: 1.2.0
|
286
270
|
- !ruby/object:Gem::Dependency
|
287
271
|
name: json
|
288
272
|
requirement: !ruby/object:Gem::Requirement
|
@@ -337,7 +321,6 @@ files:
|
|
337
321
|
- lib/lolcommits/plugins/lol_twitter.rb
|
338
322
|
- lib/lolcommits/plugins/lolsrv.rb
|
339
323
|
- lib/lolcommits/plugins/loltext.rb
|
340
|
-
- lib/lolcommits/plugins/statsd.rb
|
341
324
|
- lib/lolcommits/plugins/tranzlate.rb
|
342
325
|
- lib/lolcommits/plugins/uploldz.rb
|
343
326
|
- lib/lolcommits/runner.rb
|
@@ -367,7 +350,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
367
350
|
version: '0'
|
368
351
|
segments:
|
369
352
|
- 0
|
370
|
-
hash:
|
353
|
+
hash: -1840880118136918531
|
371
354
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
372
355
|
none: false
|
373
356
|
requirements:
|
@@ -376,7 +359,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
376
359
|
version: '0'
|
377
360
|
segments:
|
378
361
|
- 0
|
379
|
-
hash:
|
362
|
+
hash: -1840880118136918531
|
380
363
|
requirements: []
|
381
364
|
rubyforge_project: lolcommits
|
382
365
|
rubygems_version: 1.8.23
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require "statsd"
|
2
|
-
|
3
|
-
#
|
4
|
-
# This is just to keep some usage statistics on lolcommits.
|
5
|
-
#
|
6
|
-
|
7
|
-
module Lolcommits
|
8
|
-
class StatsD < Plugin
|
9
|
-
def initialize(runner)
|
10
|
-
super
|
11
|
-
|
12
|
-
self.name = 'statsd'
|
13
|
-
self.default = true
|
14
|
-
end
|
15
|
-
|
16
|
-
def run
|
17
|
-
$statsd = Statsd.new('23.20.178.143')
|
18
|
-
if Configuration.is_fakecapture?
|
19
|
-
$statsd.increment 'app.lolcommits.fakecaptures'
|
20
|
-
else
|
21
|
-
$statsd.increment 'app.lolcommits.captures'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|