Module: MyPDFKit::OS
- Defined in:
- lib/my_pdfkit/os.rb
Class Method Summary collapse
Class Method Details
.host_is_windows? ⇒ Boolean
7 8 9 |
# File 'lib/my_pdfkit/os.rb', line 7 def self.host_is_windows? !(RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince/).nil? end |
.shell_escape_for_os(args) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/my_pdfkit/os.rb', line 11 def self.shell_escape_for_os(args) if (host_is_windows?) # Windows reserved shell characters are: & | ( ) < > ^ # See http://technet.microsoft.com/en-us/library/cc723564.aspx#XSLTsection123121120120 args.map { |arg| arg.gsub(/([&|()<>^])/,'^\1') }.join(" ") else args.shelljoin end end |