lolcommits 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,17 +3,17 @@ rvm:
3
3
  - 1.8.7
4
4
  - 1.9.2
5
5
  - 1.9.3
6
- - ruby-head
6
+ - 2.0.0
7
7
 
8
8
  before_install:
9
- # - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16126D3A3E5C1192
9
+ # imagemagick is installed by default on normal travis image now
10
10
  - sudo apt-get update -qq
11
- - sudo apt-get install -qq -y mplayer imagemagick libmagickwand-dev
11
+ - sudo apt-get install -qq -y mplayer
12
+ # - sudo apt-get install -qq -y imagemagick libmagickwand-dev
12
13
 
13
- #test against ruby-head as well so we know what's coming down the pipe
14
- matrix:
15
- allow_failures:
16
- - rvm: ruby-head
14
+ # matrix:
15
+ # allow_failures:
16
+ # - rvm: 2.0.0
17
17
 
18
18
  branches:
19
19
  except:
data/CHANGELOG CHANGED
@@ -1,6 +1,11 @@
1
- 0.4.2 (in development)
1
+ 0.4.3 (in development)
2
2
  * TODO: figure out problems with GUI clients
3
- * TODO: figure out ruby 2.0 compatibility and testing
3
+
4
+ 0.4.2 (11 March 2013)
5
+ * fix ruby 2.0 compatibility (#91)
6
+ * gracefully detect upstream issue with git color.ui being set to always (#50)
7
+ * handle external capture devices with special characters in name (#93)
8
+ * fixes to the uploldz plugin (#92)
4
9
 
5
10
  0.4.1 (17 February 2013)
6
11
  * add lolsrv plugin (thx @sebastianmarr!, #82)
@@ -24,24 +24,31 @@ def command?(name)
24
24
  $?.success?
25
25
  end
26
26
 
27
- if Configuration.is_mac?
28
- unless File.executable? File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "ext", "imagesnap", "imagesnap")
29
- fatal "Couldn't properly execute imagesnap for some reason, please file a bug?!"
27
+ def die_on_fatal_conditions!
28
+ if Configuration.is_mac?
29
+ unless File.executable? File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "ext", "imagesnap", "imagesnap")
30
+ fatal "Couldn't properly execute imagesnap for some reason, please file a bug?!"
31
+ exit 1
32
+ end
33
+ elsif Configuration.is_linux?
34
+ if not command?('mplayer')
35
+ fatal "Couldn't find mplayer in your PATH!"
36
+ exit 1
37
+ end
38
+ end
39
+ unless File.readable? File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "fonts", "Impact.ttf")
40
+ fatal "Couldn't properly read Impact font from gem package, please file a bug?!"
30
41
  exit 1
31
42
  end
32
- elsif Configuration.is_linux?
33
- if not command?('mplayer')
34
- fatal "Couldn't find mplayer in your PATH!"
43
+ unless Configuration.valid_imagemagick_installed?
44
+ fatal "FATAL: ImageMagick does not appear to be properly installed!"
45
+ exit 1
46
+ end
47
+ if Configuration.git_config_color_always?
48
+ fatal "Due to a bug in the ruby-git library, git config for color.ui cannot be set to 'always'."
49
+ fatal "Try setting it to 'auto' instead!"
35
50
  exit 1
36
51
  end
37
- end
38
- unless File.readable? File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "fonts", "Impact.ttf")
39
- fatal "Couldn't properly read Impact font from gem package, please file a bug?!"
40
- exit 1
41
- end
42
- unless Configuration.valid_imagemagick_installed?
43
- fatal "FATAL: ImageMagick does not appear to be properly installed!"
44
- exit 1
45
52
  end
46
53
 
47
54
  def die_if_not_git_repo!
@@ -274,6 +281,11 @@ if debug_mode
274
281
  debug "Outputting at DEBUG verbosity"
275
282
  end
276
283
 
284
+ #
285
+ # check for fatal conditions before execution
286
+ #
287
+ die_on_fatal_conditions!
288
+
277
289
  #
278
290
  # Handle actions manually since choice seems weird
279
291
  #
@@ -45,3 +45,14 @@ Feature: Bug regression testing
45
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
+
49
+ #
50
+ # issue #50, https://github.com/mroth/lolcommits/issues/50
51
+ #
52
+ Scenario: catch upstream bug with ruby-git and color=always
53
+ Given I am in a git repository named "whatev" with lolcommits enabled
54
+ And I successfully run `git config color.ui always`
55
+ When I run `lolcommits`
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
+ And the output should contain "Try setting it to 'auto' instead!"
58
+ And the exit status should be 1
@@ -1,6 +1,6 @@
1
1
  Feature: Plugins Work
2
2
 
3
- @focus @announce @slow_process
3
+ @slow_process
4
4
  Scenario: Lolcommits.com integration works
5
5
  Given I am in a git repository named "dot_com" with lolcommits enabled
6
6
  When I run `lolcommits --config` and wait for output
@@ -1,7 +1,7 @@
1
1
  module Lolcommits
2
2
  class CaptureMac < Capturer
3
3
  def capture_device_string
4
- @capture_device.nil? ? nil : "-d #{@capture_device}"
4
+ @capture_device.nil? ? nil : "-d \"#{@capture_device}\""
5
5
  end
6
6
 
7
7
  def capture
@@ -137,6 +137,10 @@ module Lolcommits
137
137
  MiniMagick::valid_version_installed?
138
138
  end
139
139
 
140
+ def self.git_config_color_always?
141
+ `git config color.ui`.chomp =~ /always/
142
+ end
143
+
140
144
  # Cross-platform way of finding an executable in the $PATH.
141
145
  # idea taken from http://bit.ly/qDaTbY
142
146
  #
@@ -1,7 +1,7 @@
1
1
  module Lolcommits
2
2
  class GitInfo
3
3
  include Methadone::CLILogging
4
- attr_accessor :sha, :message, :repo_internal_path
4
+ attr_accessor :sha, :message, :repo_internal_path, :repo
5
5
 
6
6
  def initialize
7
7
  debug "GitInfo: attempting to read local repository"
@@ -13,11 +13,15 @@ module Lolcommits
13
13
  self.message = commit.message.split("\n").first
14
14
  self.sha = commit.sha[0..10]
15
15
  self.repo_internal_path = g.repo.path
16
+ regex = /.*[:\/](\w*).git/
17
+ match = g.remote.url.match regex if g.remote.url
18
+ self.repo = match[1] if match
16
19
 
17
20
  debug "GitInfo: parsed the following values from commit:"
18
21
  debug "GitInfo: \t#{self.message}"
19
22
  debug "GitInfo: \t#{self.sha}"
20
23
  debug "GitInfo: \t#{self.repo_internal_path}"
24
+ debug "GitInfo: \t#{self.repo}"
21
25
  end
22
26
  end
23
27
  end
@@ -13,12 +13,16 @@ module Lolcommits
13
13
  end
14
14
 
15
15
  def run
16
+ repo = self.runner.repo.to_s
16
17
  if configuration['endpoint'].empty?
17
18
  puts "Endpoint URL is empty, please run lolcommits --config to add one."
19
+ elsif repo.empty?
20
+ puts "Repo is empty, skipping upload"
18
21
  else
19
- RestClient.post(configuration['endpoint'],
22
+ plugdebug "Calling " + configuration['endpoint'] + " with repo " + repo
23
+ RestClient.post(configuration['endpoint'],
20
24
  :file => File.new(self.runner.main_image),
21
- :repo => self.runner.repo)
25
+ :repo => repo)
22
26
  end
23
27
 
24
28
  end
@@ -31,6 +31,7 @@ module Lolcommits
31
31
  self.sha = git_info.sha if self.sha.nil?
32
32
  self.message = git_info.message if self.message.nil?
33
33
  self.repo_internal_path = git_info.repo_internal_path
34
+ self.repo = git_info.repo
34
35
  end
35
36
  end
36
37
 
@@ -1,3 +1,3 @@
1
1
  module Lolcommits
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  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.1
4
+ version: 0.4.2
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-02-18 00:00:00.000000000 Z
12
+ date: 2013-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mini_magick
@@ -367,7 +367,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
367
367
  version: '0'
368
368
  segments:
369
369
  - 0
370
- hash: 4513374714395710926
370
+ hash: 4005532101610258654
371
371
  required_rubygems_version: !ruby/object:Gem::Requirement
372
372
  none: false
373
373
  requirements:
@@ -376,7 +376,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
376
376
  version: '0'
377
377
  segments:
378
378
  - 0
379
- hash: 4513374714395710926
379
+ hash: 4005532101610258654
380
380
  requirements: []
381
381
  rubyforge_project: lolcommits
382
382
  rubygems_version: 1.8.25