Skip to content

Commit

Permalink
Merge pull request #276 from mroth/fix-windows-mini-magick-issue
Browse files Browse the repository at this point in the history
fixing windows mini_magick escape issues
  • Loading branch information
matthutchinson committed Apr 19, 2015
2 parents 083dcb0 + cf72657 commit 61155b8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -7,7 +7,7 @@ rvm:
- 1.9.3
- 2.0.0
- 2.1.5
- 2.2.1
- 2.2.2
- ruby-head

before_install:
Expand Down
15 changes: 15 additions & 0 deletions lib/core_ext/mini_magick/utilities.rb
@@ -0,0 +1,15 @@
# -*- encoding : utf-8 -*-
# To maintain MiniMagick compatibility on Windows for v3.8.1 we need this patch
# If/when we upgrade MiniMagick to 4.2+ this patch can be removed
# We are locked at v3.8.1 since MiniMagick 4+ dropped support for Ruby 1.8.7
module MiniMagick
module Utilities
class << self
# fixes issue introduced in this commit
# https://github.com/minimagick/minimagick/commit/65b6427395cbfe6
def windows_escape(cmdline)
'"' + cmdline.gsub(/\\(?=\\*\")/, '\\\\\\').gsub(/\"/, '\\"').gsub(/\\$/, '\\\\\\').gsub('%', '%%') + '"'
end
end
end
end
1 change: 1 addition & 0 deletions lib/lolcommits.rb
Expand Up @@ -3,6 +3,7 @@

require 'core_ext/class'
require 'mini_magick'
require 'core_ext/mini_magick/utilities'
require 'fileutils'
require 'git'
require 'open3'
Expand Down
2 changes: 1 addition & 1 deletion lolcommits.gemspec
Expand Up @@ -59,6 +59,6 @@ Gem::Specification.new do |s|

if RUBY_VERSION >= '1.9.3'
s.add_development_dependency('travis', '~> 1.7.4')
s.add_development_dependency('rubocop', '~> 0.28')
s.add_development_dependency('rubocop', '~> 0.30')
end
end

0 comments on commit 61155b8

Please sign in to comment.