Sha256: 8fe7940f4546baee40e69f6e2c0f2b0bad700a09e2ffdffbe5e679ad6b3bbe30

Contents?: true

Size: 567 Bytes

Versions: 3

Compression:

Stored size: 567 Bytes

Contents

require 'contracts'
require 'settingslogic'
require 'terminal-announce'

require_relative 'interactive_setup'

# Singleton for loading configs from common paths.
class Settings < Settingslogic
  include InteractiveSetup

  config_paths = %w(/etc /usr/local/etc ~/.config .)

  config_paths.each do |config_path|
    config_file = File.expand_path "#{ config_path }/git-ready.yaml"
    source config_file if File.exist? config_file
  end

  load!
rescue Errno::ENOENT
  Announce.warning "Unable to find a configuration in #{config_paths}"
  InteractiveSetup.start
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
git-ready-0.8.2 lib/git-ready/settings.rb
git-ready-0.8.1 lib/git-ready/settings.rb
git-ready-0.8.0 lib/git-ready/settings.rb