File: version_part.rb

package info (click to toggle)
ruby-mail-gpg 0.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 328 kB
  • sloc: ruby: 2,289; makefile: 6
file content (22 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'mail/part'

module Mail
  module Gpg
    class VersionPart < Mail::Part
      VERSION_1 = 'Version: 1'
      CONTENT_TYPE = 'application/pgp-encrypted'
      CONTENT_DESC = 'PGP/MIME Versions Identification'
    
      def initialize(*args)
        super
        body VERSION_1
        content_type CONTENT_TYPE
        content_description CONTENT_DESC
      end
      
      def self.isVersionPart?(part)
        part.mime_type == CONTENT_TYPE && part.body =~ /#{VERSION_1}/
      end
    end
  end
end