### Home Classes Methods

### In Files

- lib/vmail/string_ext.rb

### Parent

Object

### Methods

- ::shellescape
- #col
- #rcol

### Class/Module Index

Quicksearch

- Vmail
- Vmail::AddressQuoter
- Vmail::ContactsExtractor
- Vmail::ImapClient
- Vmail::MessageFormatter
- Vmail::Options
- Vmail::Query
- Vmail::ReplyTemplate
- Vmail::SendOptions
- Vmail::Sender
- String

No matching classes.

# String

### Public Class Methods

shellescape(str) click to toggle source

    # File lib/vmail/string_ext.rb, line 10
    def self.shellescape(str)
      # An empty argument will be skipped, so return empty quotes.
      return "''" if str.empty?

      str = str.dup

      # Process as a single byte sequence because not all shell
      # implementations are multibyte aware.
      str.gsub!(/([^A-Za-z0-9_\-.,:\/@\n])/, "\\\\\\1")

      # A LF cannot be escaped with a backslash because a backslash + LF
      # combo is regarded as line continuation and simply ignored.
      str.gsub!(/\n/, "'\n'")

      return str
    end

### Public Instance Methods

col(width) click to toggle source

    # File lib/vmail/string_ext.rb, line 2
    def col(width)
      self[0,width].ljust(width)
    end

rcol(width) click to toggle source

    # File lib/vmail/string_ext.rb, line 6
    def rcol(width) #right justified
      self[0,width].rjust(width)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.