Sha256: 16e74a1798061bbd3bde067d5f8be0024d4734b50a595c2629d6ed81b10cfb19

Contents?: true

Size: 563 Bytes

Versions: 17

Compression:

Stored size: 563 Bytes

Contents

require_relative 'status_lines'

module RubyGPG2
  class StatusLine
    TYPE_REGEX = /^\[GNUPG:\] (.*?)(\s|$)/

    TYPES = {
        "IMPORT_OK" => StatusLines::ImportOK,
        "IMPORT_PROBLEM" => StatusLines::ImportProblem,
        "IMPORTED" => StatusLines::Imported,
        "KEY_CREATED" => StatusLines::KeyCreated,
        "KEY_CONSIDERED" => StatusLines::KeyConsidered
    }

    def self.parse(line)
      TYPES
          .fetch(
              line.match(TYPE_REGEX)[1],
              StatusLines::Unimplemented)
          .parse(line)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ruby_gpg2-0.9.0.pre.6 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.9.0.pre.5 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.9.0.pre.4 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.9.0.pre.3 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.9.0.pre.2 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.9.0.pre.1 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.8.0 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.7.0.pre.1 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.6.0 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.5.0.pre.1 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.4.0 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.3.0.pre.2 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.3.0.pre.1 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.2.0 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.1.0.pre.27 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.1.0.pre.26 lib/ruby_gpg2/status_line.rb
ruby_gpg2-0.1.0.pre.25 lib/ruby_gpg2/status_line.rb