Sha256: 44df2726b792972a2e1e897d78dfba175bfb93ee57e691a290236cc2b1545e39

Contents?: true

Size: 756 Bytes

Versions: 26

Compression:

Stored size: 756 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]

        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

26 entries across 26 versions & 1 rubygems

Version Path
ruby-terraform-0.19.0.pre.pre.4 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.18.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.17.0.pre.pre.1 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.16.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.15.1.pre.1 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.15.1.pre2 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.15.1.pre1 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.15.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.14.1.pre1 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.13.2.pre42 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.13.2.pre41 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.13.2.pre40 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.14.0 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.13.2.pre39 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.13.2.pre38 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.13.2.pre37 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.13.2.pre36 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.13.2.pre35 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.13.2.pre34 lib/ruby_terraform/commands/output.rb
ruby-terraform-0.13.2.pre33 lib/ruby_terraform/commands/output.rb