Sha256: 912a75291a8e35442ebe02b30d8893547bd3596cb4e18e2a47fa53be045dd0ed

Contents?: true

Size: 736 Bytes

Versions: 12

Compression:

Stored size: 736 Bytes

Contents

require 'lino'
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]

        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
            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

12 entries across 12 versions & 1 rubygems

Version Path
ruby-terraform-0.11.2 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.11.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.10.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.9.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.8.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.7.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.6.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.5.1 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.5.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.4.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.3.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.2.0 lib/ruby_terraform/commands/output.rb