markdo 0.1.11 → 0.1.12.alpha

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: 3af72a1862891028263caacca3bd0d95932aacb5
4
- data.tar.gz: 25594deae9cd552eb401f00acfbd8cd6fd7aedfe
3
+ metadata.gz: c0c9843069eef9e0921a739b08dde846b0c3ed7a
4
+ data.tar.gz: 3326d05636a1b2b27df418566cfc2649700467fd
5
5
  SHA512:
6
- metadata.gz: 137137bbf1175513b0c2f5711f09b67c62c7afac050cbef6da61e5605cf3a0de57b5d5954b2c1415cc8b9c3f1057c3883ac937efa07085c333b4c19526bd81f5
7
- data.tar.gz: ac0ead1ae05ead74ec67b08f67fdd9fd506a2119ce2efa0eeedd8527a070a018503e3a02dd9f8a39e9e8f0bd461cca3fbb740a79a68e670bb8f9607cf84aa3bd
6
+ metadata.gz: c7f2a3a72fe77433b8e250b389bd8033577418c1e523a938ee53cd57ebf20064de9589e58be7e9cf9d8fe9b9dc0f2e93f665102cd436ee7a51aa3cae085956d0
7
+ data.tar.gz: 385c8bc61d9ab5ebb11bb01cb24d27fd98b452cc07f83d457186db5060daf77448b3790c71699f461f834f3ecc8494e18de9410d5750a72e75205a63590d140a
data/Dockerfile CHANGED
@@ -1,12 +1,13 @@
1
- FROM ubuntu:16.04
2
- MAINTAINER Benjamin Oakes
1
+ FROM alpine:3.4
2
+
3
+ RUN echo 'apk update && apk add "$1"' > /usr/local/bin/pkg-apk
4
+ RUN chmod +x /usr/local/bin/pkg-*
3
5
 
4
- RUN apt-get update
5
6
  # Used for building the gem
6
- RUN apt-get install -y git
7
+ RUN pkg-apk git
7
8
 
8
- RUN apt-get install -y ruby
9
- RUN gem install --no-ri --no-rdoc bundler
9
+ RUN pkg-apk ruby
10
+ RUN pkg-apk ruby-bundler
10
11
 
11
12
  COPY Gemfile $HOME/
12
13
  COPY lib/markdo/fake_version.rb $HOME/lib/markdo/version.rb
data/README.md CHANGED
@@ -71,5 +71,5 @@ See `markdo help` for more information.
71
71
  ### Development Environment
72
72
 
73
73
  host$ sudo docker build -t markdo .
74
- host$ sudo docker run --rm -v $PWD:/src -i -t markdo
74
+ host$ sudo docker run --rm -v $PWD:/src -i -t markdo sh -l
75
75
  container$ rake
@@ -5,6 +5,7 @@ require 'markdo/help_command'
5
5
  require 'markdo/ics_command'
6
6
  require 'markdo/inbox_command'
7
7
  require 'markdo/overview_command'
8
+ require 'markdo/process_command'
8
9
  require 'markdo/query_command'
9
10
  require 'markdo/rss_command'
10
11
  require 'markdo/star_command'
@@ -39,6 +40,8 @@ module Markdo
39
40
  OverdueCommand
40
41
  when 'overview'
41
42
  OverviewCommand
43
+ when 'process'
44
+ ProcessCommand
42
45
  when 'query', 'q'
43
46
  QueryCommand
44
47
  when 'rss'
@@ -15,6 +15,7 @@ Markdown-based task manager.
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
17
  overdue Search *.md files for previous dates. (YYYY-MM-DD format.)
18
+ process Move lines from $MARKDO_INBOX to other files, one at a time.
18
19
  tag "string" Search *.md files for @string.
19
20
  today Search *.md files for today's date. (YYYY-MM-DD format.)
20
21
  tomorrow Search *.md files for tomorrow's date. (YYYY-MM-DD format.)
@@ -0,0 +1,68 @@
1
+ require 'date'
2
+ require 'markdo/command'
3
+
4
+ module Markdo
5
+ class ProcessCommand < Command
6
+ # Built as a prototype/proof of concept to see how much I like this idea...
7
+ def run
8
+ lines = File.readlines(inbox_path)
9
+ lines_by_filename = Hash.new { [] }
10
+
11
+ index = 0
12
+
13
+ while index < lines.length
14
+ line = lines[index]
15
+ @stdout.puts line
16
+ @stdout.print 'File [hisbma]? '
17
+ choice = $stdin.gets.chomp.downcase
18
+
19
+ case choice
20
+ when 'h'
21
+ @stdout.puts 'i - inbox (keep in inbox)'
22
+ @stdout.puts 's - sprint'
23
+ @stdout.puts 'b - backlog'
24
+ @stdout.puts 'm - maybe'
25
+ @stdout.puts 'a - abort; make no changes'
26
+ when 'i'
27
+ lines_by_filename['Inbox.md'] <<= line
28
+ index += 1
29
+ when 's'
30
+ lines_by_filename['Sprint.md'] <<= line
31
+ index += 1
32
+ when 'b'
33
+ lines_by_filename['Backlog.md'] <<= line
34
+ index += 1
35
+ when 'm'
36
+ lines_by_filename['Maybe.md'] <<= line
37
+ index += 1
38
+ when 'a'
39
+ exit
40
+ end
41
+ end
42
+
43
+ date = Date.today.iso8601
44
+ inbox_lines = lines_by_filename.delete('Inbox.md')
45
+ File.write(inbox_path, inbox_lines ? inbox_lines.join : '')
46
+
47
+ lines_by_filename.each do |filename, lines|
48
+ path = file_path(filename)
49
+ new_content = ["\n## Processed on #{date}\n\n"] << lines
50
+
51
+ File.open(path, 'a') do |file|
52
+ file.puts(new_content.join)
53
+ end
54
+ end
55
+ end
56
+
57
+ private
58
+
59
+ def file_path(filename)
60
+ File.join(@env['MARKDO_ROOT'], filename)
61
+ end
62
+
63
+ def inbox_path
64
+ File.join(@env['MARKDO_ROOT'], @env['MARKDO_INBOX'])
65
+ end
66
+ end
67
+ end
68
+
@@ -1,3 +1,3 @@
1
1
  module Markdo
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12.alpha"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Oakes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,6 +82,7 @@ files:
82
82
  - lib/markdo/inbox_command.rb
83
83
  - lib/markdo/overdue_command.rb
84
84
  - lib/markdo/overview_command.rb
85
+ - lib/markdo/process_command.rb
85
86
  - lib/markdo/query_command.rb
86
87
  - lib/markdo/rss_command.rb
87
88
  - lib/markdo/star_command.rb
@@ -116,12 +117,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
117
  version: '0'
117
118
  required_rubygems_version: !ruby/object:Gem::Requirement
118
119
  requirements:
119
- - - ">="
120
+ - - ">"
120
121
  - !ruby/object:Gem::Version
121
- version: '0'
122
+ version: 1.3.1
122
123
  requirements: []
123
124
  rubyforge_project:
124
- rubygems_version: 2.5.1
125
+ rubygems_version: 2.4.6
125
126
  signing_key:
126
127
  specification_version: 4
127
128
  summary: Markdown-based task manager