module NotTooLate::Config
Public Class Methods
file()
click to toggle source
# File lib/not_too_late/config.rb, line 16 def file path = `pwd`.chomp! until Dir.exist? File.join(path, '.git') path = File.expand_path('../', path) end File.join(path, '.ntl.yml') end
file_name()
click to toggle source
# File lib/not_too_late/config.rb, line 24 def file_name '.ntl.yml' end
read()
click to toggle source
# File lib/not_too_late/config.rb, line 6 def read YAML.load_file file || {} end
write(configs)
click to toggle source
# File lib/not_too_late/config.rb, line 10 def write(configs) File.open(file, 'w') do |f| f.write configs.to_yaml end end
Private Class Methods
git_dir()
click to toggle source
# File lib/not_too_late/config.rb, line 29 def git_dir "#{`pwd`.chomp!}/.git" end