markdo 0.1.12.alpha → 0.2.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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +15 -9
- data/Dockerfile +21 -7
- data/Guardfile +11 -0
- data/README.md +12 -7
- data/Rakefile +11 -7
- data/bin/markdo +1 -1
- data/docker-compose.yml +9 -0
- data/lib/markdo/cli.rb +23 -55
- data/lib/markdo/command_support.rb +14 -0
- data/lib/markdo/commands.rb +16 -0
- data/lib/markdo/{add_command.rb → commands/add_command.rb} +2 -6
- data/lib/markdo/commands/command.rb +33 -0
- data/lib/markdo/{edit_command.rb → commands/edit_command.rb} +2 -2
- data/lib/markdo/commands/forecast_command.rb +41 -0
- data/lib/markdo/{help_command.rb → commands/help_command.rb} +7 -8
- data/lib/markdo/commands/ics_command.rb +15 -0
- data/lib/markdo/commands/inbox_command.rb +11 -0
- data/lib/markdo/commands/overdue_command.rb +11 -0
- data/lib/markdo/commands/overview_command.rb +16 -0
- data/lib/markdo/commands/process_command.rb +91 -0
- data/lib/markdo/commands/query_command.rb +14 -0
- data/lib/markdo/commands/star_command.rb +11 -0
- data/lib/markdo/commands/summary_command.rb +25 -0
- data/lib/markdo/commands/tag_command.rb +11 -0
- data/lib/markdo/commands/today_command.rb +12 -0
- data/lib/markdo/commands/tomorrow_command.rb +12 -0
- data/lib/markdo/{version_command.rb → commands/version_command.rb} +1 -1
- data/lib/markdo/commands/week_command.rb +16 -0
- data/lib/markdo/data_source.rb +27 -0
- data/lib/markdo/ics_exporter.rb +65 -0
- data/lib/markdo/models/task.rb +46 -0
- data/lib/markdo/models/task_attribute.rb +22 -0
- data/lib/markdo/models/task_collection.rb +75 -0
- data/lib/markdo/version.rb +1 -1
- data/markdo.gemspec +6 -0
- data/script/build +9 -0
- data/spec/fixtures/add_command/Inbox.md +0 -0
- data/spec/fixtures/date_commands/Inbox.md +6 -0
- data/spec/fixtures/date_commands/Sprint.md +6 -0
- data/spec/fixtures/ics_command/Inbox.md +0 -0
- data/{test/fixtures/ics_command.md → spec/fixtures/ics_command/Sprint.md} +0 -0
- data/spec/fixtures/inbox_command/Inbox.md +2 -0
- data/spec/fixtures/inbox_command/Sprint.md +2 -0
- data/spec/fixtures/process_command/Backlog.md +0 -0
- data/spec/fixtures/process_command/Inbox.md +0 -0
- data/spec/fixtures/process_command/Maybe.md +0 -0
- data/spec/fixtures/process_command/Sprint.md +0 -0
- data/spec/fixtures/query_command/Inbox.md +4 -0
- data/spec/fixtures/query_command/Sprint.md +4 -0
- data/spec/fixtures/tag_command/Inbox.md +2 -0
- data/spec/fixtures/tag_command/Sprint.md +2 -0
- data/spec/lib/cli_spec.rb +79 -0
- data/spec/lib/commands/add_command_spec.rb +70 -0
- data/spec/lib/commands/edit_command_spec.rb +32 -0
- data/spec/lib/commands/forecast_command_spec.rb +24 -0
- data/spec/lib/commands/ics_command_spec.rb +30 -0
- data/spec/lib/commands/inbox_command_spec.rb +22 -0
- data/spec/lib/commands/overdue_command_spec.rb +19 -0
- data/spec/lib/commands/overview_command_spec.rb +25 -0
- data/spec/lib/commands/process_command_spec.rb +178 -0
- data/spec/lib/commands/query_command_spec.rb +23 -0
- data/spec/lib/commands/star_command_spec.rb +19 -0
- data/spec/lib/commands/summary_command_spec.rb +23 -0
- data/spec/lib/commands/tag_command_spec.rb +21 -0
- data/spec/lib/commands/today_command_spec.rb +19 -0
- data/spec/lib/commands/tomorrow_command_spec.rb +19 -0
- data/spec/lib/commands/week_command_spec.rb +23 -0
- data/spec/lib/ics_exporter_spec.rb +59 -0
- data/spec/lib/models/task_attribute_spec.rb +85 -0
- data/spec/lib/models/task_collection_spec.rb +168 -0
- data/spec/lib/models/task_spec.rb +79 -0
- data/spec/spec_helper.rb +40 -0
- metadata +189 -42
- data/.ruby-version +0 -1
- data/lib/markdo/command.rb +0 -12
- data/lib/markdo/date_command.rb +0 -9
- data/lib/markdo/forecast_command.rb +0 -61
- data/lib/markdo/ics_command.rb +0 -73
- data/lib/markdo/inbox_command.rb +0 -15
- data/lib/markdo/overdue_command.rb +0 -47
- data/lib/markdo/overview_command.rb +0 -17
- data/lib/markdo/process_command.rb +0 -68
- data/lib/markdo/query_command.rb +0 -24
- data/lib/markdo/rss_command.rb +0 -67
- data/lib/markdo/star_command.rb +0 -9
- data/lib/markdo/summary_command.rb +0 -30
- data/lib/markdo/tag_command.rb +0 -9
- data/lib/markdo/today_command.rb +0 -10
- data/lib/markdo/tomorrow_command.rb +0 -10
- data/lib/markdo/week_command.rb +0 -36
- data/test/fixtures/inbox.md +0 -2
- data/test/fixtures/rss_command.md +0 -4
- data/test/ics_command_test.rb +0 -38
- data/test/inbox_command_test.rb +0 -19
- data/test/rss_command_test.rb +0 -39
- data/test/summary_command_test.rb +0 -19
- data/test/test_helper.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cf29e2812f3d3e9255c6d41f5dcf8e5d9189d1b
|
4
|
+
data.tar.gz: 0b80852e80c4a2811bd145d4cbdded25dded1b97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdf73056e10da33f0bf5bb944cc1f4eeb120a4d39acf7980b48a776cd866fc57d6901ff7328f2bc951ce286d0bed2b62ddcee3962649c66edb4b6fb1f8001a83
|
7
|
+
data.tar.gz: ef10cc6fa44dc3eae0cec2eb0236d8b34c973718ef0d2ba25359633142a33a577c472d5c264532188f5350d322ea2004288d3098aef504d1f83f48bc79879daf
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
sudo: required
|
2
|
+
services:
|
3
|
+
- docker
|
4
|
+
install:
|
5
|
+
- docker-compose build
|
6
|
+
script:
|
7
|
+
- docker-compose up
|
8
|
+
deploy:
|
9
|
+
provider: rubygems
|
10
|
+
api_key:
|
11
|
+
secure: BS7n3GjoKC+K3i0ce0rbUwnJThcEiJ5+4+LPr1Oeb1CueCQ2wQkGJSyyZjUOCPywHtkLXpG+7VUkiRFIADm7ecvQ936VuOklzQfEbmsXVRjr9iZw1pG6sTzS0ua+YQJG8Ejl9SNYqtUGAGxAahWlZAiY375EdqoVE2aoqK4lmwERy3D1gwWt/vkv/0y7XRARaWui35XvozKQ9wUaZ423z2xMDCX8O4Ah9s/zEJujjKi+FeVhuaQOC6KXZV9I7CyR2F1ENG9OxT/IJ2Cejv6L0T88fRMwvejsph9PSQIlcDHVmV39P1PTWz51hzYd76Zh+8oK6WZFx+aEkusQ+RSUyq4LF6hWX8YLGZS4XsJk0z7wBEVMZdEQSW2oC+cECFv9tjWbljym6ZeX4E8lvCREsljtxdNTkmoZTBI+iXZpuQyYi27zUdM+EyHGNRVJ3mdA0nFRtNjPVegmi7lHzDCtFielI0PeXQKAUzZwtKFKaTxA87hkibJzMddwzWu51zJJXXqnop7aM1jJa4EDTFzagCy6p36KHvyLj0e1eCF4O/i6ucBp3ls70nApBupoK+zs2X+ZN+O1k5KUHYXGJdS4+ttxr58Qb+RhVj/3Uu0FLSfXzo8fFBhAn88k8slfYM9yfIPlvTKplCNpd50011CeWkgiqVT22QOThyeWi5g/Wpk=
|
12
|
+
gem: markdo
|
13
|
+
on:
|
14
|
+
tags: true
|
15
|
+
repo: benjaminoakes/markdo
|
data/Dockerfile
CHANGED
@@ -1,18 +1,32 @@
|
|
1
|
-
FROM
|
1
|
+
FROM ubuntu:16.04
|
2
2
|
|
3
|
-
RUN echo '
|
3
|
+
RUN echo 'apt-get update && apt-get install --no-install-recommends -y "$1"' > /usr/local/bin/pkg-deb
|
4
|
+
RUN echo 'gem install --no-ri --no-rdoc "$1"' > /usr/local/bin/pkg-gem
|
5
|
+
RUN echo 'npm install --global "$1"' > /usr/local/bin/pkg-npm
|
4
6
|
RUN chmod +x /usr/local/bin/pkg-*
|
5
7
|
|
6
8
|
# Used for building the gem
|
7
|
-
RUN pkg-
|
9
|
+
RUN pkg-deb git=1:2.7.4-0ubuntu1
|
8
10
|
|
9
|
-
|
10
|
-
RUN pkg-
|
11
|
+
# The Ubuntu-provided `phantomjs` is quite old. The below solution installs way more Node.js stuff than I'd like, but otherwise it's pretty painless.
|
12
|
+
RUN pkg-deb npm=3.5.2-0ubuntu4
|
13
|
+
RUN pkg-deb nodejs-legacy=4.2.6~dfsg-1ubuntu4
|
14
|
+
RUN pkg-deb libfontconfig1=2.11.94-0ubuntu1.1
|
15
|
+
RUN pkg-deb bzip2=1.0.6-8
|
16
|
+
RUN pkg-npm phantomjs-prebuilt@2.1.12
|
11
17
|
|
18
|
+
RUN pkg-deb build-essential=12.1ubuntu2
|
19
|
+
RUN pkg-deb ruby2.3
|
20
|
+
RUN pkg-deb ruby2.3-dev
|
21
|
+
|
22
|
+
RUN pkg-deb libffi-dev=3.2.1-4
|
23
|
+
RUN pkg-gem ffi:1.9.14
|
24
|
+
|
25
|
+
RUN pkg-gem bundler:1.12.5
|
12
26
|
COPY Gemfile $HOME/
|
13
27
|
COPY lib/markdo/fake_version.rb $HOME/lib/markdo/version.rb
|
14
|
-
|
15
28
|
COPY markdo.gemspec $HOME/
|
16
|
-
RUN bundle
|
29
|
+
RUN bundle install
|
17
30
|
|
18
31
|
WORKDIR /src
|
32
|
+
CMD guard --no-bundler-warning
|
data/Guardfile
ADDED
data/README.md
CHANGED
@@ -46,18 +46,21 @@ See `markdo help` for more information.
|
|
46
46
|
|
47
47
|
add "string" Add a task to the inbox. (Set $MARKDO_ROOT and $MARKDO_INBOX.)
|
48
48
|
edit Edit $MARKDO_ROOT in $EDITOR.
|
49
|
+
forecast Display tasks due in the next week. (@due(YYYY-MM-DD) format.)
|
49
50
|
help, --help Display this help text.
|
51
|
+
inbox Display contents of $MARKDO_INBOX.
|
50
52
|
ics Make an iCalendar feed of all due dates in Markdo. Can be imported
|
51
53
|
or subscribed to if on a remote server.
|
52
54
|
overview Get overview of overdue, starred, today's, and tomorrow's tasks.
|
53
|
-
overdue Search *.md files for previous dates. (YYYY-MM-DD format.)
|
55
|
+
overdue Search *.md files for tasks due on previous dates. (@due(YYYY-MM-DD) format.)
|
56
|
+
process Move lines from $MARKDO_INBOX to other files, one at a time.
|
54
57
|
tag "string" Search *.md files for @string.
|
55
|
-
today Search *.md files for today
|
56
|
-
tomorrow Search *.md files for tomorrow
|
57
|
-
rss Make an RSS feed of all links in Markdo. Useful as a live bookmark.
|
58
|
+
today Search *.md files for tasks due today. (@due(YYYY-MM-DD) format.)
|
59
|
+
tomorrow Search *.md files for tasks due tomorrow. (@due(YYYY-MM-DD) format.)
|
58
60
|
star, starred Search *.md files for @star.
|
59
61
|
summary Display counts.
|
60
62
|
query, q "string" Search *.md files for string.
|
63
|
+
week Search *.md files for due dates in the next week. (@due(YYYY-MM-DD) format.)
|
61
64
|
version, --version Display the version.
|
62
65
|
|
63
66
|
## Contributing
|
@@ -70,6 +73,8 @@ See `markdo help` for more information.
|
|
70
73
|
|
71
74
|
### Development Environment
|
72
75
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
+
```
|
77
|
+
docker-compose build
|
78
|
+
docker-compose run guard # run tests interactively
|
79
|
+
docker-compose run build # build the gem
|
80
|
+
```
|
data/Rakefile
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
-
require 'rake/testtask'
|
3
2
|
|
4
|
-
task default:
|
5
|
-
|
6
|
-
Rake::TestTask.new('test') do |t|
|
7
|
-
t.libs = %w(lib test)
|
8
|
-
t.test_files = FileList.new("test/**/*_test.rb")
|
9
|
-
end
|
3
|
+
task default: %w(spec spec:opal:phantomjs)
|
10
4
|
|
11
5
|
task :clean do
|
12
6
|
require 'fileutils'
|
13
7
|
FileUtils.rm_rf('pkg')
|
14
8
|
end
|
9
|
+
|
10
|
+
require 'rspec/core/rake_task'
|
11
|
+
|
12
|
+
desc "Run the specs."
|
13
|
+
RSpec::Core::RakeTask.new('spec')
|
14
|
+
|
15
|
+
require 'opal/rspec/rake_task'
|
16
|
+
Opal::RSpec::RakeTask.new('spec:opal:phantomjs') do |server, task|
|
17
|
+
server.append_path 'lib'
|
18
|
+
end
|
data/bin/markdo
CHANGED
data/docker-compose.yml
ADDED
data/lib/markdo/cli.rb
CHANGED
@@ -1,74 +1,42 @@
|
|
1
|
-
require 'markdo/
|
2
|
-
require 'markdo/edit_command'
|
3
|
-
require 'markdo/forecast_command'
|
4
|
-
require 'markdo/help_command'
|
5
|
-
require 'markdo/ics_command'
|
6
|
-
require 'markdo/inbox_command'
|
7
|
-
require 'markdo/overview_command'
|
8
|
-
require 'markdo/process_command'
|
9
|
-
require 'markdo/query_command'
|
10
|
-
require 'markdo/rss_command'
|
11
|
-
require 'markdo/star_command'
|
12
|
-
require 'markdo/summary_command'
|
13
|
-
require 'markdo/tag_command'
|
14
|
-
require 'markdo/today_command'
|
15
|
-
require 'markdo/tomorrow_command'
|
16
|
-
require 'markdo/week_command'
|
17
|
-
require 'markdo/version_command'
|
1
|
+
require 'markdo/commands'
|
18
2
|
|
19
3
|
module Markdo
|
20
4
|
class CLI
|
21
|
-
def initialize(
|
22
|
-
@
|
23
|
-
@
|
24
|
-
@
|
5
|
+
def initialize(command_support = CommandSupport.new)
|
6
|
+
@stdin = command_support.stdin
|
7
|
+
@stdout = command_support.stdout
|
8
|
+
@stderr = command_support.stderr
|
9
|
+
@full_env = command_support.env
|
25
10
|
end
|
26
11
|
|
27
12
|
def run(command_name = 'help', *args)
|
28
13
|
command = case command_name
|
29
|
-
when '
|
30
|
-
AddCommand
|
31
|
-
when 'edit'
|
32
|
-
EditCommand
|
33
|
-
when 'forecast'
|
34
|
-
ForecastCommand
|
35
|
-
when 'ics'
|
36
|
-
IcsCommand
|
37
|
-
when 'inbox'
|
38
|
-
InboxCommand
|
39
|
-
when 'overdue'
|
40
|
-
OverdueCommand
|
41
|
-
when 'overview'
|
42
|
-
OverviewCommand
|
43
|
-
when 'process'
|
44
|
-
ProcessCommand
|
45
|
-
when 'query', 'q'
|
14
|
+
when 'q'
|
46
15
|
QueryCommand
|
47
|
-
when '
|
48
|
-
RssCommand
|
49
|
-
when 'star', 'starred'
|
16
|
+
when 'starred'
|
50
17
|
StarCommand
|
51
|
-
when '
|
52
|
-
SummaryCommand
|
53
|
-
when 'tag'
|
54
|
-
TagCommand
|
55
|
-
when 'today'
|
56
|
-
TodayCommand
|
57
|
-
when 'tomorrow'
|
58
|
-
TomorrowCommand
|
59
|
-
when 'version', '--version'
|
18
|
+
when '--version'
|
60
19
|
VersionCommand
|
61
|
-
when 'week'
|
62
|
-
WeekCommand
|
63
20
|
else
|
64
|
-
|
21
|
+
choose_command_class(command_name)
|
65
22
|
end
|
66
23
|
|
67
|
-
|
24
|
+
command_support = CommandSupport.new(stdin: @stdin,
|
25
|
+
stdout: @stdout,
|
26
|
+
stderr: @stderr,
|
27
|
+
env: merged_env)
|
28
|
+
command.new(command_support).run(*args)
|
68
29
|
end
|
69
30
|
|
70
31
|
private
|
71
32
|
|
33
|
+
def choose_command_class(command_name)
|
34
|
+
command_class_name = "#{command_name.capitalize}Command"
|
35
|
+
::Markdo.const_get(command_class_name)
|
36
|
+
rescue NameError
|
37
|
+
HelpCommand
|
38
|
+
end
|
39
|
+
|
72
40
|
def default_env
|
73
41
|
{
|
74
42
|
'MARKDO_ROOT' => '.',
|
@@ -76,7 +44,7 @@ module Markdo
|
|
76
44
|
}
|
77
45
|
end
|
78
46
|
|
79
|
-
def
|
47
|
+
def merged_env
|
80
48
|
default_env.merge(@full_env)
|
81
49
|
end
|
82
50
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Markdo
|
2
|
+
class CommandSupport
|
3
|
+
attr_reader :stdin, :stdout, :stderr, :env, :today
|
4
|
+
attr_writer :stdin
|
5
|
+
|
6
|
+
def initialize(stdin: STDIN, stdout: STDOUT, stderr: STDERR, env: ENV, today: Date.today)
|
7
|
+
@stdin = stdin
|
8
|
+
@stdout = stdout
|
9
|
+
@stderr = stderr
|
10
|
+
@env = env
|
11
|
+
@today = today
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'markdo/commands/add_command'
|
2
|
+
require 'markdo/commands/edit_command'
|
3
|
+
require 'markdo/commands/forecast_command'
|
4
|
+
require 'markdo/commands/help_command'
|
5
|
+
require 'markdo/commands/ics_command'
|
6
|
+
require 'markdo/commands/inbox_command'
|
7
|
+
require 'markdo/commands/overview_command'
|
8
|
+
require 'markdo/commands/process_command'
|
9
|
+
require 'markdo/commands/query_command'
|
10
|
+
require 'markdo/commands/star_command'
|
11
|
+
require 'markdo/commands/summary_command'
|
12
|
+
require 'markdo/commands/tag_command'
|
13
|
+
require 'markdo/commands/today_command'
|
14
|
+
require 'markdo/commands/tomorrow_command'
|
15
|
+
require 'markdo/commands/week_command'
|
16
|
+
require 'markdo/commands/version_command'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'markdo/command'
|
1
|
+
require 'markdo/commands/command'
|
2
2
|
|
3
3
|
module Markdo
|
4
4
|
class AddCommand < Command
|
@@ -6,7 +6,7 @@ module Markdo
|
|
6
6
|
task = String(task)
|
7
7
|
|
8
8
|
unless task.strip.empty?
|
9
|
-
File.open(inbox_path, 'a') do |file|
|
9
|
+
File.open(data_source.inbox_path, 'a') do |file|
|
10
10
|
file.puts(template(task))
|
11
11
|
end
|
12
12
|
end
|
@@ -17,9 +17,5 @@ module Markdo
|
|
17
17
|
def template(task)
|
18
18
|
"- [ ] #{task}"
|
19
19
|
end
|
20
|
-
|
21
|
-
def inbox_path
|
22
|
-
File.join(@env['MARKDO_ROOT'], @env['MARKDO_INBOX'])
|
23
|
-
end
|
24
20
|
end
|
25
21
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'markdo/command_support'
|
2
|
+
require 'markdo/data_source'
|
3
|
+
require 'markdo/models/task_collection'
|
4
|
+
|
5
|
+
module Markdo
|
6
|
+
class Command
|
7
|
+
def initialize(command_support)
|
8
|
+
@command_support = command_support
|
9
|
+
@stdin = command_support.stdin
|
10
|
+
@stdout = command_support.stdout
|
11
|
+
@stderr = command_support.stderr
|
12
|
+
@env = command_support.env
|
13
|
+
@today = command_support.today
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
end
|
18
|
+
|
19
|
+
protected
|
20
|
+
|
21
|
+
def data_source
|
22
|
+
DataSource.new(@env)
|
23
|
+
end
|
24
|
+
|
25
|
+
def task_collection
|
26
|
+
TaskCollection.new(data_source.lines_from_all, @today)
|
27
|
+
end
|
28
|
+
|
29
|
+
def inbox_task_collection
|
30
|
+
TaskCollection.new(data_source.lines_from_inbox, @today)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'shellwords'
|
2
|
-
require 'markdo/command'
|
2
|
+
require 'markdo/commands/command'
|
3
3
|
|
4
4
|
module Markdo
|
5
5
|
class EditCommand < Command
|
6
6
|
def run
|
7
|
-
system("#{@env['EDITOR']} #{safe_markdo_root}")
|
7
|
+
Kernel.system("#{@env['EDITOR']} #{safe_markdo_root}")
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'markdo/commands/command'
|
3
|
+
|
4
|
+
module Markdo
|
5
|
+
class ForecastCommand < Command
|
6
|
+
def run
|
7
|
+
dates_over_the_next_week.each do |date|
|
8
|
+
abbreviation = abbreviations_by_wday(date.wday)
|
9
|
+
count = task_collection.due_on(date).length
|
10
|
+
|
11
|
+
@stdout.puts("#{abbreviation}: #{count}")
|
12
|
+
end
|
13
|
+
|
14
|
+
due_next_week = task_collection.due_between(@today + 7,
|
15
|
+
@today + 14)
|
16
|
+
@stdout.puts("Next: #{due_next_week.length}")
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def abbreviations_by_wday(wday)
|
22
|
+
abbrevs = {
|
23
|
+
0 => 'Su',
|
24
|
+
1 => 'Mo',
|
25
|
+
2 => 'Tu',
|
26
|
+
3 => 'We',
|
27
|
+
4 => 'Th',
|
28
|
+
5 => 'Fr',
|
29
|
+
6 => 'Sa',
|
30
|
+
}
|
31
|
+
|
32
|
+
abbrevs[wday]
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def dates_over_the_next_week
|
38
|
+
(2..7).to_a.map { |offset| @today + offset }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'markdo/command'
|
1
|
+
require 'markdo/commands/command'
|
2
2
|
|
3
3
|
module Markdo
|
4
4
|
class HelpCommand < Command
|
@@ -8,26 +8,25 @@ Markdown-based task manager.
|
|
8
8
|
|
9
9
|
add "string" Add a task to the inbox. (Set $MARKDO_ROOT and $MARKDO_INBOX.)
|
10
10
|
edit Edit $MARKDO_ROOT in $EDITOR.
|
11
|
-
forecast Display
|
11
|
+
forecast Display tasks due in the next week. (@due(YYYY-MM-DD) format.)
|
12
12
|
help, --help Display this help text.
|
13
13
|
inbox Display contents of $MARKDO_INBOX.
|
14
14
|
ics Make an iCalendar feed of all due dates in Markdo. Can be imported
|
15
15
|
or subscribed to if on a remote server.
|
16
16
|
overview Get overview of overdue, starred, today's, and tomorrow's tasks.
|
17
|
-
overdue Search *.md files for previous dates. (YYYY-MM-DD format.)
|
17
|
+
overdue Search *.md files for tasks due on previous dates. (@due(YYYY-MM-DD) format.)
|
18
18
|
process Move lines from $MARKDO_INBOX to other files, one at a time.
|
19
19
|
tag "string" Search *.md files for @string.
|
20
|
-
today Search *.md files for today
|
21
|
-
tomorrow Search *.md files for tomorrow
|
22
|
-
rss Make an RSS feed of all links in Markdo. Useful as a live bookmark.
|
20
|
+
today Search *.md files for tasks due today. (@due(YYYY-MM-DD) format.)
|
21
|
+
tomorrow Search *.md files for tasks due tomorrow. (@due(YYYY-MM-DD) format.)
|
23
22
|
star, starred Search *.md files for @star.
|
24
23
|
summary Display counts.
|
25
24
|
query, q "string" Search *.md files for string.
|
26
|
-
week Search *.md files for dates in the next week. (YYYY-MM-DD format.)
|
25
|
+
week Search *.md files for due dates in the next week. (@due(YYYY-MM-DD) format.)
|
27
26
|
version, --version Display the version.
|
28
27
|
EOF
|
29
28
|
|
30
|
-
exit
|
29
|
+
Kernel.exit(1)
|
31
30
|
end
|
32
31
|
end
|
33
32
|
end
|