class SysCmd::Shell
Attributes
type[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/sys_cmd.rb, line 437 def initialize(options = {}) @type = SysCmd.os_type(options) end
Public Instance Methods
applicable?(options = {})
click to toggle source
# File lib/sys_cmd.rb, line 474 def applicable?(options = {}) applicable = true only_on = Array(options[:only_on]) unless only_on.empty? applicable = false unless only_on.include?(@type) end except_on = Array(options[:except_on]) unless except_on.empty? applicable = false if except_on.include?(@type) end applicable end
escape(text)
click to toggle source
# File lib/sys_cmd.rb, line 443 def escape(text) SysCmd.escape(text, os: @type) end
escape_filename(name)
click to toggle source
# File lib/sys_cmd.rb, line 455 def escape_filename(name) if @type == :windows name = name.gsub('/', '\\') end escape name end
escape_value(value)
click to toggle source
# File lib/sys_cmd.rb, line 462 def escape_value(value) escape value.to_s end
here_doc(data, options = {})
click to toggle source
# File lib/sys_cmd.rb, line 487 def here_doc(data, options = {}) SysCmd.here_doc(data, options.merge(os: @type)) end
line_separator()
click to toggle source
# File lib/sys_cmd.rb, line 466 def line_separator SysCmd.line_separator(os: @type) end
option_switch()
click to toggle source
# File lib/sys_cmd.rb, line 470 def option_switch SysCmd.option_switch(os: @type) end
requires_escaping?(text)
click to toggle source
# File lib/sys_cmd.rb, line 447 def requires_escaping?(text) SysCmd.requires_escaping?(text, os: @type) end
split(text)
click to toggle source
# File lib/sys_cmd.rb, line 451 def split(text) SysCmd.split(text, os: @type) end