Sha256: c1d013c6389159e60f7d53fa35ffa912e5a0d0a2cb51fe553014eb0adb3464d1

Contents?: true

Size: 959 Bytes

Versions: 2

Compression:

Stored size: 959 Bytes

Contents

module Terraspace
  class App
    include Singleton
    include DslEvaluator

    attr_reader :config
    def initialize
      @config = defaults
    end

    def defaults
      config = ActiveSupport::OrderedOptions.new
      config.test_framework = "rspec"
      config.logger = Logger.new($stdout)
      config.logger.level = :info
      config.hooks = Hooks.new
      config.cloud = ActiveSupport::OrderedOptions.new
      config.cloud.overwrite = true
      config.cloud.overwrite_sensitive = true
      config.build = ActiveSupport::OrderedOptions.new
      config.build.cache_root = nil # defaults to .terraspace-cache
      config.build.cache_dir = ":CACHE_ROOT/:REGION/:ENV/:BUILD_DIR"
      config
    end

    def configure
      yield(@config)
    end

    def load_project_config
      evaluate_file("#{Terraspace.root}/config/app.rb")
      path = "#{Terraspace.root}/config/env/#{Terraspace.env}.rb"
      evaluate_file(path)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
terraspace-0.2.1 lib/terraspace/app.rb
terraspace-0.2.0 lib/terraspace/app.rb