Sha256: 946ddef9acb965dc961ac5d7f5b143e024d889303238f3122b108183f4aac2e6

Contents?: true

Size: 787 Bytes

Versions: 2

Compression:

Stored size: 787 Bytes

Contents

require_relative 'base'

module RubyTerraform
  module Commands
    class Apply < Base
      def subcommands(_values)
        %w[apply]
      end

      # rubocop:disable Metrics/MethodLength
      def switches
        %w[
          -auto-approve
          -backup
          -input
          -lock
          -lock-timeout
          -no-color
          -state
          -target
          -var
          -var-file
        ]
      end
      # rubocop:enable Metrics/MethodLength

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

      def option_default_values(_opts)
        { vars: {}, var_files: [], targets: [] }
      end

      def option_override_values(opts)
        { backup: opts[:no_backup] ? '-' : opts[:backup] }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-terraform-0.65.0.pre.8 lib/ruby_terraform/commands/apply.rb
ruby-terraform-0.65.0.pre.7 lib/ruby_terraform/commands/apply.rb