/0001-albino-windows-refactor.patch
Forked from jonforums/0001-albino-windows-refactor.patch
Created Sep 1, 2011
Make Jekyll play nice with Windows again post Albino + posix-spawn refactor
diff --git a/lib/albino.rb b/lib/albino.rb | |
index 387c8e9..b77d55e 100644 | |
--- a/lib/albino.rb | |
+++ b/lib/albino.rb | |
@@ -1,4 +1,5 @@ | |
require 'posix-spawn' | |
+require 'rbconfig' | |
## | |
# Wrapper for the Pygments command line tool, pygmentize. | |
@@ -84,11 +85,21 @@ class Albino | |
proc_options[:timeout] = options.delete(:timeout) || self.class.timeout_threshold | |
command = convert_options(options) | |
command.unshift(bin) | |
- Child.new(*(command + [proc_options.merge(:input => write_target)])) | |
+ if RbConfig::CONFIG['host_os'] =~ /(mingw|mswin)/ | |
+ output = '' | |
+ IO.popen(command, mode='r+') do |p| | |
+ p.write @target | |
+ p.close_write | |
+ output = p.read.strip | |
+ end | |
+ output | |
+ else | |
+ Child.new(*(command + [proc_options.merge(:input => write_target)])) | |
+ end | |
end | |
def colorize(options = {}) | |
- out = execute(options).out | |
+ out = RbConfig::CONFIG['host_os'] =~ /(mingw|mswin)/ ? execute(options) : execute(options).out | |
# markdown requires block elements on their own line | |
out.sub!(%r{</pre></div>\Z}, "</pre>\n</div>") | |
This comment has been minimized.
This comment has been minimized.
Depends on if you are using Windows or Linux.
Go to Ruby's gems directory, find Albino gem directory and then find
albino.rb and and make the changes depicted.
I use portable Ruby on Windows. For me the file resides in
F:<my dir>\ruby\lib\ruby\gems\1.9.1\gems\albino-1.3.3\lib
…On Thu, May 10, 2012 at 12:08 AM, Matt Hickford < ***@***.*** > wrote:
Stupid question, how do I apply the patch?
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/1185645
|
This comment has been minimized.
This comment has been minimized.
I reported the bug that this patch fixes in Albino github/albino#14 Hopefully the patch will be accepted |
This comment has been minimized.
This comment has been minimized.
@madhur thanks for posting this up here, patch worked perfectly. Shame that albino seems to be abandoned though. |
This comment has been minimized.
This comment has been minimized.
thanks,but if i have not albino-1.3.3,。。。 |
This comment has been minimized.
This comment has been minimized.
thanks,but if i have not albino-1.3.3,。。。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Stupid question, how do I apply the patch?