module Tot::Config
Public Class Methods
create()
click to toggle source
# File lib/tot.rb, line 20 def create path = Readline.readline("Input the path to save tasks >> ",false) path += ".yaml" unless [".yaml",".yml"].include?(File.extname(path)) File.open(@@CONFIG_FILE,'w'){|file| YAML.dump({'todo_file' => path}, file)} end
todo_path()
click to toggle source
# File lib/tot.rb, line 15 def todo_path create unless File.exists?(@@CONFIG_FILE) @@TODO_PATH = YAML.load_file(@@CONFIG_FILE)['todo_file'] end
Private Instance Methods
create()
click to toggle source
# File lib/tot.rb, line 20 def create path = Readline.readline("Input the path to save tasks >> ",false) path += ".yaml" unless [".yaml",".yml"].include?(File.extname(path)) File.open(@@CONFIG_FILE,'w'){|file| YAML.dump({'todo_file' => path}, file)} end
todo_path()
click to toggle source
# File lib/tot.rb, line 15 def todo_path create unless File.exists?(@@CONFIG_FILE) @@TODO_PATH = YAML.load_file(@@CONFIG_FILE)['todo_file'] end