Sha256: 37384cfe2545cbced77e13cbed9965f522709ba2b94b9117f371d296602e0ac0

Contents?: true

Size: 446 Bytes

Versions: 65

Compression:

Stored size: 446 Bytes

Contents

module Mail
  # Extends each field parser with utility methods.
  module ParserTools #:nodoc:
    # Slice bytes from ASCII-8BIT data and mark as UTF-8.
    if 'string'.respond_to?(:force_encoding)
      def chars(data, from_bytes, to_bytes)
        data.slice(from_bytes..to_bytes).force_encoding(Encoding::UTF_8)
      end
    else
      def chars(data, from_bytes, to_bytes)
        data.slice(from_bytes..to_bytes)
      end
    end
  end
end

Version data entries

65 entries across 50 versions & 14 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/parser_tools.rb
tdiary-5.1.2 vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/parser_tools.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/parser_tools.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/parser_tools.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/mail-2.7.1/lib/mail/parser_tools.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/mail-2.7.1/lib/mail/parser_tools.rb
tdiary-5.1.0 vendor/bundle/gems/mail-2.7.1/lib/mail/parser_tools.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/mail-2.7.1/lib/mail/parser_tools.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/mail-2.7.1/lib/mail/parser_tools.rb
spiral_form-0.1.1 vendor/bundle/gems/mail-2.7.1/lib/mail/parser_tools.rb
spiral_form-0.1.0 vendor/bundle/gems/mail-2.7.1/lib/mail/parser_tools.rb
tdiary-5.0.13 vendor/bundle/gems/mail-2.7.1/lib/mail/parser_tools.rb
tdiary-5.0.12.1 vendor/bundle/gems/mail-2.7.1/lib/mail/parser_tools.rb
tdiary-5.0.11 vendor/bundle/gems/mail-2.7.0/lib/mail/parser_tools.rb
tdiary-5.0.11 vendor/bundle/gems/mail-2.7.1/lib/mail/parser_tools.rb
mail-2.7.1 lib/mail/parser_tools.rb
tdiary-5.0.9 vendor/bundle/gems/mail-2.7.0/lib/mail/parser_tools.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/mail-2.7.0/lib/mail/parser_tools.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/mail-2.7.0/lib/mail/parser_tools.rb
tdiary-5.0.8 vendor/bundle/gems/mail-2.7.0/lib/mail/parser_tools.rb