Sha256: c974e5a0dd9ef877f0be1c88c2275622f48fc1987aedc81a119661881cd1b51c

Contents?: true

Size: 519 Bytes

Versions: 90

Compression:

Stored size: 519 Bytes

Contents

# encoding: utf-8
class String #:nodoc:
  def to_crlf
    gsub(/\n|\r\n|\r/) { "\r\n" }
  end

  def to_lf
    gsub(/\n|\r\n|\r/) { "\n" }
  end

  unless method_defined?(:ascii_only?)
    # Provides all strings with the Ruby 1.9 method of .ascii_only? and
    # returns true or false
    US_ASCII_REGEXP = %Q{\x00-\x7f}
    def ascii_only?
      !(self =~ /[^#{US_ASCII_REGEXP}]/)
    end
  end
  
  def not_ascii_only?
    !ascii_only?
  end

  unless method_defined?(:bytesize)
    alias :bytesize :length
  end
end

Version data entries

90 entries across 60 versions & 4 rubygems

Version Path
depengine-0.0.12 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.11 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.11 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.10 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.10 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.9 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.9 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.8 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.8 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.7 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.7 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.5 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.5 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.4 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.4 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.3 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.3 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.2 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.2 etc/isolate/ruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb
depengine-0.0.1 etc/isolate/jruby-1.8/gems/mail-2.2.5/lib/mail/core_extensions/string.rb