Sha256: a6e22113d39b6144484b57de8090fcd63523b83bd04d4bcd92e979a750a36234

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

require 'lino'
require_relative 'base'

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

        builder
            .with_subcommand('refresh') 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
              sub = sub.with_option('-state', state) if state
              sub = sub.with_option('-input', input) if input
              sub = sub.with_option('-target', target) if target
              sub = sub.with_flag('-no-color') if no_color
              sub
            end
            .with_argument(directory)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-terraform-0.12.1 lib/ruby_terraform/commands/refresh.rb
ruby-terraform-0.12.0 lib/ruby_terraform/commands/refresh.rb
ruby-terraform-0.11.2 lib/ruby_terraform/commands/refresh.rb