Kaynağa Gözat

Move config file in own directory

master
aeris 5 yıl önce
ebeveyn
işleme
51904f3808
  1. 5
      lib/cross-post/config.rb

5
lib/cross-post/config.rb

@ -2,8 +2,11 @@ require 'yaml'
class CrossPost
class Config
DEFAULT_CONFIG = File.join Dir.home, '.config/cross-post/config.yml'
def initialize
@file = ENV.fetch 'CROSS_POST_CONFIG', File.join(Dir.home, '.cross-post.yml')
@file = ENV.fetch 'CROSS_POST_CONFIG', DEFAULT_CONFIG
raise 'Unable to find config file' unless File.readable? @file
File.open(@file) { |f| @config = YAML.safe_load f }
end

Yükleniyor…
İptal
Kaydet