intent 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf34125575c5838f6c3918b503fcee1488a71e79
4
- data.tar.gz: d9af74783b32967643497df85da7dc28cd92b1d4
3
+ metadata.gz: ce0b88fd80778617997ce2f5fad117a7446684a8
4
+ data.tar.gz: 51d22691339272b86187ae85938bcf94fb129291
5
5
  SHA512:
6
- metadata.gz: d7af98e70d6d7e109c3e3484e3cfe7c7b55b4408662f6be2987fdf0e8a2c0c9146ca3cc3cb24c18da3809bff6fe2ba8d2f6586d4b4c81c87d548eb2bb420cca0
7
- data.tar.gz: 6a1f3838077c09fefe2a6b71238b687f6f773741704038f093d7625a12a2c9413895af6787390f3cc17e612e5fba3da078a06bf479897eed9a46d594cbfb2f22
6
+ metadata.gz: 3831a0bac8af5cf9eab8e23eb293381067609d5838c5267760525fb6d7f281fb8f9ac8045df7fa090d98872c471e3c259bd97d174549987ffc2e2c2cdf493419
7
+ data.tar.gz: 4ef8977e5606a1795e5165b81db9d61a8354bc309b4affa07fdbe845fbe0a26773c6f821fdf642084c1cea9b854439d168b221284ea7172d7900b917c7a6df91
@@ -1,12 +1,23 @@
1
1
  module Intent
2
2
  module Todo
3
+ Task = ::Todo::Task
4
+ List = ::Todo::List
5
+ Syntax = ::Todo::Syntax
6
+
3
7
  class Manager
8
+ include Syntax
9
+
4
10
  def self.run(args)
5
11
  if args.empty?
6
12
  print_help
7
13
  else
8
- list = ::Todo::List.new(ENV['TODO_TXT'])
14
+ list = List.new(ENV['TODO_TXT'])
9
15
  case args.first.to_sym
16
+ when :add
17
+ print "add task: $ "
18
+ input = STDIN.readline.chop
19
+ list.unshift(Task.new("#{Date.today} #{input}")) if input
20
+ list.save!
10
21
  when :list
11
22
  filtered_list = list.by_not_done
12
23
 
@@ -80,9 +91,10 @@ module Intent
80
91
  puts
81
92
  puts "A set of tasks for managing a plain text todo list."
82
93
  puts
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`"
94
+ puts "todo list - list all items in the list"
95
+ puts "todo add - add a new task to the list"
96
+ puts "todo focus - find focus by randomly selecting a task"
97
+ puts "todo archive - archive completed tasks in the nearest `done.txt`"
86
98
  end
87
99
  end
88
100
  end
@@ -1,3 +1,3 @@
1
1
  module Intent
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
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.5
4
+ version: 0.1.6
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-21 00:00:00.000000000 Z
11
+ date: 2016-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: todo-txt