class Confile

Public Class Methods

new(config_file) click to toggle source
# File lib/confile.rb, line 5
def initialize(config_file)
  if (File.exist?(config_file))
    @confile_exists = true

    conf = YAML.load_file(config_file)

    @config_dir = conf['config_dir'] || 'config'
    @links = {}
    @files = []

    conf['links'].each do |link|
      link.each_pair do |from, to|
        @links[File.join(@config_dir, from)] = to
        @files.push(to)
      end
    end
  end
end

Public Instance Methods

check_confile() click to toggle source
# File lib/confile.rb, line 24
def check_confile
  if (!@confile_exists)
    puts "nothing to link! please create a Confile."
    exit 1
  end
end