lolcommits 0.5.7 → 0.5.8.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +8 -8
  2. data/.rubocop.yml +1 -0
  3. data/.rubocop_todo.yml +16 -161
  4. data/.travis.yml +11 -4
  5. data/Gemfile +2 -2
  6. data/Rakefile +24 -32
  7. data/bin/lolcommits +62 -125
  8. data/features/bugs.feature +24 -9
  9. data/features/lolcommits.feature +136 -145
  10. data/features/plugins.feature +16 -33
  11. data/features/step_definitions/lolcommits_steps.rb +91 -71
  12. data/features/support/env.rb +18 -48
  13. data/features/support/path_helpers.rb +9 -8
  14. data/lib/lolcommits.rb +3 -10
  15. data/lib/lolcommits/capturer.rb +10 -2
  16. data/lib/lolcommits/capturer/capture_linux.rb +1 -1
  17. data/lib/lolcommits/capturer/capture_linux_animated.rb +12 -13
  18. data/lib/lolcommits/capturer/capture_mac_animated.rb +12 -13
  19. data/lib/lolcommits/cli/fatals.rb +77 -0
  20. data/lib/lolcommits/cli/launcher.rb +29 -0
  21. data/lib/lolcommits/cli/process_runner.rb +48 -0
  22. data/lib/lolcommits/cli/timelapse_gif.rb +45 -0
  23. data/lib/lolcommits/configuration.rb +30 -133
  24. data/lib/lolcommits/git_info.rb +58 -28
  25. data/lib/lolcommits/installation.rb +11 -21
  26. data/lib/lolcommits/platform.rb +134 -0
  27. data/lib/lolcommits/plugin.rb +2 -2
  28. data/lib/lolcommits/plugins/dot_com.rb +15 -15
  29. data/lib/lolcommits/plugins/lol_protonet.rb +68 -0
  30. data/lib/lolcommits/plugins/lol_twitter.rb +12 -15
  31. data/lib/lolcommits/plugins/lol_yammer.rb +4 -6
  32. data/lib/lolcommits/plugins/lolsrv.rb +8 -11
  33. data/lib/lolcommits/plugins/loltext.rb +7 -7
  34. data/lib/lolcommits/plugins/tranzlate.rb +70 -70
  35. data/lib/lolcommits/plugins/uploldz.rb +8 -8
  36. data/lib/lolcommits/runner.rb +36 -35
  37. data/lib/lolcommits/version.rb +1 -1
  38. data/lolcommits.gemspec +11 -10
  39. data/test/lolcommits_test.rb +35 -0
  40. data/test/plugins_test.rb +52 -0
  41. metadata +41 -20
  42. data/test/test_lolcommits.rb +0 -78
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Lolcommits
3
- VERSION = '0.5.7'
3
+ VERSION = '0.5.8.pre1'
4
4
  end
data/lolcommits.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "lolcommits/version"
2
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
+ require 'lolcommits/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'lolcommits'
@@ -19,8 +19,8 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.files = `git ls-files`.split("\n")
21
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
- s.require_paths = ["lib"]
22
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
23
+ s.require_paths = ['lib']
24
24
 
25
25
  # non-gem dependencies
26
26
  s.required_ruby_version = '>= 1.8.7'
@@ -28,13 +28,14 @@ Gem::Specification.new do |s|
28
28
  s.requirements << 'a webcam'
29
29
 
30
30
  # hold back upgrading (and why)
31
- s.add_runtime_dependency('rest-client', '~> 1.6.7') # uploldz (coveralls requires uses this older version)
31
+ s.add_runtime_dependency('rest-client', '~> 1.6.7') # yam gem requires uses this older version
32
32
  s.add_runtime_dependency('mini_magick', '~> 3.8.1') # ~> 4+ fails with JRuby
33
33
  s.add_runtime_dependency('mime-types', '~> 1.25') # ~> 2+ requires Ruby >= 1.9.2
34
34
  s.add_runtime_dependency('httparty', '~> 0.11.0') # ~> 0.13+ requires Ruby >= 1.9.3
