Sha256: 49f04ea97257d95b2f5515f3eb9aa3b4cc7a2cea84f74928ba4be3d03733635a

Contents?: true

Size: 1.14 KB

Versions: 19

Compression:

Stored size: 1.14 KB

Contents

require 'lino'
require_relative 'base'

module RubyTerraform
  module Commands
    class Validate < 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]
        check_variables = opts[:check_variables]
        no_color = opts[:no_color]

        builder
            .with_subcommand('validate') 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('-check-variables', check_variables) unless
                  check_variables.nil?
              sub = sub.with_flag('-no-color') if no_color
              sub
            end
            .with_argument(directory)
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ruby-terraform-0.42.0 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.41.0.pre.pre.1 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.40.0 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.39.0.pre.pre.2 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.39.0.pre.pre.1 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.38.0 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.37.0.pre.pre.1 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.36.0 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.35.0.pre.pre.2 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.35.0.pre.pre.1 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.34.0 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.33.0.pre.pre.1 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.32.0 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.31.0.pre.pre.3 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.31.0.pre.pre.2 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.31.0.pre.pre.1 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.30.0 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.29.0.pre.pre.2 lib/ruby_terraform/commands/validate.rb
ruby-terraform-0.29.0.pre.pre.1 lib/ruby_terraform/commands/validate.rb