class Stash::Config

Public Class Methods

new(config_file = " click to toggle source
# File lib/stash/config.rb, line 5
def initialize(config_file = "#{ENV['HOME']}/.stashconfig.yml")
  @config_file = config_file

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

Public Instance Methods

host() click to toggle source
# File lib/stash/config.rb, line 11
def host
  config['stash_url']
end
password() click to toggle source
# File lib/stash/config.rb, line 19
def password
  config['password']
end
user() click to toggle source
# File lib/stash/config.rb, line 15
def user
  config['username']
end

Private Instance Methods

config() click to toggle source
# File lib/stash/config.rb, line 25
def config
  @config ||= YAML.load_file(@config_file)
end