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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16a9642ce00dbea448a281c037e76b41a55c3b0a
4
- data.tar.gz: e4657181bd6371e3326ebd020dbc4774036b30dd
3
+ metadata.gz: f353e097a26f39c82cd428423bc55d09a37f50c2
4
+ data.tar.gz: be95e6188c4aa23904dbde5d1758691d408a4731
5
5
  SHA512:
6
- metadata.gz: 7e0b994971945b5441c32c80b375b5fdd2b37428d94204b89fba33def7e746c2ea34b6151d60619cbdac5575c635a1e6e7afc91f808ec720ac43da8a366a6460
7
- data.tar.gz: 5edafdbd733a836de342036fc1443438c1aada9587634e7442e8f6a14c64d721a24cfb1fb645d4acb6afcfe9fd52e6bb978597f8af5b3f477596890d456ae0e8
6
+ metadata.gz: 96f1e11b4ddca230d4d090bc25de25c89f577190857dc3186fdb46046194c5031f3a5a4d0e91e0d35da4be9458f2bd50903baca1dd3b6945f47384af9c3c0502
7
+ data.tar.gz: 734227618e3d75cf7fa7191efabbc6612acdeddca81f8697190e697d66d7fcbd2ee6eff08f721a286e707d62ba7eb12bdb409dde82be8705e4e3ebb7a2b50b27
@@ -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 - list all items in the 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
@@ -1,3 +1,3 @@
1
1
  module Intent
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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-03 00:00:00.000000000 Z
11
+ date: 2016-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: todo-txt