Class: Roebe::Shell::Todo
- Defined in:
- lib/roebe/shell/standalone_classes/todo.rb
Constant Summary collapse
- FINISH_WITH_THIS_STRING =
#
FINISH_WITH_THIS_STRING
#
'q'
- BASE_DIR =
#
BASE_DIR
#
'/home/x/data/personal/todo/'
Instance Method Summary collapse
-
#find_out_to_which_todo_we_should_add(base_dir = BASE_DIR) ⇒ Object
# === find_out_to_which_todo_we_should_add ========================================================================= #.
-
#get_normal_user_input ⇒ Object
# === get_user_input.
-
#initialize(run_already = true) ⇒ Todo
constructor
# === initialize ========================================================================= #.
-
#reset ⇒ Object
# === reset ========================================================================= #.
-
#run ⇒ Object
# === run ========================================================================= #.
Constructor Details
Instance Method Details
#find_out_to_which_todo_we_should_add(base_dir = BASE_DIR) ⇒ Object
#
find_out_to_which_todo_we_should_add
#
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/roebe/shell/standalone_classes/todo.rb', line 59 def find_out_to_which_todo_we_should_add( base_dir = BASE_DIR ) @array_available_todos = Dir["#{base_dir}*"] cliner { e 'To which Todo-file should we append?' } @array_available_todos.each_with_index { |content, index| content = ": #{content}" index = ('%4s' % index) e ::Colours.simp(index)+content } end |
#get_normal_user_input ⇒ Object
#
get_user_input
This method fetches the user input.
#
78 79 80 81 82 83 84 |
# File 'lib/roebe/shell/standalone_classes/todo.rb', line 78 def get_normal_user_input loop { input = $stdin.gets @complete_user_input << input break if input.chomp.downcase == 'q' } end |
#reset ⇒ Object
#
reset
#
49 50 51 52 53 54 |
# File 'lib/roebe/shell/standalone_classes/todo.rb', line 49 def reset # ======================================================================= # # === @complete_user_input # ======================================================================= # @complete_user_input = ''.dup end |
#run ⇒ Object
#
run
#
89 90 91 92 93 94 |
# File 'lib/roebe/shell/standalone_classes/todo.rb', line 89 def run e "Enter what we should append next (Finish with "\ "#{FINISH_WITH_THIS_STRING}):" get_normal_user_input find_out_to_which_todo_we_should_add end |