Sha256: 942b1e5b9c1c92422788fe048756432f6ef0dac69ffc78088dc82abc96f3e031

Contents?: true

Size: 471 Bytes

Versions: 19

Compression:

Stored size: 471 Bytes

Contents

require 'yaml'

module Stash
  class Config
    def initialize(config_file = "#{ENV['HOME']}/.stashconfig.yml")
      @config_file = config_file

      fail "#{@config_file} does not exist" unless File.exist?(@config_file)
    end

    def host
      config['stash_url']
    end

    def user
      config['username']
    end

    def password
      config['password']
    end

    private

    def config
      @config ||= YAML.load_file(@config_file)
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
face_control-0.8.6 lib/stash/config.rb
face_control-0.9.0 lib/stash/config.rb
face_control-0.8.5 lib/stash/config.rb
face_control-0.8.4 lib/stash/config.rb
face_control-0.8.3 lib/stash/config.rb
face_control-0.8.2 lib/stash/config.rb
face_control-0.8.1 lib/stash/config.rb
face_control-0.8.0 lib/stash/config.rb
face_control-0.7.0 lib/stash/config.rb
face_control-0.6.0 lib/stash/config.rb
face_control-0.5.1 lib/stash/config.rb
face_control-0.5.0 lib/stash/config.rb
face_control-0.4.0 lib/stash/config.rb
face_control-0.3.0 lib/stash/config.rb
face_control-0.2.1 lib/stash/config.rb
stash_pull_request_commenter-0.2.1 lib/stash/config.rb
stash_pull_request_commenter-0.2.0 lib/stash/config.rb
stash_pull_request_commenter-0.0.2 lib/stash/config.rb
stash_pull_request_commenter-0.0.1 lib/stash/config.rb