Sha256: cfd1d35a98c6e9606bc11026f41ea20640b1fec1a171bf1a197c2e4abba9dee0

Contents?: true

Size: 689 Bytes

Versions: 3

Compression:

Stored size: 689 Bytes

Contents

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

      private

      def create_config_directory(opts)
        source_directory = opts[:source_directory]
        work_directory = opts[: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

3 entries across 3 versions & 1 rubygems

Version Path
ruby-terraform-0.65.0.pre.8 lib/ruby_terraform/output.rb
ruby-terraform-0.65.0.pre.7 lib/ruby_terraform/output.rb
ruby-terraform-0.65.0.pre.6 lib/ruby_terraform/output.rb