Sha256: fc92f99ff9115897390affdc98715d62f1b15206dce642bd950df7cbdc067812

Contents?: true

Size: 809 Bytes

Versions: 3

Compression:

Stored size: 809 Bytes

Contents

module Ruby
  module Terraform
    class Configuration
      attr_accessor :terraform_version
      attr_accessor :download_path
      attr_accessor :binary

      def initialize(opts = {})
        @terraform_version = opts[:terraform_version]
        @download_path = opts[:download_path]
        @binary = opts[:terraform_binary]
      end

      def terraform_version
        @terraform_version ||= Ruby::Terraform::TERRAFORM_VERSION
      end

      def download_path
        @download_path ||= File.expand_path("~/.terraform-bin/#{terraform_version}")
      end

      def binary
        if @binary
          @binary
        elsif OS.windows?
          @binary ||= "#{@download_path}/terraform.exe"
        else
          @binary ||= "#{@download_path}/terraform"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rake-terraform-wrapper-0.3.3 lib/ruby/terraform/configuration.rb
rake-terraform-wrapper-0.3.2 lib/ruby/terraform/configuration.rb
rake-terraform-wrapper-0.3.1 lib/ruby/terraform/configuration.rb