Sha256: 700532691829b449d469e33f6aa511b35a04963d4a643b8a587f0cb789e8c906

Contents?: true

Size: 691 Bytes

Versions: 2

Compression:

Stored size: 691 Bytes

Contents

module SecretsCli
  module Vault
    class Base
      include SecretsCli::Helpers

      attr_reader :options

      def initialize(options)
        @options = options
      end

      def call
        print_verbose(command) if config.verbose
        Open3.popen2e(command) do |_stdin, stdout_and_stderr, wait_thr|
          if wait_thr.value.success?
            prompt.ok(stdout_and_stderr.read)
          else
            error(stdout_and_stderr.read)
          end
        end
      end

      private

      def command
        fail NotImplementedError
      end

      def secrets_full_storage_key
        File.join(secrets_storage_key, config.environment)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
secrets_cli-0.4.0 lib/secrets_cli/vault/base.rb
secrets_cli-0.3.1 lib/secrets_cli/vault/base.rb