Sha256: 69a6f0511785abf73ed78756a1492dea5dd0e7fbdbe8cf6db8bdf70b08d7bd08

Contents?: true

Size: 843 Bytes

Versions: 11

Compression:

Stored size: 843 Bytes

Contents

require 'lino'
require 'stringio'
require_relative 'base'

module RubyTerraform
  module Commands
    class Output < Base
      def stdout
        @stdout ||= StringIO.new
      end

      def configure_command(builder, opts)
        name = opts[:name]
        state = opts[:state]
        no_color = opts[:no_color]
        mod = opts[:module]

        builder = builder
            .with_subcommand('output') do |sub|
              sub = sub.with_flag('-no-color') if no_color
              sub = sub.with_option('-state', state) if state
              sub = sub.with_option('-module', mod) if mod
              sub
            end
        builder = builder.with_argument(name) if name
        builder
      end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ruby-terraform-0.27.0.pre.pre.2 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.27.0.pre.pre.1 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.26.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.25.0.pre.pre.1 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.24.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.23.0.pre.pre.1 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.22.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.21.0.pre.pre.2 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.21.0.pre.pre.1 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.20.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.19.0.pre.pre.5 lib/ruby_terraform/commands/output.rb