Sha256: c6cf77672e5189b615d1e5d8f105fd422841447342a0c4d4828d66f77d4f2b0a

Contents?: true

Size: 691 Bytes

Versions: 1

Compression:

Stored size: 691 Bytes

Contents

# frozen_string_literal: true

require 'stringio'
require_relative 'base'

module RubyTerraform
  module Commands
    class Output < Base
      def initialize_command
        return if defined?(@stdout) && @stdout.respond_to?(:string)

        @stdout = StringIO.new
      end

      def options
        %w[
          -json
          -module
          -no-color
          -raw
          -state
        ]
      end

      def subcommands(_parameters)
        %w[output]
      end

      def arguments(parameters)
        [parameters[:name]]
      end

      def do_after(parameters)
        result = stdout.string
        parameters[:name] ? result.chomp : result
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-terraform-0.65.0.pre.9 lib/ruby_terraform/commands/output.rb