Sha256: 9430b70eb836afdf7c5284a618dfd5f36267d4c69e85f3eeea60bb670994c47a

Contents?: true

Size: 1.01 KB

Versions: 6

Compression:

Stored size: 1.01 KB

Contents

require 'ruby_gpg2/version'
require 'ruby_gpg2/commands'
require 'ruby_gpg2/parameter_file_contents'
require 'ruby_gpg2/colon_output'
require 'ruby_gpg2/key'
require 'ruby_gpg2/user_id'

module RubyGPG2
  class << self
    attr_writer :configuration

    def configuration
      @configuration ||= Configuration.new
    end

    def configure
      yield(configuration)
    end

    def reset!
      @configuration = nil
    end
  end

  module ClassMethods
    def generate_key(opts = {})
      Commands::GenerateKey.new.execute(opts)
    end

    def list_public_keys(opts = {})
      Commands::ListPublicKeys.new.execute(opts)
    end

    def list_secret_keys(opts = {})
      Commands::ListSecretKeys.new.execute(opts)
    end
  end

  extend ClassMethods

  def self.included(other)
    other.extend(ClassMethods)
  end

  class Configuration
    attr_accessor :binary, :logger, :stdin, :stdout, :stderr

    def initialize
      @binary = 'gpg'
      @stdin = ''
      @stdout = $stdout
      @stderr = $stderr
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby_gpg2-0.1.0.pre.14 lib/ruby_gpg2.rb
ruby_gpg2-0.1.0.pre.13 lib/ruby_gpg2.rb
ruby_gpg2-0.1.0.pre.12 lib/ruby_gpg2.rb
ruby_gpg2-0.1.0.pre.11 lib/ruby_gpg2.rb
ruby_gpg2-0.1.0.pre.10 lib/ruby_gpg2.rb
ruby_gpg2-0.1.0.pre.9 lib/ruby_gpg2.rb