Skip to content

Instantly share code, notes, and snippets.

@zytzagoo
Last active April 4, 2016 13:54
Show Gist options
  • Save zytzagoo/96ac66838198dc330dfb to your computer and use it in GitHub Desktop.
Save zytzagoo/96ac66838198dc330dfb to your computer and use it in GitHub Desktop.
Modified/patched lib/mina.rb (0.3.2) for Windows support
# 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
@zytzagoo
Copy link
Author

Same patch works for simple deployments for mina 0.3.4 as well

@zytzagoo
Copy link
Author

zytzagoo commented Apr 4, 2016

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