Module: Tot::Config
- Defined in:
- lib/tot.rb
Overview
{{{
Constant Summary collapse
- @@CONFIG_FILE =
File.join(ENV['HOME'],'.totrc')
- @@TODO_PATH =
nil
Class Method Summary collapse
Class Method Details
.create ⇒ Object
19 20 21 22 23 |
# File 'lib/tot.rb', line 19 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 ⇒ Object
14 15 16 17 |
# File 'lib/tot.rb', line 14 def todo_path create unless File.exists?(@@CONFIG_FILE) @@TODO_PATH = YAML.load_file(@@CONFIG_FILE)['todo_file'] end |