Sha256: 45a3bc3832c2fa74da5c42af5c1e61064d042456373ab327f7fbe9a388a64830

Contents?: true

Size: 1.2 KB

Versions: 35

Compression:

Stored size: 1.2 KB

Contents

require 'lino'
require_relative 'base'

module RubyTerraform
  module Commands
    class Plan < Base
      def configure_command(builder, opts)
        directory = opts[:directory]
        vars = opts[:vars] || {}
        var_file = opts[:var_file]
        var_files = opts[:var_files] || []
        state = opts[:state]
        plan = opts[:plan]
        input = opts[:input]
        destroy = opts[:destroy]
        no_color = opts[:no_color]

        builder
            .with_subcommand('plan') do |sub|
              vars.each do |key, value|
                sub = sub.with_option('-var', "'#{key}=#{value}'", separator: ' ')
              end
              sub = sub.with_option('-var-file', var_file) if var_file
              var_files.each do |file|
                sub = sub.with_option('-var-file', file)
              end
              sub = sub.with_option('-state', state) if state
              sub = sub.with_option('-out', plan) if plan
              sub = sub.with_option('-input', input) if input
              sub = sub.with_flag('-destroy') if destroy
              sub = sub.with_flag('-no-color') if no_color
              sub
            end
            .with_argument(directory)
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
ruby-terraform-0.27.0.pre.pre.2 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.27.0.pre.pre.1 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.26.0 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.25.0.pre.pre.1 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.24.0 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.23.0.pre.pre.1 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.22.0 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.21.0.pre.pre.2 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.21.0.pre.pre.1 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.20.0 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.19.0.pre.pre.5 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.19.0.pre.pre.4 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.18.0 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.17.0.pre.pre.1 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.16.0 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.15.1.pre.1 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.15.1.pre2 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.15.1.pre1 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.15.0 lib/ruby_terraform/commands/plan.rb
ruby-terraform-0.14.1.pre1 lib/ruby_terraform/commands/plan.rb