Sha256: f5daf31b3961ca14880c4b45d60281094e7cd7de6b21884efac268ee0ba0b5c4

Contents?: true

Size: 762 Bytes

Versions: 16

Compression:

Stored size: 762 Bytes

Contents

# frozen_string_literal: true

module RubyTerraform
  class Output
    class << self
      def for(parameters)
        Dir.chdir(create_config_directory(parameters)) do
          RubyTerraform.init(backend_config: parameters[:backend_config])
          RubyTerraform.output(name: parameters[:name])
        end
      end

      private

      def create_config_directory(parameters)
        source_directory = parameters[:source_directory]
        work_directory = parameters[:work_directory]

        configuration_directory = File.join(work_directory, source_directory)
        FileUtils.mkdir_p File.dirname(configuration_directory)
        FileUtils.cp_r source_directory, configuration_directory

        configuration_directory
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby-terraform-1.3.0.pre.1 lib/ruby_terraform/output.rb
ruby-terraform-1.2.0 lib/ruby_terraform/output.rb
ruby-terraform-1.2.0.pre.3 lib/ruby_terraform/output.rb
ruby-terraform-1.2.0.pre.2 lib/ruby_terraform/output.rb
ruby-terraform-1.2.0.pre.1 lib/ruby_terraform/output.rb
ruby-terraform-1.1.0 lib/ruby_terraform/output.rb
ruby-terraform-1.1.0.pre.2 lib/ruby_terraform/output.rb
ruby-terraform-1.1.0.pre.1 lib/ruby_terraform/output.rb
ruby-terraform-1.0.0 lib/ruby_terraform/output.rb
ruby-terraform-1.0.0.pre.1 lib/ruby_terraform/output.rb
ruby-terraform-0.65.0.pre.15 lib/ruby_terraform/output.rb
ruby-terraform-0.65.0.pre.14 lib/ruby_terraform/output.rb
ruby-terraform-0.65.0.pre.13 lib/ruby_terraform/output.rb
ruby-terraform-0.65.0.pre.12 lib/ruby_terraform/output.rb
ruby-terraform-0.65.0.pre.11 lib/ruby_terraform/output.rb
ruby-terraform-0.65.0.pre.10 lib/ruby_terraform/output.rb