acmcommits 1.0.11 → 1.0.12
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/Rakefile +11 -11
- data/acmcommits.gemspec +4 -4
- data/bin/lolcommits +24 -24
- data/features/bugs.feature +16 -16
- data/features/lolcommits.feature +41 -41
- data/features/plugins.feature +10 -10
- data/features/step_definitions/lolcommits_steps.rb +6 -6
- data/features/support/env.rb +5 -5
- data/lib/lolcommits/capture_fake.rb +2 -2
- data/lib/lolcommits/capture_linux.rb +1 -1
- data/lib/lolcommits/capture_mac.rb +2 -2
- data/lib/lolcommits/capture_windows.rb +2 -2
- data/lib/lolcommits/capturer.rb +1 -1
- data/lib/lolcommits/configuration.rb +20 -20
- data/lib/lolcommits/git_info.rb +3 -3
- data/lib/lolcommits/plugin.rb +1 -1
- data/lib/lolcommits/plugins/lolsrv.rb +7 -7
- data/lib/lolcommits/plugins/loltext.rb +3 -2
- data/lib/lolcommits/plugins/statsd.rb +1 -1
- data/lib/lolcommits/runner.rb +7 -7
- data/lib/lolcommits/version.rb +2 -2
- data/lib/lolcommits.rb +13 -13
- data/test/test_lolcommits.rb +9 -9
- data/test.rb +4 -3
- metadata +30 -30
data/Rakefile
CHANGED
@@ -29,9 +29,9 @@ Cucumber::Rake::Task.new(:features) do |t|
|
|
29
29
|
end
|
30
30
|
|
31
31
|
Rake::RDocTask.new do |rd|
|
32
|
-
|
32
|
+
|
33
33
|
rd.main = "README.rdoc"
|
34
|
-
|
34
|
+
|
35
35
|
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
|
36
36
|
end
|
37
37
|
|
@@ -39,31 +39,31 @@ task :default => [:test,:features]
|
|
39
39
|
|
40
40
|
|
41
41
|
|
42
|
-
desc "Migrate an existing local .
|
42
|
+
desc "Migrate an existing local .lolcommits directory to Dropbox"
|
43
43
|
task :dropboxify do
|
44
44
|
$home = ENV['HOME']
|
45
|
-
dropbox_loldir = "#{$home}/Dropbox/
|
46
|
-
loldir = "#{$home}/.
|
47
|
-
backup_loldir = "#{$home}/.
|
48
|
-
|
45
|
+
dropbox_loldir = "#{$home}/Dropbox/lolcommits"
|
46
|
+
loldir = "#{$home}/.lolcommits"
|
47
|
+
backup_loldir = "#{$home}/.lolcommits.old"
|
48
|
+
|
49
49
|
#check whether we've done this already
|
50
50
|
if File.symlink? loldir
|
51
51
|
abort "already dropboxified!"
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
#create dropbox folder
|
55
55
|
if not File.directory? dropbox_loldir
|
56
56
|
FileUtils.mkdir_p dropbox_loldir
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
#backup existing loldir
|
60
60
|
if File.directory? loldir
|
61
61
|
FileUtils.mv( loldir, backup_loldir )
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
#symlink dropbox to local
|
65
65
|
FileUtils.ln_s( dropbox_loldir, loldir )
|
66
|
-
|
66
|
+
|
67
67
|
#copy over existing files
|
68
68
|
FileUtils.cp_r( "#{backup_loldir}/.", loldir)
|
69
69
|
end
|
data/acmcommits.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "
|
3
|
+
require "lolcommits/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "acmcommits"
|
7
|
-
s.version =
|
7
|
+
s.version = Lolcommits::VERSION
|
8
8
|
s.authors = ["Brendan Ryan"]
|
9
9
|
s.email = ["brendanjohnryan@yahoo.com"]
|
10
|
-
s.summary = %q{
|
11
|
-
s.description = %q{
|
10
|
+
s.summary = %q{Lolcommits refactored for use at the UIUC branch of ACM.}
|
11
|
+
s.description = %q{Lolcommits refactored for use at the UIUC branch of ACM.}
|
12
12
|
s.license = "LGPL-3"
|
13
13
|
s.rubyforge_project = "acmcommits"
|
14
14
|
|
data/bin/lolcommits
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
begin
|
4
|
-
require '
|
4
|
+
require 'lolcommits'
|
5
5
|
rescue LoadError
|
6
6
|
require 'rubygems'
|
7
|
-
require '
|
7
|
+
require 'lolcommits'
|
8
8
|
end
|
9
9
|
|
10
|
-
include
|
10
|
+
include Lolcommits
|
11
11
|
require "launchy"
|
12
12
|
require "choice"
|
13
13
|
|
@@ -26,7 +26,7 @@ end
|
|
26
26
|
|
27
27
|
def die_on_fatal_conditions!
|
28
28
|
if Configuration.is_mac?
|
29
|
-
unless File.executable? File.join(Configuration::
|
29
|
+
unless File.executable? File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "ext", "imagesnap", "imagesnap")
|
30
30
|
fatal "Couldn't properly execute imagesnap for some reason, please file a bug?!"
|
31
31
|
exit 1
|
32
32
|
end
|
@@ -36,7 +36,7 @@ def die_on_fatal_conditions!
|
|
36
36
|
exit 1
|
37
37
|
end
|
38
38
|
end
|
39
|
-
unless File.readable? File.join(Configuration::
|
39
|
+
unless File.readable? File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "fonts", "Impact.ttf")
|
40
40
|
fatal "Couldn't properly read Impact font from gem package, please file a bug?!"
|
41
41
|
exit 1
|
42
42
|
end
|
@@ -66,10 +66,10 @@ end
|
|
66
66
|
# NO ARGUMENTS SPECIFIED, HELP THE USER OUT
|
67
67
|
#
|
68
68
|
def do_noargs
|
69
|
-
#TODO: make this a contextual helper to know status of whether
|
69
|
+
#TODO: make this a contextual helper to know status of whether lolcommits is enabled
|
70
70
|
puts "Do what exactly?"
|
71
|
-
puts "Try:
|
72
|
-
puts "Or:
|
71
|
+
puts "Try: lolcommits --enable (when in a git repository)"
|
72
|
+
puts "Or: lolcommits --help"
|
73
73
|
end
|
74
74
|
|
75
75
|
HOOK_PATH = File.join ".git", "hooks", "post-commit"
|
@@ -95,12 +95,12 @@ def do_enable
|
|
95
95
|
exit 1
|
96
96
|
end
|
97
97
|
|
98
|
-
doc = "#!/bin/sh\
|
98
|
+
doc = "#!/bin/sh\nlolcommits --capture\n"
|
99
99
|
File.open(HOOK_PATH, 'w') {|f| f.write(doc) }
|
100
100
|
FileUtils.chmod 0755, HOOK_PATH
|
101
101
|
info "installed lolcommmit hook as:"
|
102
102
|
info " -> #{File.expand_path(HOOK_PATH)}"
|
103
|
-
info "(to remove later, you can use:
|
103
|
+
info "(to remove later, you can use: lolcommits --disable)"
|
104
104
|
# we dont symlink, but rather install a small stub that calls the one from path
|
105
105
|
# that way, as gem version changes, script updates even if new file thus breaking symlink
|
106
106
|
end
|
@@ -114,13 +114,13 @@ def do_disable
|
|
114
114
|
FileUtils.rm HOOK_PATH
|
115
115
|
info "removed #{HOOK_PATH}"
|
116
116
|
else
|
117
|
-
info "
|
117
|
+
info "lolcommits is not enabled for this directory, so there is nothing to uninstall."
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
121
|
def configuration
|
122
122
|
if Choice.choices[:test]
|
123
|
-
Configuration.new(:
|
123
|
+
Configuration.new(:loldir => Configuration.loldir_for('test'))
|
124
124
|
else
|
125
125
|
Configuration.new
|
126
126
|
end
|
@@ -130,13 +130,13 @@ end
|
|
130
130
|
# IF --CAPTURE, DO CAPTURE
|
131
131
|
#
|
132
132
|
def do_capture
|
133
|
-
capture_delay = Choice.choices[:delay] || ENV['
|
134
|
-
capture_device = Choice.choices[:device] || ENV['
|
135
|
-
capture_font = Choice.choices[:font] || ENV['
|
133
|
+
capture_delay = Choice.choices[:delay] || ENV['LOLCOMMITS_DELAY'] || 0
|
134
|
+
capture_device = Choice.choices[:device] || ENV['LOLCOMMITS_DEVICE'] || nil
|
135
|
+
capture_font = Choice.choices[:font] || ENV['LOLCOMMITS_FONT'] || nil
|
136
136
|
|
137
137
|
if Choice.choices[:test]
|
138
138
|
info "*** Capturing in test mode."
|
139
|
-
runner =
|
139
|
+
runner = Lolcommits::Runner.new(:capture_delay => capture_delay,
|
140
140
|
:capture_device => capture_device,
|
141
141
|
:message => Choice.choices[:msg],
|
142
142
|
:sha => Choice.choices[:sha],
|
@@ -147,7 +147,7 @@ def do_capture
|
|
147
147
|
|
148
148
|
Launchy.open(runner.main_image)
|
149
149
|
else
|
150
|
-
runner =
|
150
|
+
runner = Lolcommits::Runner.new(:capture_delay => capture_delay,
|
151
151
|
:capture_device => capture_device,
|
152
152
|
:config => configuration,
|
153
153
|
:font => capture_font
|
@@ -164,7 +164,7 @@ def do_last
|
|
164
164
|
die_if_not_git_repo!
|
165
165
|
lolimage = configuration.most_recent
|
166
166
|
if lolimage.nil?
|
167
|
-
warn "No
|
167
|
+
warn "No lolcommits have been captured for this repository yet."
|
168
168
|
exit 1
|
169
169
|
end
|
170
170
|
Launchy.open lolimage
|
@@ -179,32 +179,32 @@ Choice.options do
|
|
179
179
|
long "--enable"
|
180
180
|
short '-e'
|
181
181
|
action { do_enable }
|
182
|
-
desc "install
|
182
|
+
desc "install lolcommits for this repo"
|
183
183
|
end
|
184
184
|
|
185
185
|
option :disable do
|
186
186
|
long "--disable"
|
187
187
|
short '-d'
|
188
188
|
action { do_disable }
|
189
|
-
desc "uninstall
|
189
|
+
desc "uninstall lolcommits for this repo"
|
190
190
|
end
|
191
191
|
|
192
192
|
option :capture do
|
193
193
|
long "--capture"
|
194
194
|
short '-c'
|
195
|
-
desc "capture
|
195
|
+
desc "capture lolcommit based on last git commit"
|
196
196
|
end
|
197
197
|
|
198
198
|
option :last do
|
199
199
|
long "--last"
|
200
200
|
short "-l"
|
201
|
-
desc "view the most recent
|
201
|
+
desc "view the most recent lolcommit"
|
202
202
|
end
|
203
203
|
|
204
204
|
option :browse do
|
205
205
|
long "--browse"
|
206
206
|
short "-b"
|
207
|
-
desc "browse this repo's
|
207
|
+
desc "browse this repo's lolcommits"
|
208
208
|
end
|
209
209
|
|
210
210
|
option :configure do
|
@@ -275,7 +275,7 @@ Choice.options do
|
|
275
275
|
end
|
276
276
|
|
277
277
|
# Set debug level if needed
|
278
|
-
debug_mode = Choice.choices[:debug] || ENV['
|
278
|
+
debug_mode = Choice.choices[:debug] || ENV['LOLCOMMITS_DEBUG'] || nil
|
279
279
|
if debug_mode
|
280
280
|
logger.level = Logger::DEBUG
|
281
281
|
debug "Outputting at DEBUG verbosity"
|
data/features/bugs.feature
CHANGED
@@ -4,55 +4,55 @@ Feature: Bug regression testing
|
|
4
4
|
So that I don't have to fix them again!
|
5
5
|
|
6
6
|
#
|
7
|
-
# issue #58, https://github.com/mroth/
|
7
|
+
# issue #58, https://github.com/mroth/lolcommits/issues/58
|
8
8
|
#
|
9
9
|
Scenario: handle git repos with spaces in directory name
|
10
|
-
Given I am in a git repository named "test lolol" with
|
10
|
+
Given I am in a git repository named "test lolol" with lolcommits enabled
|
11
11
|
And I successfully run `git commit --allow-empty -m 'can haz commit'`
|
12
12
|
Then the output should contain "*** Preserving this moment in history."
|
13
|
-
And a directory named "../.
|
13
|
+
And a directory named "../.lolcommits/test-lolol" should exist
|
14
14
|
|
15
15
|
#
|
16
|
-
# issue #68, https://github.com/mroth/
|
16
|
+
# issue #68, https://github.com/mroth/lolcommits/issues/68
|
17
17
|
#
|
18
18
|
@fake-interactive-rebase @slow_process @unstable
|
19
19
|
Scenario: Don't trigger capture during a git rebase
|
20
|
-
Given I am in a git repository named "yuh8history" with
|
20
|
+
Given I am in a git repository named "yuh8history" with lolcommits enabled
|
21
21
|
And I do 6 git commits
|
22
22
|
When I successfully run `git rebase -i HEAD~5`
|
23
23
|
# Then there should be 4 commit entries in the git log
|
24
|
-
Then there should be exactly 6 jpgs in "../.
|
24
|
+
Then there should be exactly 6 jpgs in "../.lolcommits/yuh8history"
|
25
25
|
|
26
26
|
#
|
27
|
-
# issue #80, https://github.com/mroth/
|
27
|
+
# issue #80, https://github.com/mroth/lolcommits/issues/80
|
28
28
|
#
|
29
29
|
Scenario: don't warn about system_timer (on MRI 1.8.7)
|
30
|
-
When I successfully run `
|
30
|
+
When I successfully run `lolcommits`
|
31
31
|
Then the output should not contain "Faraday: you may want to install system_timer for reliable timeouts"
|
32
32
|
|
33
33
|
#
|
34
|
-
# issue #81, https://github.com/mroth/
|
34
|
+
# issue #81, https://github.com/mroth/lolcommits/issues/81
|
35
35
|
#
|
36
36
|
Scenario: don't want to see initialized constant warning from Faraday on CLI (on MRI 1.8.7)
|
37
|
-
When I successfully run `
|
37
|
+
When I successfully run `lolcommits`
|
38
38
|
Then the output should not contain "warning: already initialized constant DEFAULT_BOUNDARY"
|
39
|
-
|
39
|
+
|
40
40
|
#
|
41
|
-
# issue #87, https://github.com/mroth/
|
41
|
+
# issue #87, https://github.com/mroth/lolcommits/issues/87
|
42
42
|
#
|
43
43
|
@fake-no-imagemagick
|
44
44
|
Scenario: gracefully fail when imagemagick is not installed
|
45
|
-
When I run `
|
45
|
+
When I run `lolcommits`
|
46
46
|
Then the output should contain "ImageMagick does not appear to be properly installed"
|
47
47
|
And the exit status should be 1
|
48
48
|
|
49
49
|
#
|
50
|
-
# issue #50, https://github.com/mroth/
|
50
|
+
# issue #50, https://github.com/mroth/lolcommits/issues/50
|
51
51
|
#
|
52
52
|
Scenario: catch upstream bug with ruby-git and color=always
|
53
|
-
Given I am in a git repository named "whatev" with
|
53
|
+
Given I am in a git repository named "whatev" with lolcommits enabled
|
54
54
|
And I successfully run `git config color.ui always`
|
55
|
-
When I run `
|
55
|
+
When I run `lolcommits`
|
56
56
|
Then the output should contain "Due to a bug in the ruby-git library, git config for color.ui cannot be set to 'always'."
|
57
57
|
And the output should contain "Try setting it to 'auto' instead!"
|
58
58
|
And the exit status should be 1
|
data/features/lolcommits.feature
CHANGED
@@ -1,53 +1,53 @@
|
|
1
1
|
Feature: Basic UI functionality
|
2
2
|
|
3
3
|
Scenario: App just runs
|
4
|
-
When I get help for "
|
4
|
+
When I get help for "lolcommits"
|
5
5
|
Then the exit status should be 0
|
6
6
|
And the banner should be present
|
7
7
|
|
8
8
|
Scenario: Enable in a naked git repository
|
9
|
-
Given a git repository named "
|
10
|
-
When I cd to "
|
11
|
-
And I successfully run `
|
12
|
-
Then the output should contain "installed
|
13
|
-
And the output should contain "(to remove later, you can use:
|
9
|
+
Given a git repository named "loltest" with no "post-commit" hook
|
10
|
+
When I cd to "loltest"
|
11
|
+
And I successfully run `lolcommits --enable`
|
12
|
+
Then the output should contain "installed lolcommmit hook as:"
|
13
|
+
And the output should contain "(to remove later, you can use: lolcommits --disable)"
|
14
14
|
And a file named ".git/hooks/post-commit" should exist
|
15
15
|
And the exit status should be 0
|
16
16
|
|
17
17
|
Scenario: Disable in a enabled git repository
|
18
|
-
Given I am in a git repository named "lolenabled" with
|
19
|
-
When I successfully run `
|
18
|
+
Given I am in a git repository named "lolenabled" with lolcommits enabled
|
19
|
+
When I successfully run `lolcommits --disable`
|
20
20
|
Then the output should contain "removed"
|
21
21
|
And a file named ".git/hooks/post-commit" should not exist
|
22
22
|
And the exit status should be 0
|
23
23
|
|
24
24
|
Scenario: Trying to enable while not in a git repo fails
|
25
25
|
Given I am in a directory named "svnrulez"
|
26
|
-
When I run `
|
26
|
+
When I run `lolcommits --enable`
|
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
30
|
Scenario: Commiting in an enabled repo triggers successful capture
|
31
|
-
Given I am in a git repository named "testcapture" with
|
31
|
+
Given I am in a git repository named "testcapture" with lolcommits enabled
|
32
32
|
When I do a git commit
|
33
33
|
Then the output should contain "*** Preserving this moment in history."
|
34
|
-
And a directory named "../.
|
35
|
-
And a file named "../.
|
36
|
-
And there should be exactly 1 jpg in "../.
|
34
|
+
And a directory named "../.lolcommits/testcapture" should exist
|
35
|
+
And a file named "../.lolcommits/testcapture/tmp_snapshot.jpg" should not exist
|
36
|
+
And there should be exactly 1 jpg in "../.lolcommits/testcapture"
|
37
37
|
|
38
38
|
Scenario: Commiting in an enabled repo subdirectory triggers successful capture of parent repo
|
39
|
-
Given I am in a git repository named "testcapture" with
|
39
|
+
Given I am in a git repository named "testcapture" with lolcommits enabled
|
40
40
|
And a directory named "subdir"
|
41
41
|
And an empty file named "subdir/FOOBAR"
|
42
42
|
When I cd to "subdir/"
|
43
43
|
And I do a git commit
|
44
44
|
Then the output should contain "*** Preserving this moment in history."
|
45
|
-
And a directory named "../../.
|
46
|
-
And a directory named "../../.
|
47
|
-
And there should be exactly 1 jpg in "../../.
|
45
|
+
And a directory named "../../.lolcommits/testcapture" should exist
|
46
|
+
And a directory named "../../.lolcommits/subdir" should not exist
|
47
|
+
And there should be exactly 1 jpg in "../../.lolcommits/testcapture"
|
48
48
|
|
49
49
|
Scenario: Show plugins
|
50
|
-
When I successfully run `
|
50
|
+
When I successfully run `lolcommits --plugins`
|
51
51
|
Then the output should contain a list of plugins
|
52
52
|
|
53
53
|
#
|
@@ -57,65 +57,65 @@ Feature: Basic UI functionality
|
|
57
57
|
Scenario: Configuring plugin (with native aruba steps)
|
58
58
|
Given a git repository named "config-test"
|
59
59
|
When I cd to "config-test"
|
60
|
-
And I run `
|
60
|
+
And I run `lolcommits --config` interactively
|
61
61
|
When I type "loltext"
|
62
62
|
When I type "true"
|
63
63
|
Then the output should contain a list of plugins
|
64
64
|
And the output should contain "Name of plugin to configure:"
|
65
65
|
Then the output should contain "enabled:"
|
66
66
|
Then the output should contain "Successfully Configured"
|
67
|
-
And a file named "../.
|
68
|
-
When I successfully run `
|
67
|
+
And a file named "../.lolcommits/config-test/config.yml" should exist
|
68
|
+
When I successfully run `lolcommits --show-config`
|
69
69
|
Then the output should contain "loltext:"
|
70
70
|
And the output should contain "enabled: true"
|
71
71
|
|
72
72
|
Scenario: Configuring Plugin
|
73
73
|
Given a git repository named "config-test"
|
74
74
|
When I cd to "config-test"
|
75
|
-
And I run `
|
75
|
+
And I run `lolcommits --config` and wait for output
|
76
76
|
When I enter "loltext" for "Name of plugin to configure"
|
77
77
|
And I enter "true" for "enabled"
|
78
78
|
Then I should be presented "Successfully Configured"
|
79
|
-
And a file named "../.
|
80
|
-
When I successfully run `
|
79
|
+
And a file named "../.lolcommits/config-test/config.yml" should exist
|
80
|
+
When I successfully run `lolcommits --show-config`
|
81
81
|
Then the output should contain "loltext:"
|
82
82
|
And the output should contain "enabled: true"
|
83
|
-
|
83
|
+
|
84
84
|
Scenario: Configuring Plugin In Test Mode
|
85
85
|
Given a git repository named "testmode-config-test"
|
86
86
|
When I cd to "testmode-config-test"
|
87
|
-
And I run `
|
87
|
+
And I run `lolcommits --config --test` and wait for output
|
88
88
|
And I enter "loltext" for "Name of plugin to configure"
|
89
89
|
And I enter "true" for "enabled"
|
90
90
|
Then I should be presented "Successfully Configured"
|
91
|
-
And a file named "../.
|
92
|
-
When I successfully run `
|
91
|
+
And a file named "../.lolcommits/test/config.yml" should exist
|
92
|
+
When I successfully run `lolcommits --test --show-config`
|
93
93
|
Then the output should contain "loltext:"
|
94
94
|
And the output should contain "enabled: true"
|
95
95
|
|
96
96
|
Scenario: test capture should work regardless of whether in a git repository
|
97
97
|
Given I am in a directory named "nothingtoseehere"
|
98
|
-
When I run `
|
98
|
+
When I run `lolcommits --test --capture`
|
99
99
|
Then the output should contain "*** Capturing in test mode."
|
100
100
|
And the output should not contain "path does not exist (ArgumentError)"
|
101
101
|
And the exit status should be 0
|
102
102
|
|
103
103
|
Scenario: test capture should store in its own test directory
|
104
|
-
Given I am in a git repository named "randomgitrepo" with
|
105
|
-
When I successfully run `
|
106
|
-
Then a directory named "../.
|
107
|
-
And a directory named "../.
|
104
|
+
Given I am in a git repository named "randomgitrepo" with lolcommits enabled
|
105
|
+
When I successfully run `lolcommits --test --capture`
|
106
|
+
Then a directory named "../.lolcommits/test" should exist
|
107
|
+
And a directory named "../.lolcommits/randomgitrepo" should not exist
|
108
108
|
|
109
109
|
Scenario: last command should work properly when in a lolrepo
|
110
110
|
Given a git repository named "randomgitrepo"
|
111
111
|
And a loldir named "randomgitrepo" with 2 lolimages
|
112
112
|
And I cd to "randomgitrepo"
|
113
|
-
When I run `
|
113
|
+
When I run `lolcommits --last`
|
114
114
|
Then the exit status should be 0
|
115
115
|
|
116
116
|
Scenario: last command should fail gracefully if not in a lolrepo
|
117
117
|
Given I am in a directory named "gitsuxcvs4eva"
|
118
|
-
When I run `
|
118
|
+
When I run `lolcommits --last`
|
119
119
|
Then the output should contain "Can't do that since we're not in a valid git repository!"
|
120
120
|
And the exit status should be 1
|
121
121
|
|
@@ -123,25 +123,25 @@ Feature: Basic UI functionality
|
|
123
123
|
Given a git repository named "randomgitrepo"
|
124
124
|
And a loldir named "randomgitrepo" with 0 lolimages
|
125
125
|
And I cd to "randomgitrepo"
|
126
|
-
When I run `
|
127
|
-
Then the output should contain "No
|
126
|
+
When I run `lolcommits --last`
|
127
|
+
Then the output should contain "No lolcommits have been captured for this repository yet."
|
128
128
|
Then the exit status should be 1
|
129
129
|
|
130
130
|
Scenario: browse command should work properly when in a lolrepo
|
131
131
|
Given a git repository named "randomgitrepo"
|
132
132
|
And a loldir named "randomgitrepo" with 2 lolimages
|
133
133
|
And I cd to "randomgitrepo"
|
134
|
-
When I run `
|
134
|
+
When I run `lolcommits --browse`
|
135
135
|
Then the exit status should be 0
|
136
136
|
|
137
137
|
Scenario: browse command should fail gracefully when not in a lolrepo
|
138
138
|
Given I am in a directory named "gitsuxcvs4eva"
|
139
|
-
When I run `
|
139
|
+
When I run `lolcommits --browse`
|
140
140
|
Then the output should contain "Can't do that since we're not in a valid git repository!"
|
141
141
|
And the exit status should be 1
|
142
142
|
|
143
143
|
Scenario: handle commit messages with quotation marks
|
144
|
-
Given I am in a git repository named "shellz" with
|
144
|
+
Given I am in a git repository named "shellz" with lolcommits enabled
|
145
145
|
When I successfully run `git commit --allow-empty -m 'i hate \"air quotes\" dont you'`
|
146
146
|
Then the exit status should be 0
|
147
|
-
And there should be exactly 1 jpg in "../.
|
147
|
+
And there should be exactly 1 jpg in "../.lolcommits/shellz"
|
data/features/plugins.feature
CHANGED
@@ -1,34 +1,34 @@
|
|
1
1
|
Feature: Plugins Work
|
2
2
|
###
|
3
3
|
#@slow_process
|
4
|
-
#Scenario:
|
5
|
-
#Given I am in a git repository named "dot_com" with
|
6
|
-
#When I run `
|
4
|
+
#Scenario: Lolcommits.com integration works
|
5
|
+
#Given I am in a git repository named "dot_com" with lolcommits enabled
|
6
|
+
#When I run `lolcommits --config` and wait for output
|
7
7
|
#And I enter "dot_com" for "Plugin Name"
|
8
8
|
#And I enter "true" for "enabled"
|
9
9
|
#And I enter "b2a70ac0b64e012fa61522000a8c42dc" for "api_key"
|
10
10
|
# Then I should be presented "Successfully Configured"
|
11
11
|
# When I do a git commit
|
12
12
|
# Then the output should contain "*** Preserving this moment in history."
|
13
|
-
# And there should be exactly 1 jpg in "../.
|
13
|
+
# And there should be exactly 1 jpg in "../.lolcommits/dot_com"
|
14
14
|
###
|
15
15
|
Scenario: Disable loltext
|
16
|
-
Given I am in a git repository named "loltext" with
|
17
|
-
And I run `
|
16
|
+
Given I am in a git repository named "loltext" with lolcommits enabled
|
17
|
+
And I run `lolcommits --config` and wait for output
|
18
18
|
And I enter "loltext" for "Plugin Name"
|
19
19
|
And I enter "false" for "enabled"
|
20
20
|
Then I should be presented "Successfully Configured"
|
21
21
|
When I do a git commit
|
22
22
|
Then the output should contain "*** Preserving this moment in history."
|
23
|
-
And there should be exactly 1 jpg in "../.
|
23
|
+
And there should be exactly 1 jpg in "../.lolcommits/loltext"
|
24
24
|
|
25
25
|
Scenario: lolsrv integration works
|
26
|
-
Given I am in a git repository named "lolsrv" with
|
27
|
-
When I run `
|
26
|
+
Given I am in a git repository named "lolsrv" with lolcommits enabled
|
27
|
+
When I run `lolcommits --config` and wait for output
|
28
28
|
And I enter "lolsrv" for "Plugin Name"
|
29
29
|
And I enter "true" for "enabled"
|
30
30
|
And I enter "http://localhost" for "server"
|
31
31
|
Then I should be presented "Successfully Configured"
|
32
32
|
When I do a git commit
|
33
33
|
Then the output should contain "*** Preserving this moment in history."
|
34
|
-
And there should be exactly 1 jpg in "../.
|
34
|
+
And there should be exactly 1 jpg in "../.lolcommits/lolsrv"
|
@@ -32,11 +32,11 @@ 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 "(.*?)" with
|
35
|
+
Given /^I am in a git repository named "(.*?)" with lolcommits enabled$/ 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
|
-
And I successfully run `
|
39
|
+
And I successfully run `lolcommits --enable`
|
40
40
|
}
|
41
41
|
end
|
42
42
|
|
@@ -46,12 +46,12 @@ When /^I run `(.*?)` and wait for output$/ do |command|
|
|
46
46
|
@fields = Hash.new
|
47
47
|
end
|
48
48
|
|
49
|
-
Given /^a
|
50
|
-
|
51
|
-
mkdir_p
|
49
|
+
Given /^a loldir named "(.*?)" with (\d+) lolimages$/ do |repo_name, num_images|
|
50
|
+
loldir = "tmp/aruba/.lolcommits/#{repo_name}"
|
51
|
+
mkdir_p loldir
|
52
52
|
num_images.to_i.times do
|
53
53
|
random_hex = "%011x" % (rand * 0xfffffffffff)
|
54
|
-
cp "test/images/test_image.jpg", File.join(
|
54
|
+
cp "test/images/test_image.jpg", File.join( loldir, "#{random_hex}.jpg")
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
data/features/support/env.rb
CHANGED
@@ -18,8 +18,8 @@ Before do
|
|
18
18
|
@original_rubylib = ENV['RUBYLIB']
|
19
19
|
ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
|
20
20
|
|
21
|
-
@original_fakecapture = ENV['
|
22
|
-
ENV['
|
21
|
+
@original_fakecapture = ENV['LOLCOMMITS_FAKECAPTURE']
|
22
|
+
ENV['LOLCOMMITS_FAKECAPTURE'] = "1"
|
23
23
|
|
24
24
|
# @original_loldir = ENV['LOLCOMMITS_DIR']
|
25
25
|
# ENV['LOLCOMMITS_DIR'] = File.expand_path( File.join(current_dir, ".lolcommits") )
|
@@ -32,14 +32,14 @@ end
|
|
32
32
|
|
33
33
|
After do
|
34
34
|
ENV['RUBYLIB'] = @original_rubylib
|
35
|
-
ENV['
|
35
|
+
ENV['LOLCOMMITS_FAKECAPTURE'] = @original_fakecapture
|
36
36
|
# ENV['LOLCOMMITS_DIR'] = @original_loldir
|
37
37
|
ENV['HOME'] = @original_home
|
38
38
|
ENV['LAUNCHY_DRY_RUN'] = nil
|
39
39
|
end
|
40
40
|
|
41
41
|
Before('@fake-interactive-rebase') do
|
42
|
-
# in order to fake an interactive rebase,
|
42
|
+
# in order to fake an interactive rebase,
|
43
43
|
# we replace the editor with a script that simply squashes a few random commits
|
44
44
|
@original_git_editor = ENV['GIT_EDITOR']
|
45
45
|
# ENV['GIT_EDITOR'] = "sed -i -e 'n;s/pick/squash/g'" #every other commit
|
@@ -82,7 +82,7 @@ Before('@fake-no-imagemagick') do
|
|
82
82
|
end
|
83
83
|
|
84
84
|
# add the temporary directory with git in it back into the path
|
85
|
-
newpaths << tmpbindir
|
85
|
+
newpaths << tmpbindir
|
86
86
|
|
87
87
|
@original_path = ENV['PATH']
|
88
88
|
ENV['PATH'] = newpaths.join(File::PATH_SEPARATOR)
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module
|
1
|
+
module Lolcommits
|
2
2
|
class CaptureFake < Capturer
|
3
3
|
def capture
|
4
|
-
test_image = File.join Configuration::
|
4
|
+
test_image = File.join Configuration::LOLCOMMITS_ROOT, "test", "images", "test_image.jpg"
|
5
5
|
FileUtils.cp test_image, snapshot_location
|
6
6
|
end
|
7
7
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module Lolcommits
|
2
2
|
class CaptureMac < Capturer
|
3
3
|
def capture_device_string
|
4
4
|
@capture_device.nil? ? nil : "-d \"#{@capture_device}\""
|
@@ -13,7 +13,7 @@ module Acmcommits
|
|
13
13
|
private
|
14
14
|
|
15
15
|
def imagesnap_bin
|
16
|
-
File.join(Configuration::
|
16
|
+
File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "ext", "imagesnap", "imagesnap")
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -1,7 +1,7 @@
|
|
1
|
-
module
|
1
|
+
module Lolcommits
|
2
2
|
class CaptureWindows < Capturer
|
3
3
|
def capture
|
4
|
-
commandcam_exe = File.join Configuration::
|
4
|
+
commandcam_exe = File.join Configuration::LOLCOMMITS_ROOT, "vendor", "ext", "CommandCam", "CommandCam.exe"
|
5
5
|
# DirectShow takes a while to show... at least for me anyway
|
6
6
|
delaycmd = " /delay 3000"
|
7
7
|
if capture_delay > 0
|
data/lib/lolcommits/capturer.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
module
|
1
|
+
module Lolcommits
|
2
2
|
class Configuration
|
3
|
-
|
4
|
-
|
5
|
-
attr_writer :
|
3
|
+
LOLBASEDIR = ENV['LOLCOMMITS_DIR'] || File.join(ENV['HOME'], '.lolcommits')
|
4
|
+
LOLCOMMITS_ROOT = File.join(File.dirname(__FILE__), '../..')
|
5
|
+
attr_writer :loldir
|
6
6
|
|
7
7
|
def initialize(attributes={})
|
8
8
|
attributes.each do |attr, val|
|
@@ -33,41 +33,41 @@ module Acmcommits
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def user_configuration_file
|
36
|
-
"#{self.
|
36
|
+
"#{self.loldir}/config.yml"
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
40
|
-
return @
|
39
|
+
def loldir
|
40
|
+
return @loldir if @loldir
|
41
41
|
|
42
42
|
basename ||= File.basename(Git.open('.').dir.to_s).sub(/^\./, 'dot')
|
43
43
|
basename.sub!(/ /, '-')
|
44
44
|
|
45
|
-
@
|
45
|
+
@loldir = Configuration.loldir_for(basename)
|
46
46
|
end
|
47
47
|
|
48
48
|
def self.loldir_for(basename)
|
49
|
-
|
49
|
+
loldir = File.join(LOLBASEDIR, basename)
|
50
50
|
|
51
|
-
if not File.directory?
|
52
|
-
FileUtils.mkdir_p
|
51
|
+
if not File.directory? loldir
|
52
|
+
FileUtils.mkdir_p loldir
|
53
53
|
end
|
54
|
-
|
54
|
+
loldir
|
55
55
|
end
|
56
56
|
|
57
57
|
def most_recent
|
58
|
-
Dir.glob(File.join self.
|
58
|
+
Dir.glob(File.join self.loldir, "*").max_by {|f| File.mtime(f)}
|
59
59
|
end
|
60
60
|
|
61
61
|
def raw_image
|
62
|
-
File.join self.
|
62
|
+
File.join self.loldir, "tmp_snapshot.jpg"
|
63
63
|
end
|
64
64
|
|
65
65
|
def main_image(commit_sha)
|
66
|
-
File.join self.
|
66
|
+
File.join self.loldir, "#{commit_sha}.jpg"
|
67
67
|
end
|
68
68
|
|
69
69
|
def puts_plugins
|
70
|
-
names =
|
70
|
+
names = Lolcommits::PLUGINS.collect {|p| p.new(nil).name }
|
71
71
|
puts "Available plugins: #{names.join(', ')}"
|
72
72
|
end
|
73
73
|
|
@@ -78,7 +78,7 @@ module Acmcommits
|
|
78
78
|
plugin = STDIN.gets.strip
|
79
79
|
end
|
80
80
|
|
81
|
-
plugins =
|
81
|
+
plugins = Lolcommits::PLUGINS.inject(Hash.new) do |acc, val|
|
82
82
|
p = val.new(nil)
|
83
83
|
acc.merge(p.name => p)
|
84
84
|
end
|
@@ -105,9 +105,9 @@ module Acmcommits
|
|
105
105
|
|
106
106
|
config = self.user_configuration || Hash.new
|
107
107
|
config[plugin] = options
|
108
|
-
File.open(self.user_configuration_file, 'w') do |f|
|
108
|
+
File.open(self.user_configuration_file, 'w') do |f|
|
109
109
|
f.write(config.to_yaml)
|
110
|
-
end
|
110
|
+
end
|
111
111
|
|
112
112
|
puts "#{config.to_yaml}\n"
|
113
113
|
puts "Successfully Configured"
|
@@ -126,7 +126,7 @@ module Acmcommits
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def self.is_fakecapture?
|
129
|
-
(ENV['
|
129
|
+
(ENV['LOLCOMMITS_FAKECAPTURE'] == '1' || false)
|
130
130
|
end
|
131
131
|
|
132
132
|
def self.valid_imagemagick_installed?
|
data/lib/lolcommits/git_info.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module Lolcommits
|
2
2
|
class GitInfo
|
3
3
|
include Methadone::CLILogging
|
4
4
|
attr_accessor :sha, :message, :repo_internal_path, :repo
|
@@ -16,11 +16,11 @@ module Acmcommits
|
|
16
16
|
regex = /.*[:\/](\w*).git/
|
17
17
|
match = g.remote.url.match regex if g.remote.url
|
18
18
|
self.repo = match[1] if match
|
19
|
-
|
19
|
+
|
20
20
|
debug "GitInfo: parsed the following values from commit:"
|
21
21
|
debug "GitInfo: \t#{self.message}"
|
22
22
|
debug "GitInfo: \t#{self.sha}"
|
23
|
-
debug "GitInfo: \t#{self.repo_internal_path}"
|
23
|
+
debug "GitInfo: \t#{self.repo_internal_path}"
|
24
24
|
debug "GitInfo: \t#{self.repo}"
|
25
25
|
end
|
26
26
|
end
|
data/lib/lolcommits/plugin.rb
CHANGED
@@ -3,27 +3,27 @@ require "pp"
|
|
3
3
|
require "json"
|
4
4
|
require "logger"
|
5
5
|
|
6
|
-
module
|
6
|
+
module Lolcommits
|
7
7
|
|
8
|
-
class
|
8
|
+
class Lolsrv < Plugin
|
9
9
|
|
10
10
|
SERVER = 'server'
|
11
11
|
|
12
12
|
def initialize(runner)
|
13
13
|
super
|
14
|
-
self.name = '
|
15
|
-
self.default =
|
14
|
+
self.name = 'lolsrv'
|
15
|
+
self.default = false
|
16
16
|
self.options << SERVER
|
17
17
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def run
|
21
21
|
|
22
|
-
log_file = File.new(self.runner.config.loldir + "/
|
22
|
+
log_file = File.new(self.runner.config.loldir + "/lolsrv.log", "a+")
|
23
23
|
@logger = Logger.new(log_file)
|
24
24
|
|
25
25
|
if configuration[SERVER].nil?
|
26
|
-
puts "Missing server configuration. Use
|
26
|
+
puts "Missing server configuration. Use lolcommits --config -p lolsrv"
|
27
27
|
return
|
28
28
|
end
|
29
29
|
|
@@ -65,7 +65,7 @@ module Acmcommits
|
|
65
65
|
:lol => File.new(file),
|
66
66
|
:sha => sha)
|
67
67
|
rescue => error
|
68
|
-
@logger.info "Upload of
|
68
|
+
@logger.info "Upload of LOL "+ sha + " failed with Error " + error.message
|
69
69
|
return
|
70
70
|
end
|
71
71
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module Lolcommits
|
2
2
|
class Loltext < Plugin
|
3
3
|
|
4
4
|
def initialize(runner)
|
@@ -16,7 +16,7 @@ module Acmcommits
|
|
16
16
|
|
17
17
|
# use minimagick wrapper
|
18
18
|
def mm_run
|
19
|
-
font_location = @font_location || File.join(Configuration::
|
19
|
+
font_location = @font_location || File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "fonts", "Impact.ttf")
|
20
20
|
|
21
21
|
plugdebug "Annotating image via MiniMagick"
|
22
22
|
image = MiniMagick::Image.open(self.runner.main_image)
|
@@ -52,6 +52,7 @@ module Acmcommits
|
|
52
52
|
wrapped_text = word_wrap text
|
53
53
|
escape_quotes wrapped_text
|
54
54
|
soap text
|
55
|
+
puts "text being written is #{text}"
|
55
56
|
text
|
56
57
|
end
|
57
58
|
|
data/lib/lolcommits/runner.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
module
|
2
|
-
PLUGINS =
|
1
|
+
module Lolcommits
|
2
|
+
PLUGINS = Lolcommits::Plugin.subclasses
|
3
3
|
|
4
4
|
class Runner
|
5
5
|
attr_accessor :capture_delay, :capture_device, :message, :sha,
|
@@ -13,9 +13,9 @@ module Acmcommits
|
|
13
13
|
|
14
14
|
# Executed Last
|
15
15
|
set_callback :run, :after, :cleanup!
|
16
|
-
set_callback :run, :after, :
|
17
|
-
set_callback :run, :after, :
|
18
|
-
set_callback :run, :after, :
|
16
|
+
set_callback :run, :after, :execute_lolcommits_lolsrv
|
17
|
+
set_callback :run, :after, :execute_lolcommits_stats_d
|
18
|
+
set_callback :run, :after, :execute_lolcommits_loltext
|
19
19
|
# Executed First
|
20
20
|
|
21
21
|
def initialize(attributes={})
|
@@ -39,7 +39,7 @@ module Acmcommits
|
|
39
39
|
puts "*** Preserving this moment in history."
|
40
40
|
self.snapshot_loc = self.config.raw_image
|
41
41
|
self.main_image = self.config.main_image(self.sha)
|
42
|
-
capturer = "
|
42
|
+
capturer = "Lolcommits::Capture#{Configuration.platform}".constantize.new(
|
43
43
|
:capture_device => self.capture_device,
|
44
44
|
:capture_delay => self.capture_delay,
|
45
45
|
:snapshot_location => self.snapshot_loc,
|
@@ -89,7 +89,7 @@ module Acmcommits
|
|
89
89
|
# register a method called "execute_lolcommits_#{plugin_name}"
|
90
90
|
# for each subclass of plugin. these methods should be used as
|
91
91
|
# callbacks to the run method.
|
92
|
-
|
92
|
+
Lolcommits::PLUGINS.each do |plugin|
|
93
93
|
define_method "execute_#{plugin.to_s.underscore.gsub('/', '_')}" do
|
94
94
|
plugin.new(self).execute
|
95
95
|
end
|
data/lib/lolcommits/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "1.0.
|
1
|
+
module Lolcommits
|
2
|
+
VERSION = "1.0.12"
|
3
3
|
end
|
data/lib/lolcommits.rb
CHANGED
@@ -10,18 +10,18 @@ require 'active_support/concern'
|
|
10
10
|
require 'active_support/callbacks'
|
11
11
|
require 'methadone'
|
12
12
|
|
13
|
-
require '
|
14
|
-
require '
|
15
|
-
require '
|
16
|
-
require '
|
17
|
-
require '
|
18
|
-
require '
|
19
|
-
require '
|
20
|
-
require '
|
21
|
-
require '
|
22
|
-
require '
|
23
|
-
require '
|
24
|
-
require '
|
13
|
+
require 'lolcommits/version'
|
14
|
+
require 'lolcommits/configuration'
|
15
|
+
require 'lolcommits/capturer'
|
16
|
+
require 'lolcommits/capture_mac'
|
17
|
+
require 'lolcommits/capture_linux'
|
18
|
+
require 'lolcommits/capture_windows'
|
19
|
+
require 'lolcommits/capture_fake'
|
20
|
+
require 'lolcommits/git_info'
|
21
|
+
require 'lolcommits/plugin'
|
22
|
+
require 'lolcommits/plugins/loltext'
|
23
|
+
require 'lolcommits/plugins/statsd'
|
24
|
+
require 'lolcommits/plugins/lolsrv'
|
25
25
|
|
26
26
|
# require runner after all the plugins have been required
|
27
|
-
require '
|
27
|
+
require 'lolcommits/runner'
|
data/test/test_lolcommits.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'test/unit'
|
2
|
-
# Loads
|
2
|
+
# Loads lolcommits directly from the lib folder so don't have to create
|
3
3
|
# a gem before testing
|
4
4
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
5
5
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
6
|
-
require '
|
6
|
+
require 'lolcommits'
|
7
7
|
|
8
|
-
include
|
8
|
+
include Lolcommits
|
9
9
|
|
10
|
-
class
|
10
|
+
class LolTest < Test::Unit::TestCase
|
11
11
|
def test_can_parse_git
|
12
12
|
assert_nothing_raised do
|
13
13
|
gi = GitInfo.new
|
@@ -17,7 +17,7 @@ class AcmTest < Test::Unit::TestCase
|
|
17
17
|
end
|
18
18
|
|
19
19
|
#
|
20
|
-
# issue #57, https://github.com/mroth/
|
20
|
+
# issue #57, https://github.com/mroth/lolcommits/issues/57
|
21
21
|
#
|
22
22
|
# def test_tranzlate
|
23
23
|
# [["what the hell","(WH|W)UT TEH HELL"],["seriously wtf", "SRSLEH WTF"]].each do |normal, lol|
|
@@ -27,12 +27,12 @@ class AcmTest < Test::Unit::TestCase
|
|
27
27
|
# end
|
28
28
|
|
29
29
|
#
|
30
|
-
# issue #53, https://github.com/mroth/
|
30
|
+
# issue #53, https://github.com/mroth/lolcommits/issues/53
|
31
31
|
# this will test the permissions but only locally, important before building a gem package!
|
32
32
|
#
|
33
33
|
def test_permissions
|
34
|
-
impact_perms = File.lstat(File.join(Configuration::
|
35
|
-
imagesnap_perms = File.lstat(File.join(Configuration::
|
34
|
+
impact_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "fonts", "Impact.ttf")).mode & 0777
|
35
|
+
imagesnap_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "ext", "imagesnap", "imagesnap")).mode & 0777
|
36
36
|
assert impact_perms == 0644 || impact_perms == 0664,
|
37
37
|
"expected perms of 644/664 but instead got #{sprintf '%o', impact_perms}"
|
38
38
|
assert imagesnap_perms == 0755 || imagesnap_perms == 0775,
|
@@ -42,7 +42,7 @@ class AcmTest < Test::Unit::TestCase
|
|
42
42
|
# Hmm.. webcam capture breaks travis-ci tests
|
43
43
|
#def test_can_capture
|
44
44
|
# assert_nothing_raised do
|
45
|
-
#
|
45
|
+
# Lolcommits.capture(0,true,'test commit message','test-sha-001')
|
46
46
|
# end
|
47
47
|
#end
|
48
48
|
|
data/test.rb
CHANGED
@@ -6,8 +6,9 @@
|
|
6
6
|
|
7
7
|
#search the commit for profanity and if it exists remove the commit
|
8
8
|
def soap(text)
|
9
|
-
profanity =
|
10
|
-
|
9
|
+
profanity = {"fuck" => "duck", "bitch" => "snitch", "cunt" => "!@%&",
|
10
|
+
"hate" => "date" , "pissed" => "rustled", "screw" => "poo"}
|
11
|
+
profanity.each { |k,v| text.sub!(k, v) }
|
11
12
|
end
|
12
13
|
# conversion for quotation marks to avoid shell interpretation
|
13
14
|
# does not seem to be a safe way to escape cross-platform?
|
@@ -24,6 +25,6 @@
|
|
24
25
|
|
25
26
|
|
26
27
|
#test goes here
|
27
|
-
text = "hello
|
28
|
+
text = "hello cunt this is a bitch commit"
|
28
29
|
clean_msg text
|
29
30
|
puts text
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acmcommits
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mini_magick
|
16
|
-
requirement: &
|
16
|
+
requirement: &69627950 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.5'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *69627950
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: git
|
27
|
-
requirement: &
|
27
|
+
requirement: &69627170 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.2.5
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *69627170
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: choice
|
38
|
-
requirement: &
|
38
|
+
requirement: &69626770 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.1.6
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *69626770
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: launchy
|
49
|
-
requirement: &
|
49
|
+
requirement: &69626150 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 2.2.0
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *69626150
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: methadone
|
60
|
-
requirement: &
|
60
|
+
requirement: &69625340 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.2.4
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *69625340
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: open4
|
71
|
-
requirement: &
|
71
|
+
requirement: &69624470 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.3.0
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *69624470
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: activesupport
|
82
|
-
requirement: &
|
82
|
+
requirement: &69623880 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 3.2.12
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *69623880
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: rdoc
|
93
|
-
requirement: &
|
93
|
+
requirement: &69620490 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *69620490
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: aruba
|
104
|
-
requirement: &
|
104
|
+
requirement: &69619920 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: 0.5.1
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *69619920
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: rake
|
115
|
-
requirement: &
|
115
|
+
requirement: &69619360 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ~>
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: 10.0.2
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *69619360
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: fivemat
|
126
|
-
requirement: &
|
126
|
+
requirement: &69618860 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *69618860
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: faker
|
137
|
-
requirement: &
|
137
|
+
requirement: &69618280 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ! '>='
|
@@ -142,10 +142,10 @@ dependencies:
|
|
142
142
|
version: '0'
|
143
143
|
type: :development
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *69618280
|
146
146
|
- !ruby/object:Gem::Dependency
|
147
147
|
name: json
|
148
|
-
requirement: &
|
148
|
+
requirement: &69617320 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
150
150
|
requirements:
|
151
151
|
- - ~>
|
@@ -153,8 +153,8 @@ dependencies:
|
|
153
153
|
version: 1.7.6
|
154
154
|
type: :runtime
|
155
155
|
prerelease: false
|
156
|
-
version_requirements: *
|
157
|
-
description:
|
156
|
+
version_requirements: *69617320
|
157
|
+
description: Lolcommits refactored for use at the UIUC branch of ACM.
|
158
158
|
email:
|
159
159
|
- brendanjohnryan@yahoo.com
|
160
160
|
executables:
|
@@ -225,5 +225,5 @@ rubyforge_project: acmcommits
|
|
225
225
|
rubygems_version: 1.8.11
|
226
226
|
signing_key:
|
227
227
|
specification_version: 3
|
228
|
-
summary:
|
228
|
+
summary: Lolcommits refactored for use at the UIUC branch of ACM.
|
229
229
|
test_files: []
|