module ShellCommandConstructor
Public Class Methods
construct_command(strings_or_list, connector = " && ")
click to toggle source
# File lib/addon/shell_command_constructor.rb, line 2 def self.construct_command strings_or_list, connector = " && " list = case strings_or_list when Array strings_or_list when String strings_or_list.split(/\n/) end list.each_with_object([]) do |line, obj| line.strip! next if line.empty? next if line =~ /^#/ obj.push line end.join connector end