Sha256: 25cd0f02d9c88188f15d3f352a1fe9edb5c2d688ad123c26b591193b40cda458

Contents?: true

Size: 574 Bytes

Versions: 18

Compression:

Stored size: 574 Bytes

Contents

require 'logger'

module Stackster
  class Config

    def initialize(args = {})
      @config = load_config_file args[:config]
      @logger = args[:logger] ||= StacksterLogger.new
    end

    def access_key
      @config['access_key']
    end

    def secret_key
      @config['secret_key']
    end

    def region
      @config['region']
    end

    def logger
      @logger
    end

    private

    def load_config_file(config = nil)
      config_file = "#{ENV['HOME']}/.stackster.yml"
      config ? config : (YAML::load File.open( config_file ))
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
stackster-0.4.4 lib/stackster/config.rb
stackster-0.4.3 lib/stackster/config.rb
stackster-0.4.2 lib/stackster/config.rb
stackster-0.4.1 lib/stackster/config.rb
stackster-0.4.0 lib/stackster/config.rb
stackster-0.3.2 lib/stackster/config.rb
stackster-0.3.1 lib/stackster/config.rb
stackster-0.3.0 lib/stackster/config.rb
stackster-0.2.9 lib/stackster/config.rb
stackster-0.2.8 lib/stackster/config.rb
stackster-0.2.7 lib/stackster/config.rb
stackster-0.2.6 lib/stackster/config.rb
stackster-0.2.5 lib/stackster/config.rb
stackster-0.2.4 lib/stackster/config.rb
stackster-0.2.3 lib/stackster/config.rb
stackster-0.2.2 lib/stackster/config.rb
stackster-0.2.1 lib/stackster/config.rb
stackster-0.2.0 lib/stackster/config.rb