lolcommits 0.9.6 → 0.9.7.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +11 -2
- data/features/support/env.rb +1 -1
- data/lib/lolcommits.rb +0 -3
- data/lib/lolcommits/backends/git_info.rb +9 -2
- data/lib/lolcommits/backends/installation_git.rb +2 -2
- data/lib/lolcommits/backends/mercurial_info.rb +5 -0
- data/lib/lolcommits/configuration.rb +3 -1
- data/lib/lolcommits/gem_plugin.rb +2 -2
- data/lib/lolcommits/platform.rb +1 -1
- data/lib/lolcommits/plugin/lol_flowdock.rb +1 -1
- data/lib/lolcommits/plugin/lol_yammer.rb +1 -1
- data/lib/lolcommits/test_helpers/git_repo.rb +1 -1
- data/lib/lolcommits/version.rb +1 -1
- data/lolcommits.gemspec +4 -5
- metadata +5 -22
- data/lib/lolcommits/plugin/dot_com.rb +0 -50
- data/lib/lolcommits/plugin/lolsrv.rb +0 -58
- data/lib/lolcommits/plugin/uploldz.rb +0 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eabd6f7bcb218a41800639928db4cb88cc0ea270
|
4
|
+
data.tar.gz: 58a67da5eb1241edda555e12341805a6fd0ce15c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5e9b23c5e2ed563887a1492be9c34bb2641902989ea354ce41ef0ed76c2603ebca4e7241711185eb2603fa9fdb105981621fec792c54f873812f1501582b3cd
|
7
|
+
data.tar.gz: c6b3b127488061f76b706fbc1bb5d7164a48cdbb34aa992ae9c75858e18110abc8dc0f35963b80c40df66e7a392ea631e9ab0b779421cc71ab5050c34f5556df
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,11 @@ project adheres to [Semantic Versioning][Semver].
|
|
8
8
|
* WIP - extract more plugins to gems ...
|
9
9
|
* Your contribution here!
|
10
10
|
|
11
|
+
## [0.9.7][] (17 September 2017)
|
12
|
+
* Extract dotcom to gem (@matthutchinson [#355][])
|
13
|
+
* Extract uploldz to gem (@matthutchinson [#354][])
|
14
|
+
* Extract lolsrv to gem (@matthutchinson [#353][])
|
15
|
+
|
11
16
|
## [0.9.6][] (28 August 2017)
|
12
17
|
* Clean legacy plugin methods (@matthutchinson [#348][])
|
13
18
|
* Extract Slack Plugin to gem (@matthutchinson [#349][])
|
@@ -289,8 +294,9 @@ project adheres to [Semantic Versioning][Semver].
|
|
289
294
|
instead of compositing multiply image Caption objects (this seems to be more
|
290
295
|
reliable to not glitch.)
|
291
296
|
|
292
|
-
[Unreleased]: https://github.com/mroth/lolcommits/compare/v0.9.
|
293
|
-
[0.9.
|
297
|
+
[Unreleased]: https://github.com/mroth/lolcommits/compare/v0.9.7...HEAD
|
298
|
+
[0.9.7]: https://github.com/mroth/lolcommits/compare/v0.9.6...v0.9.7
|
299
|
+
[0.9.6]: https://github.com/mroth/lolcommits/compare/v0.9.5...v0.9.6
|
294
300
|
[0.9.5]: https://github.com/mroth/lolcommits/compare/v0.9.4...v0.9.5
|
295
301
|
[0.9.4]: https://github.com/mroth/lolcommits/compare/v0.9.3...v0.9.4
|
296
302
|
[0.9.3]: https://github.com/mroth/lolcommits/compare/v0.9.2...v0.9.3
|
@@ -460,3 +466,6 @@ project adheres to [Semantic Versioning][Semver].
|
|
460
466
|
[#349]: https://github.com/mroth/lolcommits/pull/349
|
461
467
|
[#351]: https://github.com/mroth/lolcommits/pull/351
|
462
468
|
[#352]: https://github.com/mroth/lolcommits/pull/352
|
469
|
+
[#353]: https://github.com/mroth/lolcommits/pull/353
|
470
|
+
[#354]: https://github.com/mroth/lolcommits/pull/354
|
471
|
+
[#355]: https://github.com/mroth/lolcommits/pull/355
|
data/features/support/env.rb
CHANGED
data/lib/lolcommits.rb
CHANGED
@@ -29,10 +29,7 @@ require 'lolcommits/backends/git_info'
|
|
29
29
|
require 'lolcommits/backends/mercurial_info'
|
30
30
|
|
31
31
|
require 'lolcommits/plugin/base'
|
32
|
-
require 'lolcommits/plugin/dot_com'
|
33
|
-
require 'lolcommits/plugin/uploldz'
|
34
32
|
require 'lolcommits/plugin/term_output'
|
35
|
-
require 'lolcommits/plugin/lolsrv'
|
36
33
|
require 'lolcommits/plugin/lol_yammer'
|
37
34
|
require 'lolcommits/plugin/lol_protonet'
|
38
35
|
require 'lolcommits/plugin/lol_tumblr'
|
@@ -17,6 +17,7 @@ module Lolcommits
|
|
17
17
|
debug "GitInfo: \t#{repo_internal_path}"
|
18
18
|
debug "GitInfo: \t#{repo}"
|
19
19
|
debug "GitInfo: \t#{branch}"
|
20
|
+
debug "GitInfo: \t#{commit_date}"
|
20
21
|
debug "GitInfo: \t#{author_name}" if author_name
|
21
22
|
debug "GitInfo: \t#{author_email}" if author_email
|
22
23
|
end
|
@@ -42,7 +43,9 @@ module Lolcommits
|
|
42
43
|
|
43
44
|
def url
|
44
45
|
@url ||= begin
|
45
|
-
|
46
|
+
if repository.remote && repository.remote.url
|
47
|
+
remote_https_url(repository.remote.url)
|
48
|
+
end
|
46
49
|
end
|
47
50
|
end
|
48
51
|
|
@@ -68,10 +71,14 @@ module Lolcommits
|
|
68
71
|
@author_email ||= last_commit.author.email if last_commit.author
|
69
72
|
end
|
70
73
|
|
74
|
+
def commit_date
|
75
|
+
@commit_date ||= last_commit.date.utc
|
76
|
+
end
|
77
|
+
|
71
78
|
private
|
72
79
|
|
73
80
|
def remote_https_url(url)
|
74
|
-
url.tr(':', '/').
|
81
|
+
url.tr(':', '/').gsub(/^git@/, 'https://').gsub(/\.git$/, '') + '/commit/'
|
75
82
|
end
|
76
83
|
|
77
84
|
def repository(path = '.')
|
@@ -67,11 +67,11 @@ module Lolcommits
|
|
67
67
|
exports = "set path=\"#{ruby_path};#{imagick_path};%PATH%\""
|
68
68
|
end
|
69
69
|
|
70
|
-
<<-
|
70
|
+
<<-HOOK
|
71
71
|
### lolcommits hook (begin) ###
|
72
72
|
#{exports} && #{capture_cmd}
|
73
73
|
### lolcommits hook (end) ###
|
74
|
-
|
74
|
+
HOOK
|
75
75
|
end
|
76
76
|
|
77
77
|
# does a git hook exist at all?
|
@@ -24,6 +24,7 @@ module Lolcommits
|
|
24
24
|
debug "MercurialInfo: \t#{repo_internal_path}"
|
25
25
|
debug "MercurialInfo: \t#{repo}"
|
26
26
|
debug "MercurialInfo: \t#{branch}"
|
27
|
+
debug "MercurialInfo: \t#{commit_date}"
|
27
28
|
debug "MercurialInfo: \t#{author_name}" if author_name
|
28
29
|
debug "MercurialInfo: \t#{author_email}" if author_email
|
29
30
|
end
|
@@ -63,6 +64,10 @@ module Lolcommits
|
|
63
64
|
@author_email ||= last_commit.author_email
|
64
65
|
end
|
65
66
|
|
67
|
+
def commit_date
|
68
|
+
@commit_date ||= last_commit.date.utc
|
69
|
+
end
|
70
|
+
|
66
71
|
private
|
67
72
|
|
68
73
|
def repository(path = '.')
|
@@ -2,7 +2,9 @@ module Lolcommits
|
|
2
2
|
class Configuration
|
3
3
|
LOLCOMMITS_BASE = ENV['LOLCOMMITS_DIR'] || File.join(ENV['HOME'], '.lolcommits')
|
4
4
|
LOLCOMMITS_ROOT = File.join(File.dirname(__FILE__), '../..')
|
5
|
-
|
5
|
+
|
6
|
+
attr_accessor :plugin_manager
|
7
|
+
attr_writer :loldir
|
6
8
|
|
7
9
|
def initialize(plugin_manager, test_mode: false)
|
8
10
|
@plugin_manager = plugin_manager
|
@@ -14,7 +14,7 @@ module Lolcommits
|
|
14
14
|
rescue LoadError => e
|
15
15
|
warn "Found plugin #{name}, but could not require gem '#{gem_name}'"
|
16
16
|
warn e
|
17
|
-
rescue => e
|
17
|
+
rescue StandardError => e
|
18
18
|
warn "require gem '#{gem_name}' failed with: #{e}"
|
19
19
|
end
|
20
20
|
|
@@ -40,7 +40,7 @@ module Lolcommits
|
|
40
40
|
|
41
41
|
def plugin_klass
|
42
42
|
self.class.const_get(plugin_klass_name)
|
43
|
-
rescue => e
|
43
|
+
rescue StandardError => e
|
44
44
|
warn "failed to load constant from plugin gem '#{plugin_klass_name}: #{e}'"
|
45
45
|
end
|
46
46
|
|
data/lib/lolcommits/platform.rb
CHANGED
@@ -65,7 +65,7 @@ module Lolcommits
|
|
65
65
|
# cli_version check will throw a MiniMagick::Error exception if IM is not
|
66
66
|
# installed in PATH, since it attempts to parse output from `identify`
|
67
67
|
!MiniMagick.cli_version.nil?
|
68
|
-
rescue
|
68
|
+
rescue StandardError
|
69
69
|
return false
|
70
70
|
end
|
71
71
|
|
@@ -71,7 +71,7 @@ module Lolcommits
|
|
71
71
|
response = client.create_message(post, attachment1: lolimage)
|
72
72
|
debug response.body.inspect
|
73
73
|
puts "\t--> Status posted!" if response
|
74
|
-
rescue => e
|
74
|
+
rescue StandardError => e
|
75
75
|
retries -= 1
|
76
76
|
retry if retries > 0
|
77
77
|
puts "Status not posted - #{e.message}"
|
data/lib/lolcommits/version.rb
CHANGED
data/lolcommits.gemspec
CHANGED
@@ -12,13 +12,13 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.license = 'LGPL-3'
|
13
13
|
s.summary = 'Capture webcam image on git commit for lulz.'
|
14
14
|
|
15
|
-
s.description = <<-
|
15
|
+
s.description = <<-DESC
|
16
16
|
lolcommits takes a snapshot with your webcam every time you git commit code,
|
17
17
|
and archives a lolcat style image with it. It's selfies for software
|
18
18
|
developers. `git blame` has never been so much fun.
|
19
|
-
|
19
|
+
DESC
|
20
20
|
|
21
|
-
s.post_install_message = <<-
|
21
|
+
s.post_install_message = <<-POSTINSTALL
|
22
22
|
-------------------------------------------------------------------------------
|
23
23
|
|
24
24
|
Lolcommits: quick message from the dev team! v0.9.5 extracts the Twitter plugin
|
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
|
|
36
36
|
Happy Lol'ing!
|
37
37
|
|
38
38
|
-------------------------------------------------------------------------------
|
39
|
-
|
39
|
+
POSTINSTALL
|
40
40
|
|
41
41
|
s.files = `git ls-files`.split("\n")
|
42
42
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -67,7 +67,6 @@ EOF
|
|
67
67
|
|
68
68
|
# plugin gems
|
69
69
|
s.add_runtime_dependency('yam', '~> 2.5.0') # yammer
|
70
|
-
s.add_runtime_dependency('httmultiparty', '~> 0.3.16') # dot_com
|
71
70
|
s.add_runtime_dependency('tumblr_client', '~> 0.8.5') # tumblr
|
72
71
|
|
73
72
|
# development gems
|
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.9.
|
4
|
+
version: 0.9.7.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Rothenberg
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aruba
|
@@ -179,20 +179,6 @@ dependencies:
|
|
179
179
|
- - "~>"
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: 2.5.0
|
182
|
-
- !ruby/object:Gem::Dependency
|
183
|
-
name: httmultiparty
|
184
|
-
requirement: !ruby/object:Gem::Requirement
|
185
|
-
requirements:
|
186
|
-
- - "~>"
|
187
|
-
- !ruby/object:Gem::Version
|
188
|
-
version: 0.3.16
|
189
|
-
type: :runtime
|
190
|
-
prerelease: false
|
191
|
-
version_requirements: !ruby/object:Gem::Requirement
|
192
|
-
requirements:
|
193
|
-
- - "~>"
|
194
|
-
- !ruby/object:Gem::Version
|
195
|
-
version: 0.3.16
|
196
182
|
- !ruby/object:Gem::Dependency
|
197
183
|
name: tumblr_client
|
198
184
|
requirement: !ruby/object:Gem::Requirement
|
@@ -382,15 +368,12 @@ files:
|
|
382
368
|
- lib/lolcommits/installation.rb
|
383
369
|
- lib/lolcommits/platform.rb
|
384
370
|
- lib/lolcommits/plugin/base.rb
|
385
|
-
- lib/lolcommits/plugin/dot_com.rb
|
386
371
|
- lib/lolcommits/plugin/lol_flowdock.rb
|
387
372
|
- lib/lolcommits/plugin/lol_hipchat.rb
|
388
373
|
- lib/lolcommits/plugin/lol_protonet.rb
|
389
374
|
- lib/lolcommits/plugin/lol_tumblr.rb
|
390
375
|
- lib/lolcommits/plugin/lol_yammer.rb
|
391
|
-
- lib/lolcommits/plugin/lolsrv.rb
|
392
376
|
- lib/lolcommits/plugin/term_output.rb
|
393
|
-
- lib/lolcommits/plugin/uploldz.rb
|
394
377
|
- lib/lolcommits/plugin_manager.rb
|
395
378
|
- lib/lolcommits/runner.rb
|
396
379
|
- lib/lolcommits/test_helpers/fake_io.rb
|
@@ -438,14 +421,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
438
421
|
version: '2.0'
|
439
422
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
440
423
|
requirements:
|
441
|
-
- - "
|
424
|
+
- - ">"
|
442
425
|
- !ruby/object:Gem::Version
|
443
|
-
version:
|
426
|
+
version: 1.3.1
|
444
427
|
requirements:
|
445
428
|
- imagemagick
|
446
429
|
- a webcam
|
447
430
|
rubyforge_project:
|
448
|
-
rubygems_version: 2.
|
431
|
+
rubygems_version: 2.6.13
|
449
432
|
signing_key:
|
450
433
|
specification_version: 4
|
451
434
|
summary: Capture webcam image on git commit for lulz.
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'httmultiparty'
|
2
|
-
|
3
|
-
module Lolcommits
|
4
|
-
module Plugin
|
5
|
-
class DotCom < Base
|
6
|
-
BASE_URL = 'http://lolcommits-dot-com.herokuapp.com'.freeze
|
7
|
-
|
8
|
-
def initialize(runner: nil, config: nil)
|
9
|
-
super
|
10
|
-
options.concat(%w(api_key api_secret repo_id))
|
11
|
-
end
|
12
|
-
|
13
|
-
def run_capture_ready
|
14
|
-
t = Time.now.to_i.to_s
|
15
|
-
HTTMultiParty.post(
|
16
|
-
"#{BASE_URL}/git_commits.json",
|
17
|
-
body: {
|
18
|
-
git_commit: {
|
19
|
-
sha: runner.sha,
|
20
|
-
repo_external_id: configuration['repo_id'],
|
21
|
-
image: File.open(runner.main_image),
|
22
|
-
raw: File.open(runner.snapshot_loc)
|
23
|
-
},
|
24
|
-
|
25
|
-
key: configuration['api_key'],
|
26
|
-
t: t,
|
27
|
-
token: Digest::SHA1.hexdigest(configuration['api_secret'] + t)
|
28
|
-
}
|
29
|
-
)
|
30
|
-
rescue => e
|
31
|
-
log_error(e, "ERROR: HTTMultiParty POST FAILED #{e.class} - #{e.message}")
|
32
|
-
end
|
33
|
-
|
34
|
-
def configured?
|
35
|
-
!configuration['enabled'].nil? &&
|
36
|
-
configuration['api_key'] &&
|
37
|
-
configuration['api_secret'] &&
|
38
|
-
configuration['repo_id']
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.name
|
42
|
-
'dot_com'
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.runner_order
|
46
|
-
:capture_ready
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'rest_client'
|
2
|
-
require 'pp'
|
3
|
-
require 'json'
|
4
|
-
|
5
|
-
module Lolcommits
|
6
|
-
module Plugin
|
7
|
-
class Lolsrv < Base
|
8
|
-
def initialize(runner: nil, config: nil)
|
9
|
-
super
|
10
|
-
options << 'server'
|
11
|
-
end
|
12
|
-
|
13
|
-
def run_capture_ready
|
14
|
-
fork { sync }
|
15
|
-
end
|
16
|
-
|
17
|
-
def configured?
|
18
|
-
!configuration['enabled'].nil? && configuration['server']
|
19
|
-
end
|
20
|
-
|
21
|
-
def sync
|
22
|
-
existing = existing_lols
|
23
|
-
return unless existing.nil?
|
24
|
-
Dir[runner.config.loldir + '/*.{jpg,gif}'].each do |item|
|
25
|
-
sha = File.basename(item, '.*')
|
26
|
-
upload(item, sha) unless existing.include?(sha) || sha == 'tmp_snapshot'
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def existing_lols
|
31
|
-
lols = JSON.parse(RestClient.get(configuration['server'] + '/lols'))
|
32
|
-
lols.map { |lol| lol['sha'] }
|
33
|
-
rescue => e
|
34
|
-
log_error(e, "ERROR: existing lols could not be retrieved #{e.class} - #{e.message}")
|
35
|
-
return nil
|
36
|
-
end
|
37
|
-
|
38
|
-
def upload(file, sha)
|
39
|
-
RestClient.post(configuration['server'] + '/uplol',
|
40
|
-
lol: File.new(file),
|
41
|
-
url: runner.vcs_info.url + sha,
|
42
|
-
repo: runner.vcs_info.repo,
|
43
|
-
date: File.ctime(file),
|
44
|
-
sha: sha)
|
45
|
-
rescue => e
|
46
|
-
log_error(e, "ERROR: Upload of lol #{sha} FAILED #{e.class} - #{e.message}")
|
47
|
-
end
|
48
|
-
|
49
|
-
def self.name
|
50
|
-
'lolsrv'
|
51
|
-
end
|
52
|
-
|
53
|
-
def self.runner_order
|
54
|
-
:capture_ready
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
require 'rest_client'
|
2
|
-
require 'base64'
|
3
|
-
|
4
|
-
module Lolcommits
|
5
|
-
module Plugin
|
6
|
-
class Uploldz < Base
|
7
|
-
attr_accessor :endpoint
|
8
|
-
|
9
|
-
def initialize(runner: nil, config: nil)
|
10
|
-
super
|
11
|
-
options.concat(
|
12
|
-
%w(
|
13
|
-
endpoint
|
14
|
-
optional_key
|
15
|
-
optional_http_auth_username
|
16
|
-
optional_http_auth_password
|
17
|
-
)
|
18
|
-
)
|
19
|
-
end
|
20
|
-
|
21
|
-
def run_capture_ready
|
22
|
-
if !runner.vcs_info || runner.vcs_info.repo.empty?
|
23
|
-
puts 'Repo is empty, skipping upload'
|
24
|
-
else
|
25
|
-
debug "Posting capture to #{configuration['endpoint']}"
|
26
|
-
RestClient.post(
|
27
|
-
configuration['endpoint'],
|
28
|
-
{
|
29
|
-
file: File.new(runner.main_image),
|
30
|
-
message: runner.message,
|
31
|
-
repo: runner.vcs_info.repo,
|
32
|
-
author_name: runner.vcs_info.author_name,
|
33
|
-
author_email: runner.vcs_info.author_email,
|
34
|
-
sha: runner.sha,
|
35
|
-
key: configuration['optional_key']
|
36
|
-
},
|
37
|
-
Authorization: authorization_header
|
38
|
-
)
|
39
|
-
end
|
40
|
-
rescue => e
|
41
|
-
log_error(e, "ERROR: RestClient POST FAILED #{e.class} - #{e.message}")
|
42
|
-
end
|
43
|
-
|
44
|
-
def configured?
|
45
|
-
!configuration['enabled'].nil? && configuration['endpoint']
|
46
|
-
end
|
47
|
-
|
48
|
-
def authorization_header
|
49
|
-
user = configuration['optional_http_auth_username']
|
50
|
-
password = configuration['optional_http_auth_password']
|
51
|
-
return unless user || password
|
52
|
-
|
53
|
-
'Basic ' + Base64.encode64("#{user}:#{password}").chomp
|
54
|
-
end
|
55
|
-
|
56
|
-
def self.name
|
57
|
-
'uploldz'
|
58
|
-
end
|
59
|
-
|
60
|
-
def self.runner_order
|
61
|
-
:capture_ready
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|