Sha256: 94b85b2a882b6796ac10be0576acab97b323e12f740e88ab4ed6771a3c36468d

Contents?: true

Size: 970 Bytes

Versions: 4

Compression:

Stored size: 970 Bytes

Contents

# frozen_string_literal: true

require_relative 'base'
require_relative '../options/common'

module RubyTerraform
  module Commands
    class Apply < Base
      include RubyTerraform::Options::Common

      def subcommands
        %w[apply]
      end

      def options # rubocop:disable Metrics/MethodLength
        %w[
          -backup
          -compact-warnings
          -lock
          -lock-timeout
          -input
          -auto-approve
          -no-color
          -parallelism
          -refresh
          -state
          -state-out
          -target
          -var
          -var-file
        ] + super
      end

      def arguments(parameters)
        [parameters[:plan] || parameters[:directory]]
      end

      def parameter_defaults(_parameters)
        { vars: {}, var_files: [], targets: [] }
      end

      def parameter_overrides(parameters)
        { backup: parameters[:no_backup] ? '-' : parameters[:backup] }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-terraform-0.65.0.pre.13 lib/ruby_terraform/commands/apply.rb
ruby-terraform-0.65.0.pre.12 lib/ruby_terraform/commands/apply.rb
ruby-terraform-0.65.0.pre.11 lib/ruby_terraform/commands/apply.rb
ruby-terraform-0.65.0.pre.10 lib/ruby_terraform/commands/apply.rb