todoreo 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/todoreo/todoitem.rb +1 -1
- data/lib/todoreo/todolist.rb +26 -10
- data/lib/todoreo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4487ea2463bca1bc7fa139ccfde5d8ec5e7e3baf
|
4
|
+
data.tar.gz: cdc1baeb0b7332d8db9fc09050262e8375070abd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce08cfccb9f57c4a31d73aade1327d84454e6c63db95fd128c3e1387c5583ab4881bc83d83373fe696b7810f14014de8555eea9b775c2ea18903df6196711980
|
7
|
+
data.tar.gz: 4d1eb099679e7cb080a40b119b5ed07e654ca9622d7467bab5528f43ffb7b368804aec2adab6b3208a905f7be844acd8539568b4d151c53bf41fe9c27cb3b39c
|
data/lib/todoreo/todoitem.rb
CHANGED
data/lib/todoreo/todolist.rb
CHANGED
@@ -1,7 +1,22 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
1
3
|
module Todoreo
|
2
4
|
class TodoList
|
3
5
|
def initialize
|
4
6
|
@todoItems = []
|
7
|
+
open()
|
8
|
+
end
|
9
|
+
|
10
|
+
def open
|
11
|
+
if File.exist?("todoreo.yml")
|
12
|
+
@todoItems = YAML.load_file("todoreo.yml")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def save
|
17
|
+
File.open("todoreo.yml", "w") do |file|
|
18
|
+
file.write(@todoItems.to_yaml)
|
19
|
+
end
|
5
20
|
end
|
6
21
|
|
7
22
|
def run_program
|
@@ -24,6 +39,7 @@ module Todoreo
|
|
24
39
|
input = gets.chomp
|
25
40
|
edit_specific_todo(input)
|
26
41
|
when 'exit'
|
42
|
+
save()
|
27
43
|
break
|
28
44
|
when '--help', '-help', '-h', 'help'
|
29
45
|
get_help
|
@@ -39,8 +55,8 @@ module Todoreo
|
|
39
55
|
newTodoItem.todo = gets.chomp
|
40
56
|
print "How many days do you need to complete it: "
|
41
57
|
newTodoItem.days = gets.chomp
|
42
|
-
print "At what time of the day should it be complete (example: 12:45): "
|
43
|
-
newTodoItem.time = gets.chomp
|
58
|
+
#print "At what time of the day should it be complete (example: 12:45): "
|
59
|
+
#newTodoItem.time = gets.chomp
|
44
60
|
@todoItems.push(newTodoItem)
|
45
61
|
|
46
62
|
puts newTodoItem
|
@@ -61,10 +77,10 @@ module Todoreo
|
|
61
77
|
time_until_due_date = item.time_created + (60 * 60 * 24 * item.days.to_i)
|
62
78
|
|
63
79
|
todo_due_date = time_until_due_date.strftime("%Y-%m-%d")
|
64
|
-
time_of_the_day = item.time
|
80
|
+
#time_of_the_day = item.time
|
65
81
|
|
66
82
|
if Time.now < time_until_due_date
|
67
|
-
puts "[#{todoCounter}] #{item.todo} - Due at #{todo_due_date}
|
83
|
+
puts "[#{todoCounter}] #{item.todo} - Due at #{todo_due_date}"#on # { time_of_the_day }
|
68
84
|
else
|
69
85
|
puts "[#{todoCounter}] #{item.todo} - Due date overlapped (Type 'dot' to delete all overlapped todos )"
|
70
86
|
end
|
@@ -105,7 +121,7 @@ module Todoreo
|
|
105
121
|
puts "What do you want to edit?"
|
106
122
|
puts "'todo' to edit the todo content"
|
107
123
|
puts "'days' to edit the days you have left"
|
108
|
-
puts "'time' to edit the specific time you have to complete it"
|
124
|
+
#puts "'time' to edit the specific time you have to complete it"
|
109
125
|
loop do
|
110
126
|
decision = gets.chomp
|
111
127
|
case decision
|
@@ -119,11 +135,11 @@ module Todoreo
|
|
119
135
|
new_version = gets.chomp
|
120
136
|
item.days = new_version
|
121
137
|
break
|
122
|
-
when 'time'
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
138
|
+
# when 'time'
|
139
|
+
# print "What should the new time be?: "
|
140
|
+
# new_version = gets.chomp
|
141
|
+
# item.time = new_version
|
142
|
+
# break
|
127
143
|
end
|
128
144
|
end
|
129
145
|
puts "Successfully updated the todo with id of [#{id}]"
|
data/lib/todoreo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: todoreo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LudvigSoerensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|