35
+ s.add_runtime_dependency('git', '=1.2.8') # ~> 1.2.9 has issues with Ruby 1.8.7
36
+ s.add_development_dependency('cucumber', '=1.3.19') # ~> 2+ requries Ruby >= 1.9.3
35
37
 
36
38
  # core
37
- s.add_runtime_dependency('git', '~> 1.2.8')
38
39
  s.add_runtime_dependency('choice', '~> 0.1.6')
39
40
  s.add_runtime_dependency('launchy', '~> 2.4.3')
40
41
  s.add_runtime_dependency('methadone', '~> 1.8.0')
@@ -50,14 +51,14 @@ Gem::Specification.new do |s|
50
51
  # development gems
51
52
  s.add_development_dependency('fivemat', '~> 1.3.1')
52
53
  s.add_development_dependency('rdoc', '~> 4.2.0')
53
- s.add_development_dependency('aruba', '~> 0.6.1')
54
+ s.add_development_dependency('aruba', '~> 0.6.2')
54
55
  s.add_development_dependency('rake', '~> 10.4.2')
55
56
  s.add_development_dependency('ffaker', '~> 1.25.0')
56
- s.add_development_dependency('travis', '~> 1.7.4')
57
57
  s.add_development_dependency('coveralls', '~> 0.7.2')
58
- s.add_development_dependency('test-unit', '~> 3.0.7')
58
+ s.add_development_dependency('minitest', '~> 5.5.1')
59
59
 
60
60
  if RUBY_VERSION >= '1.9.3'
61
- s.add_development_dependency('rubocop', '~> 0.27.1')
61
+ s.add_development_dependency('travis', '~> 1.7.4')
62
+ s.add_development_dependency('rubocop', '~> 0.28')
62
63
  end
63
64
  end
@@ -0,0 +1,35 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'coveralls'
3
+ Coveralls.wear!
4
+
5
+ require 'minitest/autorun'
6
+
7
+ # Loads lolcommits directly from the lib folder so don't have to create
8
+ # a gem before testing
9
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
10
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
11
+ require 'lolcommits'
12
+
13
+ include Lolcommits
14
+
15
+ class LolTest < MiniTest::Test
16
+ #
17
+ # issue #53, https://github.com/mroth/lolcommits/issues/53
18
+ # this will test the permissions but only locally, important before building a gem package!
19
+ #
20
+ def test_permissions
21
+ impact_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'fonts', 'Impact.ttf')).mode & 0777
22
+ imagesnap_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'imagesnap', 'imagesnap')).mode & 0777
23
+ videosnap_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'videosnap', 'videosnap')).mode & 0777
24
+ commandcam_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'CommandCam', 'CommandCam.exe')).mode & 0777
25
+
26
+ assert impact_perms == 0644 || impact_perms == 0664,
27
+ "expected perms of 644/664 but instead got #{format '%o', impact_perms}"
28
+ assert imagesnap_perms == 0755 || imagesnap_perms == 0775,
29
+ "expected perms of 755/775 but instead got #{format '%o', imagesnap_perms}"
30
+ assert videosnap_perms == 0755 || videosnap_perms == 0775,
31
+ "expected perms of 755/775 but instead got #{format '%o', videosnap_perms}"
32
+ assert commandcam_perms == 0755 || commandcam_perms == 0775,
33
+ "expected perms of 755/775 but instead got #{format '%o', commandcam_perms}"
34
+ end
35
+ end
@@ -0,0 +1,52 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require 'coveralls'
3
+ Coveralls.wear!
4
+
5
+ require 'minitest/autorun'
6
+ require 'ffaker'
7
+
8
+ # Loads lolcommits directly from the lib folder so don't have to create
9
+ # a gem before testing
10
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
11
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
12
+ require 'lolcommits'
13
+
14
+ include Lolcommits
15
+
16
+ class PluginsTest < MiniTest::Test
17
+ #
18
+ # issue #57, https://github.com/mroth/lolcommits/issues/57
19
+ #
20
+ def test_tranzlate
21
+ [['what the hell', '(WH|W)UT TEH HELL'], ['seriously wtf', 'SRSLEH WTF']].each do |normal, lol|
22
+ tranzlated = Lolcommits::Tranzlate.tranzlate(normal)
23
+ assert_match(/^#{lol}/, tranzlated)
24
+ end
25
+ end
26
+
27
+ #
28
+ # issue #136, https://github.com/mroth/lolcommits/issues/136
29
+ def test_lol_twitter_build_tweet
30
+ long_commit_message = Faker::Lorem.sentence(500)
31
+ plugin = Lolcommits::LolTwitter.new(nil)
32
+ max_tweet_size = 116
33
+ suffix = '... #lolcommits'
34
+
35
+ Lolcommits::LolTwitter.send(:define_method, :max_tweet_size, proc { max_tweet_size })
36
+ Lolcommits::LolTwitter.send(:define_method, :configuration, proc { {} })
37
+ assert_equal "#{long_commit_message[0..(max_tweet_size - suffix.length)]}#{suffix}", plugin.build_tweet(long_commit_message)
38
+ end
39
+
40
+ def test_lol_twitter_prefix_suffix
41
+ plugin = Lolcommits::LolTwitter.new(nil)
42
+ Lolcommits::LolTwitter.send(:define_method, :max_tweet_size, proc { 116 })
43
+ assert_match 'commit msg #lolcommits', plugin.build_tweet('commit msg')
44
+
45
+ plugin_config = {
46
+ 'prefix' => '@prefixing!',
47
+ 'suffix' => '#suffixing!'
48
+ }
49
+ Lolcommits::LolTwitter.send(:define_method, :configuration, proc { plugin_config })
50
+ assert_equal '@prefixing! commit msg #suffixing!', plugin.build_tweet('commit msg')
51
+ end
52
+ 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.5.7
4
+ version: 0.5.8.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: 2014-12-29 00:00:00.000000000 Z
12
+ date: 2015-04-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -71,16 +71,30 @@ dependencies:
71
71
  name: git
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ~>
74
+ - - '='
75
75
  - !ruby/object:Gem::Version
76
76
  version: 1.2.8
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ~>
81
+ - - '='
82
82
  - !ruby/object:Gem::Version
83
83
  version: 1.2.8
84
+ - !ruby/object:Gem::Dependency
85
+ name: cucumber
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '='
89
+ - !ruby/object:Gem::Version
90
+ version: 1.3.19
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '='
96
+ - !ruby/object:Gem::Version
97
+ version: 1.3.19
84
98
  - !ruby/object:Gem::Dependency
85
99
  name: choice
86
100
  requirement: !ruby/object:Gem::Requirement
@@ -241,14 +255,14 @@ dependencies:
241
255
  requirements:
242
256
  - - ~>
243
257
  - !ruby/object:Gem::Version
244
- version: 0.6.1
258
+ version: 0.6.2
245
259
  type: :development
246
260
  prerelease: false
247
261
  version_requirements: !ruby/object:Gem::Requirement
248
262
  requirements:
249
263
  - - ~>
250
264
  - !ruby/object:Gem::Version
251
- version: 0.6.1
265
+ version: 0.6.2
252
266
  - !ruby/object:Gem::Dependency
253
267
  name: rake
254
268
  requirement: !ruby/object:Gem::Requirement
@@ -278,61 +292,61 @@ dependencies:
278
292
  - !ruby/object:Gem::Version
279
293
  version: 1.25.0
280
294
  - !ruby/object:Gem::Dependency
281
- name: travis
295
+ name: coveralls
282
296
  requirement: !ruby/object:Gem::Requirement
283
297
  requirements:
284
298
  - - ~>
285
299
  - !ruby/object:Gem::Version
286
- version: 1.7.4
300
+ version: 0.7.2
287
301
  type: :development
288
302
  prerelease: false
289
303
  version_requirements: !ruby/object:Gem::Requirement
290
304
  requirements:
291
305
  - - ~>
292
306
  - !ruby/object:Gem::Version
293
- version: 1.7.4
307
+ version: 0.7.2
294
308
  - !ruby/object:Gem::Dependency
295
- name: coveralls
309
+ name: minitest
296
310
  requirement: !ruby/object:Gem::Requirement
297
311
  requirements:
298
312
  - - ~>
299
313
  - !ruby/object:Gem::Version
300
- version: 0.7.2
314
+ version: 5.5.1
301
315
  type: :development
302
316
  prerelease: false
303
317
  version_requirements: !ruby/object:Gem::Requirement
304
318
  requirements:
305
319
  - - ~>
306
320
  - !ruby/object:Gem::Version
307
- version: 0.7.2
321
+ version: 5.5.1
308
322
  - !ruby/object:Gem::Dependency
309
- name: test-unit
323
+ name: travis
310
324
  requirement: !ruby/object:Gem::Requirement
311
325
  requirements:
312
326
  - - ~>
313
327
  - !ruby/object:Gem::Version
314
- version: 3.0.7
328
+ version: 1.7.4
315
329
  type: :development
316
330
  prerelease: false
317
331
  version_requirements: !ruby/object:Gem::Requirement
318
332
  requirements:
319
333
  - - ~>
320
334
  - !ruby/object:Gem::Version
321
- version: 3.0.7
335
+ version: 1.7.4
322
336
  - !ruby/object:Gem::Dependency
323
337
  name: rubocop
324
338
  requirement: !ruby/object:Gem::Requirement
325
339
  requirements:
326
340
  - - ~>
327
341
  - !ruby/object:Gem::Version
328
- version: 0.27.1
342
+ version: '0.28'
329
343
  type: :development
330
344
  prerelease: false
331
345
  version_requirements: !ruby/object:Gem::Requirement
332
346
  requirements:
333
347
  - - ~>
334
348
  - !ruby/object:Gem::Version
335
- version: 0.27.1
349
+ version: '0.28'
336
350
  description: ! " lolcommits takes a snapshot with your webcam every time you git
337
351
  commit code,\n and archives a lolcat style image with it. It's selfies for software\n
338
352
  \ developers. `git blame` has never been so much fun.\n"
@@ -375,11 +389,17 @@ files:
375
389
  - lib/lolcommits/capturer/capture_mac.rb
376
390
  - lib/lolcommits/capturer/capture_mac_animated.rb
377
391
  - lib/lolcommits/capturer/capture_windows.rb
392
+ - lib/lolcommits/cli/fatals.rb
393
+ - lib/lolcommits/cli/launcher.rb
394
+ - lib/lolcommits/cli/process_runner.rb
395
+ - lib/lolcommits/cli/timelapse_gif.rb
378
396
  - lib/lolcommits/configuration.rb
379
397
  - lib/lolcommits/git_info.rb
380
398
  - lib/lolcommits/installation.rb
399
+ - lib/lolcommits/platform.rb
381
400
  - lib/lolcommits/plugin.rb
382
401
  - lib/lolcommits/plugins/dot_com.rb
402
+ - lib/lolcommits/plugins/lol_protonet.rb
383
403
  - lib/lolcommits/plugins/lol_twitter.rb
384
404
  - lib/lolcommits/plugins/lol_yammer.rb
385
405
  - lib/lolcommits/plugins/lolsrv.rb
@@ -390,7 +410,8 @@ files:
390
410
  - lib/lolcommits/version.rb
391
411
  - lolcommits.gemspec
392
412
  - test/images/test_image.jpg
393
- - test/test_lolcommits.rb
413
+ - test/lolcommits_test.rb
414
+ - test/plugins_test.rb
394
415
  - vendor/ext/CommandCam/COPYING
395
416
  - vendor/ext/CommandCam/CommandCam.exe
396
417
  - vendor/ext/CommandCam/LICENSE
@@ -413,9 +434,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
413
434
  version: 1.8.7
414
435
  required_rubygems_version: !ruby/object:Gem::Requirement
415
436
  requirements:
416
- - - ! '>='
437
+ - - ! '>'
417
438
  - !ruby/object:Gem::Version
418
- version: '0'
439
+ version: 1.3.1
419
440
  requirements:
420
441
  - imagemagick
421
442
  - a webcam
@@ -1,78 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- require 'coveralls'
3
- Coveralls.wear!
4
-
5
- require 'test/unit'
6
- require 'ffaker'
7
- # Loads lolcommits directly from the lib folder so don't have to create
8
- # a gem before testing
9
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
10
- $LOAD_PATH.unshift(File.dirname(__FILE__))
11
- require 'lolcommits'
12
-
13
- include Lolcommits
14
-
15
- class LolTest < Test::Unit::TestCase
16
- def test_can_parse_git
17
- assert_nothing_raised do
18
- gi = GitInfo.new
19
- assert_not_nil gi.message
20
- assert_not_nil gi.sha
21
- end
22
- end
23
-
24
- #
25
- # issue #57, https://github.com/mroth/lolcommits/issues/57
26
- #
27
- def test_tranzlate
28
- [['what the hell', '(WH|W)UT TEH HELL'], ['seriously wtf', 'SRSLEH WTF']].each do |normal, lol|
29
- tranzlated = Lolcommits::Tranzlate.tranzlate(normal)
30
- assert_match /^#{lol}/, tranzlated
31
- end
32
- end
33
-
34
- #
35
- # issue #136, https://github.com/mroth/lolcommits/issues/136
36
- def test_lol_twitter_build_tweet
37
- long_commit_message = Faker::Lorem.sentence(500)
38
- plugin = Lolcommits::LolTwitter.new(nil)
39
- max_tweet_size = 116
40
- suffix = '... #lolcommits'
41
-
42
- Lolcommits::LolTwitter.send(:define_method, :max_tweet_size, Proc.new { max_tweet_size })
43
- assert_match "#{long_commit_message[0..(max_tweet_size - suffix.length)]}#{suffix}", plugin.build_tweet(long_commit_message)
44
- end
45
-
46
- def test_lol_twitter_prefix_suffix
47
- plugin = Lolcommits::LolTwitter.new(nil)
48
- Lolcommits::LolTwitter.send(:define_method, :max_tweet_size, Proc.new { 116 })
49
- assert_match 'commit msg #lolcommits', plugin.build_tweet('commit msg')
50
-
51
- plugin_config = {
52
- 'prefix' => '@prefixing!',
53
- 'suffix' => '#suffixing!'
54
- }
55
- Lolcommits::LolTwitter.send(:define_method, :configuration, Proc.new { plugin_config })
56
- assert_match '@prefixing! commit msg #suffixing!', plugin.build_tweet('commit msg')
57
- end
58
-
59
- #
60
- # issue #53, https://github.com/mroth/lolcommits/issues/53
61
- # this will test the permissions but only locally, important before building a gem package!
62
- #
63
- def test_permissions
64
- impact_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'fonts', 'Impact.ttf')).mode & 0777
65
- imagesnap_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'imagesnap', 'imagesnap')).mode & 0777
66
- videosnap_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'videosnap', 'videosnap')).mode & 0777
67
- commandcam_perms = File.lstat(File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'CommandCam', 'CommandCam.exe')).mode & 0777
68
-
69
- assert impact_perms == 0644 || impact_perms == 0664,
70
- "expected perms of 644/664 but instead got #{sprintf '%o', impact_perms}"
71
- assert imagesnap_perms == 0755 || imagesnap_perms == 0775,
72
- "expected perms of 755/775 but instead got #{sprintf '%o', imagesnap_perms}"
73
- assert videosnap_perms == 0755 || videosnap_perms == 0775,
74
- "expected perms of 755/775 but instead got #{sprintf '%o', videosnap_perms}"
75
- assert commandcam_perms == 0755 || commandcam_perms == 0775,
76
- "expected perms of 755/775 but instead got #{sprintf '%o', commandcam_perms}"
77
- end
78
- end