Sha256: b928cc96cde361bcb9fc39c45d28bcdf86e79cb4dc2165a8a25482b645cf6253

Contents?: true

Size: 527 Bytes

Versions: 11

Compression:

Stored size: 527 Bytes

Contents

module Terraspace::Compiler
  module CommandsConcern
    def requires_backend?
      command_is?(requires_backend_commands)
    end

    def requires_backend_commands
      %w[down init output plan providers refresh show up validate]
    end

    def command_is?(*commands)
      commands.flatten!
      commands.map!(&:to_s)
      commands.include?(Terraspace.argv[0]) ||                  # IE: terraspace up
      Terraspace.argv[0] == "all" && commands.include?(Terraspace.argv[1]) # IE: terraspace all up
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
terraspace-0.6.23 lib/terraspace/compiler/commands_concern.rb
terraspace-0.6.22 lib/terraspace/compiler/commands_concern.rb
terraspace-0.6.21 lib/terraspace/compiler/commands_concern.rb
terraspace-0.6.20 lib/terraspace/compiler/commands_concern.rb
terraspace-0.6.19 lib/terraspace/compiler/commands_concern.rb
terraspace-0.6.18 lib/terraspace/compiler/commands_concern.rb
terraspace-0.6.17 lib/terraspace/compiler/commands_concern.rb
terraspace-0.6.16 lib/terraspace/compiler/commands_concern.rb
terraspace-0.6.15 lib/terraspace/compiler/commands_concern.rb
terraspace-0.6.13 lib/terraspace/compiler/commands_concern.rb
terraspace-0.6.12 lib/terraspace/compiler/commands_concern.rb