class TryRb::Config
Public Instance Methods
data()
click to toggle source
# File lib/tryrb/config.rb, line 13 def data @data ||= load_file end
expanded_rc_path()
click to toggle source
# File lib/tryrb/config.rb, line 25 def expanded_rc_path File.expand_path('~/.tryrbrc') end
expanded_tmp_dir()
click to toggle source
# File lib/tryrb/config.rb, line 29 def expanded_tmp_dir File.expand_path(tmp_dir) end
load_file()
click to toggle source
# File lib/tryrb/config.rb, line 17 def load_file require 'yaml' YAML.load_file(expanded_rc_path) rescue Errno::ENOENT print_red("Please run `tryrb config` to configure.") abort end
Private Instance Methods
print_red(str)
click to toggle source
# File lib/tryrb/config.rb, line 34 def print_red(str) puts "\e[31m#{str}\e[0m" end