Last active
April 4, 2016 13:54
-
-
Save zytzagoo/96ac66838198dc330dfb to your computer and use it in GitHub Desktop.
Modified/patched lib/mina.rb (0.3.2) for Windows support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/mina.rb | |
module Mina | |
PREFIX = File.dirname(__FILE__) | |
ROOT = File.expand_path('../../', __FILE__) | |
# if running on windows | |
is_windows = !!(RUBY_PLATFORM =~ /mswin|mingw|windows|cygwin/) | |
if is_windows | |
module Shellwords | |
def shellescape(str) | |
'"' + str.gsub(/\\(?=\\*\")/, "\\\\\\").gsub(/\"/, "\\\"").gsub(/\\$/, "\\\\\\").gsub("%", "%%") + '"' | |
end | |
module_function :shellescape | |
class << self | |
alias escape shellescape | |
end | |
end | |
end | |
require 'mina/version' | |
autoload :DeployHelpers, 'mina/deploy_helpers' | |
autoload :OutputHelpers, 'mina/output_helpers' | |
autoload :SshHelpers, 'mina/ssh_helpers' | |
autoload :ExecHelpers, 'mina/exec_helpers' | |
autoload :Helpers, 'mina/helpers' | |
autoload :Settings, 'mina/settings' | |
autoload :Tools, 'mina/tools' | |
Error = Class.new(Exception) | |
class Failed < Error | |
attr_accessor :exitstatus | |
end | |
def self.root_path(*a) | |
File.join ROOT, *a | |
end | |
end |
Same patch works for simple deployments for mina 0.3.8 too
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same patch works for simple deployments for mina 0.3.4 as well