intent 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/intent/todo/manager.rb +30 -1
- data/lib/intent/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: f353e097a26f39c82cd428423bc55d09a37f50c2
|
4
|
+
data.tar.gz: be95e6188c4aa23904dbde5d1758691d408a4731
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96f1e11b4ddca230d4d090bc25de25c89f577190857dc3186fdb46046194c5031f3a5a4d0e91e0d35da4be9458f2bd50903baca1dd3b6945f47384af9c3c0502
|
7
|
+
data.tar.gz: 734227618e3d75cf7fa7191efabbc6612acdeddca81f8697190e697d66d7fcbd2ee6eff08f721a286e707d62ba7eb12bdb409dde82be8705e4e3ebb7a2b50b27
|
data/lib/intent/todo/manager.rb
CHANGED
@@ -44,6 +44,33 @@ module Intent
|
|
44
44
|
puts "No tasks found."
|
45
45
|
end
|
46
46
|
end
|
47
|
+
when :archive
|
48
|
+
archive_path = File.dirname(ENV['TODO_TXT'])
|
49
|
+
done_file = "#{archive_path}/__done__.txt"
|
50
|
+
todo_file = "#{archive_path}/__todo__.txt"
|
51
|
+
|
52
|
+
unless File.exists?(done_file)
|
53
|
+
puts "Creating new `done.txt` in #{archive_path}."
|
54
|
+
File.write(done_file, "")
|
55
|
+
end
|
56
|
+
|
57
|
+
done_list = ::Todo::List.new(done_file)
|
58
|
+
|
59
|
+
list.by_done.each do |task|
|
60
|
+
done_list.push(task)
|
61
|
+
end
|
62
|
+
|
63
|
+
File.open(done_file, "w") do |file|
|
64
|
+
done_list.sort!.by_done.each do |task|
|
65
|
+
file.puts(task)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
File.open(todo_file, "w") do |file|
|
70
|
+
list.by_not_done.each do |task|
|
71
|
+
file.puts(task)
|
72
|
+
end
|
73
|
+
end
|
47
74
|
end
|
48
75
|
end
|
49
76
|
end
|
@@ -53,7 +80,9 @@ module Intent
|
|
53
80
|
puts
|
54
81
|
puts "A set of tasks for managing a plain text todo list."
|
55
82
|
puts
|
56
|
-
puts "todo list
|
83
|
+
puts "todo list - list all items in the list"
|
84
|
+
puts "todo focus - find focus by randomly selecting a task"
|
85
|
+
puts "todo archive - archive completed tasks in the nearest `done.txt`"
|
57
86
|
end
|
58
87
|
end
|
59
88
|
end
|
data/lib/intent/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rickerby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: todo-txt
|