intent 0.3.1 → 0.4.0

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: 6bb761221561124f3007e1365c600d67383b426b
4
- data.tar.gz: 32ca405508c07c8dfc30ba89786e5080ee5ad72e
3
+ metadata.gz: d450fc5d57ac7887177c30dff4c281a412ef19e7
4
+ data.tar.gz: 6756b6fdf1cb2a1637af44d3d4316142255d8e45
5
5
  SHA512:
6
- metadata.gz: b1b5d25c0d2b2ad2f6328a849cf2ffacec09b78dbac6b08dcb34f46532bf8a82f966a32761e99f2059397cf3d6a63a1228a568ae748bbb95501143447e688897
7
- data.tar.gz: 11ab21274691627bce8de9e23b8bc7952288cf326911e01f1d713cd93793c57db6bbc86a4c53541b3eb17396f3b4a1ddf2e2d748cb817d972d783e57b9d302d5
6
+ metadata.gz: a41f6aa53870ef75331e9c8d21ea640c9881adeba43ec0fa834b1172c0ef9603348d7e96b8ce858c23aa67ce6e474c8713a91495e10a6a2590ae7f34063c148d
7
+ data.tar.gz: bd8474efd113136d5781f6e1074a00b0e0f1408b2c02589d9ce6eb96ff65f84e11909c23c2e91e2862fb8c928e4ff3b0ee326b917a9b935b6a6515a519adc674
data/intent.gemspec CHANGED
@@ -21,6 +21,9 @@ Gem::Specification.new do |spec|
21
21
  spec.add_runtime_dependency "todo-txt", "~> 0.11"
22
22
  spec.add_runtime_dependency "pastel", "~> 0.6"
23
23
  spec.add_runtime_dependency "git", "~> 1.3.0"
24
+ spec.add_runtime_dependency "terminal-notifier", "~> 1.8.0"
25
+ spec.add_runtime_dependency "ghost", "~> 1.0.0"
26
+
24
27
 
25
28
  spec.add_development_dependency "bundler", "~> 1.10"
26
29
  spec.add_development_dependency "rake", "~> 10.0"
@@ -42,7 +42,7 @@ module Intent
42
42
  filtered_list.by_not_done.each do |task|
43
43
  output.puts task
44
44
  end
45
- when :focus
45
+ when :sample
46
46
  focused_list = list.by_not_done
47
47
 
48
48
  unless args[1].nil?
@@ -152,6 +152,31 @@ module Intent
152
152
  list.unshift(Task.new("#{Date.today} #{input} @reading")) if input
153
153
  list.save!
154
154
  end
155
+ when :focus
156
+ timer = if args[1].nil?
157
+ 25 # default to pomodoro task length
158
+ else
159
+ args[1].to_i
160
+ end
161
+
162
+ blacklist = [
163
+ 'mail.google.com',
164
+ 'twitter.com',
165
+ 'facebook.com',
166
+ 'reddit.com',
167
+ ]
168
+
169
+ pid = fork do
170
+ sleep timer * 60
171
+ Ghost.store.empty
172
+ TerminalNotifier.notify('Focus block has ended')
173
+ end
174
+
175
+ blacklist.each do |hostname|
176
+ Ghost.store.add(Ghost::Host.new(hostname, '127.0.0.1'))
177
+ end
178
+
179
+ Process.detach pid
155
180
  end
156
181
  end
157
182
  end
@@ -163,13 +188,14 @@ module Intent
163
188
  output.puts
164
189
  output.puts "todo list - list all items in the list"
165
190
  output.puts "todo add - add a new task to the list"
166
- output.puts "todo focus - find focus by randomly selecting a task"
191
+ output.puts "todo sample - randomly select a priority task"
167
192
  output.puts "todo projects - list all project tags in the list"
168
193
  output.puts "todo contexts - list all context tags in the list"
169
194
  output.puts "todo archive - archive completed tasks in the nearest `done.txt`"
170
195
  output.puts "todo status - show completion status for all projects"
171
196
  output.puts "todo sync - synchronize local changes with remote git repo"
172
197
  output.puts "todo collect - collect open browser tabs as items for later reading"
198
+ output.puts "todo focus - block distractions and start focusing"
173
199
  end
174
200
  end
175
201
  end
data/lib/intent/todo.rb CHANGED
@@ -3,6 +3,8 @@ require 'pastel'
3
3
  require 'fileutils'
4
4
  require 'logger'
5
5
  require 'git'
6
+ require 'terminal-notifier'
7
+ require 'ghost'
6
8
  require 'intent/todo/manager'
7
9
 
8
10
  Todo.customize do |options|
@@ -1,3 +1,3 @@
1
1
  module Intent
2
- VERSION = '0.3.1'
2
+ VERSION = '0.4.0'
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.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rickerby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-10 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: todo-txt
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.3.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: terminal-notifier
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 1.8.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.8.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: ghost
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.0.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.0.0
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: bundler
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -139,8 +167,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
167
  version: '0'
140
168
  requirements: []
141
169
  rubyforge_project:
142
- rubygems_version: 2.5.1
170
+ rubygems_version: 2.6.11
143
171
  signing_key:
144
172
  specification_version: 4
145
173
  summary: Text-based project management
146
174
  test_files: []
175
+ has_rdoc: