intent 0.1.8 → 0.1.9

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: d696340aa9aef660a8ab8c1c8f8023d5df0ee9d0
4
- data.tar.gz: 60963652a95ca8293760041c7774c59b76213803
3
+ metadata.gz: c1321e09760e2c379bf1d27e59f97d4a78cae695
4
+ data.tar.gz: eceb5752851780fe423fbe4b1aa9ea65d2e94ea8
5
5
  SHA512:
6
- metadata.gz: b7abd8619a7d59a7d9e6d28343630daafb8005668b7de21c17d748cc6a48261e8a6150f814f926bcea1cd14fa6c092ac7f8e71ddedd1a3dbfcecd158d865eac3
7
- data.tar.gz: 6ede8e38e565675fd193326dfb3aea81387c5ef2e7fe05236dec0e89b8e4753cfa23a97e65089bf605fb4d13f5dd60cd98128a5a8b6e0489d0ae799b0de73eaa
6
+ metadata.gz: c665e8c6034e82abcaaa9a812247557b96a01e3e95b246b1cd2d15ea23680e242ebdb681ec06c93aa5a27cf88f755fd68aff2d41841212ecded1538cf502b950
7
+ data.tar.gz: 7f537021f26eaae80f4184be6c24702a7361d7016d8e286689335089f334ec53b8bbaf6289664c1907f4086a27ff5fb2fc00fa63c78cd169049cc80cbb68bee3
data/bin/todo CHANGED
@@ -6,6 +6,6 @@ while File.symlink?(path)
6
6
  end
7
7
  $:.unshift(File.join(File.dirname(File.expand_path(path)), '..', 'lib'))
8
8
 
9
- require 'intent/todo'
9
+ require 'intent'
10
10
 
11
11
  Intent::Todo::Manager.run(ARGV.dup)
@@ -7,14 +7,14 @@ module Intent
7
7
  class Manager
8
8
  include Syntax
9
9
 
10
- def self.run(args)
10
+ def self.run(args, output=STDOUT)
11
11
  if args.empty?
12
- print_help
12
+ print_help(output)
13
13
  else
14
14
  list = List.new(ENV['TODO_TXT'])
15
15
  case args.first.to_sym
16
16
  when :add
17
- print "add task: $ "
17
+ output.print "add task: $ "
18
18
  input = STDIN.readline.chop
19
19
  list.unshift(Task.new("#{Date.today} #{input}")) if input
20
20
  list.save!
@@ -33,7 +33,7 @@ module Intent
33
33
  end
34
34
 
35
35
  filtered_list.by_not_done.each do |task|
36
- puts task
36
+ output.puts task
37
37
  end
38
38
  when :focus
39
39
  focused_list = list.by_not_done
@@ -49,25 +49,25 @@ module Intent
49
49
 
50
50
  prioritised_list = focused_list.by_priority('A')
51
51
  if prioritised_list.any?
52
- puts prioritised_list.sample
52
+ output.puts prioritised_list.sample
53
53
  else
54
54
  if focused_list.any?
55
- puts focused_list.sample
55
+ output.puts focused_list.sample
56
56
  else
57
- puts "No tasks found."
57
+ output.puts "No tasks found."
58
58
  end
59
59
  end
60
60
  when :projects
61
- puts list.inject([]) { |p, t| p.concat t.projects }.uniq
61
+ output.puts list.inject([]) { |p, t| p.concat t.projects }.uniq
62
62
  when :contexts
63
- puts list.inject([]) { |c, t| c.concat t.contexts }.uniq
63
+ output.puts list.inject([]) { |c, t| c.concat t.contexts }.uniq
64
64
  when :archive
65
65
  archive_path = File.dirname(ENV['TODO_TXT'])
66
66
  done_file = "#{archive_path}/__done__.txt"
67
67
  todo_file = "#{archive_path}/__todo__.txt"
68
68
 
69
69
  unless File.exists?(done_file)
70
- puts "Creating new `done.txt` in #{archive_path}."
70
+ output.puts "Creating new `done.txt` in #{archive_path}."
71
71
  File.write(done_file, "")
72
72
  end
73
73
 
@@ -92,17 +92,17 @@ module Intent
92
92
  end
93
93
  end
94
94
 
95
- def self.print_help
96
- puts "usage: todo"
97
- puts
98
- puts "A set of tasks for managing a plain text todo list."
99
- puts
100
- puts "todo list - list all items in the list"
101
- puts "todo add - add a new task to the list"
102
- puts "todo focus - find focus by randomly selecting a task"
103
- puts "todo projects - list all project tags in the list"
104
- puts "todo contexts - list all context tags in the list"
105
- puts "todo archive - archive completed tasks in the nearest `done.txt`"
95
+ def self.print_help(output)
96
+ output.puts "usage: todo"
97
+ output.puts
98
+ output.puts "A set of tasks for managing a plain text todo list."
99
+ output.puts
100
+ output.puts "todo list - list all items in the list"
101
+ output.puts "todo add - add a new task to the list"
102
+ output.puts "todo focus - find focus by randomly selecting a task"
103
+ output.puts "todo projects - list all project tags in the list"
104
+ output.puts "todo contexts - list all context tags in the list"
105
+ output.puts "todo archive - archive completed tasks in the nearest `done.txt`"
106
106
  end
107
107
  end
108
108
  end
@@ -1,3 +1,3 @@
1
1
  module Intent
2
- VERSION = "0.1.8"
2
+ VERSION = '0.1.9'
3
3
  end
data/lib/intent.rb CHANGED
@@ -1 +1,2 @@
1
- require "intent/version"
1
+ require 'intent/todo'
2
+ require 'intent/version'
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.8
4
+ version: 0.1.9
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-05-04 00:00:00.000000000 Z
11
+ date: 2016-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: todo-txt
@@ -107,9 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.2.2
110
+ rubygems_version: 2.4.5
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Text-based project management
114
114
  test_files: []
115
- has_rdoc: