Sha256: 51ea94a5c81086dd72143f36b2d3ab31320b1dc30dcb0233f5838675896a5d84

Contents?: true

Size: 1.09 KB

Versions: 30

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true

require_relative 'base'
require_relative '../options/global'

module RubyTerraform
  module Commands
    # Wraps the +terraform workspace list+ command which lists workspaces.
    #
    # For options accepted on construction, see {#initialize}.
    #
    # When executing an instance of {WorkspaceList} via {#execute}, the
    # following options are supported:
    #
    # * +:directory+: the path to a directory containing terraform configuration
    #   (deprecated in terraform 0.14, removed in terraform 0.15, use +:chdir+
    #   instead).
    # * +:chdir+: the path of a working directory to switch to before executing
    #   the given subcommand.
    #
    # @example Basic Invocation
    #   RubyTerraform::Commands::WorkspaceList.new.execute(
    #     directory: 'infra/networking')
    #
    class WorkspaceList < Base
      include RubyTerraform::Options::Global

      # @!visibility private
      def subcommands
        %w[workspace list]
      end

      # @!visibility private
      def arguments(parameters)
        [parameters[:directory]]
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ruby-terraform-1.3.0.pre.1 lib/ruby_terraform/commands/workspace_list.rb
ruby-terraform-1.2.0 lib/ruby_terraform/commands/workspace_list.rb
ruby-terraform-1.2.0.pre.3 lib/ruby_terraform/commands/workspace_list.rb
ruby-terraform-1.2.0.pre.2 lib/ruby_terraform/commands/workspace_list.rb
ruby-terraform-1.2.0.pre.1 lib/ruby_terraform/commands/workspace_list.rb
ruby-terraform-1.1.0 lib/ruby_terraform/commands/workspace_list.rb
ruby-terraform-1.1.0.pre.2 lib/ruby_terraform/commands/workspace_list.rb
ruby-terraform-1.1.0.pre.1 lib/ruby_terraform/commands/workspace_list.rb
ruby-terraform-1.0.0 lib/ruby_terraform/commands/workspace_list.rb
ruby-terraform-1.0.0.pre.1 lib/ruby_terraform/commands/workspace_list.rb