markdo 0.1.4 → 0.1.5
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/README.md +3 -0
 - data/configure +2 -0
 - data/lib/markdo/cli.rb +3 -0
 - data/lib/markdo/help_command.rb +1 -0
 - data/lib/markdo/rss_command.rb +3 -1
 - data/lib/markdo/summary_command.rb +26 -0
 - data/lib/markdo/version.rb +1 -1
 - data/test/summary_command_test.rb +21 -0
 - metadata +6 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7f4c3f364dd7759640369d4bf458a1f8a3ccc9ad
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: b470d5f10956ea64e70b86b2dbb0c0cc066c27c4
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 970c747b570aea15cc62a6eb77fcfa0dffc60959cbbc40e09504936c65fe6c95e4af5b425674fee8bf4d82d8f379fca8622ae558edc6c0d9018089a0c3455c72
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 9ea90d987b99a9730110bb2d398817c052232fa03071781b263629683ab381046263358fdb003b03bfa16314f7e1e4ad397e1b3db597d7e3247917f4aa213627
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -47,11 +47,14 @@ See `markdo help` for more information. 
     | 
|
| 
       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 
49 
     | 
    
         
             
                help, --help          Display this help text.
         
     | 
| 
      
 50 
     | 
    
         
            +
                ics                   Make an iCalendar feed of all due dates in Markdo.  Can be imported
         
     | 
| 
      
 51 
     | 
    
         
            +
                                      or subscribed to if on a remote server.
         
     | 
| 
       50 
52 
     | 
    
         
             
                overview              Get overview of overdue, starred, today's, and tomorrow's tasks.
         
     | 
| 
       51 
53 
     | 
    
         
             
                overdue               Search *.md files for previous dates.  (YYYY-MM-DD format.)
         
     | 
| 
       52 
54 
     | 
    
         
             
                tag "string"          Search *.md files for @string.
         
     | 
| 
       53 
55 
     | 
    
         
             
                today                 Search *.md files for today's date.  (YYYY-MM-DD format.)
         
     | 
| 
       54 
56 
     | 
    
         
             
                tomorrow              Search *.md files for tomorrow's date.  (YYYY-MM-DD format.)
         
     | 
| 
      
 57 
     | 
    
         
            +
                rss                   Make an RSS feed of all links in Markdo.  Useful as a live bookmark.
         
     | 
| 
       55 
58 
     | 
    
         
             
                star, starred         Search *.md files for @star.
         
     | 
| 
       56 
59 
     | 
    
         
             
                query, q "string"     Search *.md files for string.
         
     | 
| 
       57 
60 
     | 
    
         
             
                version, --version    Display the version.
         
     | 
    
        data/configure
    ADDED
    
    
    
        data/lib/markdo/cli.rb
    CHANGED
    
    | 
         @@ -6,6 +6,7 @@ require 'markdo/overview_command' 
     | 
|
| 
       6 
6 
     | 
    
         
             
            require 'markdo/query_command'
         
     | 
| 
       7 
7 
     | 
    
         
             
            require 'markdo/rss_command'
         
     | 
| 
       8 
8 
     | 
    
         
             
            require 'markdo/star_command'
         
     | 
| 
      
 9 
     | 
    
         
            +
            require 'markdo/summary_command'
         
     | 
| 
       9 
10 
     | 
    
         
             
            require 'markdo/tag_command'
         
     | 
| 
       10 
11 
     | 
    
         
             
            require 'markdo/today_command'
         
     | 
| 
       11 
12 
     | 
    
         
             
            require 'markdo/tomorrow_command'
         
     | 
| 
         @@ -37,6 +38,8 @@ module Markdo 
     | 
|
| 
       37 
38 
     | 
    
         
             
                              RssCommand
         
     | 
| 
       38 
39 
     | 
    
         
             
                            when 'star', 'starred'
         
     | 
| 
       39 
40 
     | 
    
         
             
                              StarCommand
         
     | 
| 
      
 41 
     | 
    
         
            +
                            when 'summary'
         
     | 
| 
      
 42 
     | 
    
         
            +
                              SummaryCommand
         
     | 
| 
       40 
43 
     | 
    
         
             
                            when 'tag'
         
     | 
| 
       41 
44 
     | 
    
         
             
                              TagCommand
         
     | 
| 
       42 
45 
     | 
    
         
             
                            when 'today'
         
     | 
    
        data/lib/markdo/help_command.rb
    CHANGED
    
    | 
         @@ -18,6 +18,7 @@ Markdown-based task manager. 
     | 
|
| 
       18 
18 
     | 
    
         
             
                tomorrow              Search *.md files for tomorrow's date.  (YYYY-MM-DD format.)
         
     | 
| 
       19 
19 
     | 
    
         
             
                rss                   Make an RSS feed of all links in Markdo.  Useful as a live bookmark.
         
     | 
| 
       20 
20 
     | 
    
         
             
                star, starred         Search *.md files for @star.
         
     | 
| 
      
 21 
     | 
    
         
            +
                summary               Display counts.
         
     | 
| 
       21 
22 
     | 
    
         
             
                query, q "string"     Search *.md files for string.
         
     | 
| 
       22 
23 
     | 
    
         
             
                version, --version    Display the version.
         
     | 
| 
       23 
24 
     | 
    
         
             
            EOF
         
     | 
    
        data/lib/markdo/rss_command.rb
    CHANGED
    
    | 
         @@ -4,12 +4,14 @@ require 'uri' 
     | 
|
| 
       4 
4 
     | 
    
         
             
            module Markdo
         
     | 
| 
       5 
5 
     | 
    
         
             
              class RssCommand < Command
         
     | 
| 
       6 
6 
     | 
    
         
             
                def run
         
     | 
| 
      
 7 
     | 
    
         
            +
                  uri_parser = URI::Parser.new
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
       7 
9 
     | 
    
         
             
                  items = Dir.
         
     | 
| 
       8 
10 
     | 
    
         
             
                    glob(markdown_glob).
         
     | 
| 
       9 
11 
     | 
    
         
             
                    map { |path| File.readlines(path, encoding: 'UTF-8') }.
         
     | 
| 
       10 
12 
     | 
    
         
             
                    flatten.
         
     | 
| 
       11 
13 
     | 
    
         
             
                    grep(%r(https?://)).
         
     | 
| 
       12 
     | 
    
         
            -
                    map { |line| Item.new(title: clean(line), links:  
     | 
| 
      
 14 
     | 
    
         
            +
                    map { |line| Item.new(title: clean(line), links: uri_parser.extract(line)) }
         
     | 
| 
       13 
15 
     | 
    
         | 
| 
       14 
16 
     | 
    
         
             
                  xml = template(items)
         
     | 
| 
       15 
17 
     | 
    
         | 
| 
         @@ -0,0 +1,26 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'stringio'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'markdo/command'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'markdo/overdue_command'
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'markdo/star_command'
         
     | 
| 
      
 6 
     | 
    
         
            +
            require 'markdo/today_command'
         
     | 
| 
      
 7 
     | 
    
         
            +
            require 'markdo/tomorrow_command'
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            module Markdo
         
     | 
| 
      
 10 
     | 
    
         
            +
              class SummaryCommand < Command
         
     | 
| 
      
 11 
     | 
    
         
            +
                def run
         
     | 
| 
      
 12 
     | 
    
         
            +
                  commands = [OverdueCommand, StarCommand, TodayCommand, TomorrowCommand]
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
                  commands.each do |command|
         
     | 
| 
      
 15 
     | 
    
         
            +
                    out = StringIO.new
         
     | 
| 
      
 16 
     | 
    
         
            +
                    command.new(out, @stderr, @env).run
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                    title = command.to_s.sub(/^Markdo::/, '').sub(/Command$/, '')
         
     | 
| 
      
 19 
     | 
    
         
            +
                    lines = out.string.split("\n")
         
     | 
| 
      
 20 
     | 
    
         
            +
                    sum =  lines.length.inspect
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
                    @stdout.puts("#{title}: #{sum}")
         
     | 
| 
      
 23 
     | 
    
         
            +
                  end
         
     | 
| 
      
 24 
     | 
    
         
            +
                end
         
     | 
| 
      
 25 
     | 
    
         
            +
              end
         
     | 
| 
      
 26 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/markdo/version.rb
    CHANGED
    
    
| 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'test_helper'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'markdo/summary_command'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module Markdo
         
     | 
| 
      
 5 
     | 
    
         
            +
              describe SummaryCommand do
         
     | 
| 
      
 6 
     | 
    
         
            +
                it 'outputs RSS from the input Markdown' do
         
     | 
| 
      
 7 
     | 
    
         
            +
                  out = StringIO.new
         
     | 
| 
      
 8 
     | 
    
         
            +
                  err = StringIO.new
         
     | 
| 
      
 9 
     | 
    
         
            +
                  env = { 'MARKDO_ROOT' => 'test/fixtures' }
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
                  SummaryCommand.new(out, err, env).run
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
                  out.string.must_equal <<-XML
         
     | 
| 
      
 14 
     | 
    
         
            +
            Overdue: 2
         
     | 
| 
      
 15 
     | 
    
         
            +
            Star: 0
         
     | 
| 
      
 16 
     | 
    
         
            +
            Today: 0
         
     | 
| 
      
 17 
     | 
    
         
            +
            Tomorrow: 0
         
     | 
| 
      
 18 
     | 
    
         
            +
                  XML
         
     | 
| 
      
 19 
     | 
    
         
            +
                end
         
     | 
| 
      
 20 
     | 
    
         
            +
              end
         
     | 
| 
      
 21 
     | 
    
         
            +
            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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.5
         
     | 
| 
       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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-05-09 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     | 
| 
         @@ -68,6 +68,7 @@ files: 
     | 
|
| 
       68 
68 
     | 
    
         
             
            - README.md
         
     | 
| 
       69 
69 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       70 
70 
     | 
    
         
             
            - bin/markdo
         
     | 
| 
      
 71 
     | 
    
         
            +
            - configure
         
     | 
| 
       71 
72 
     | 
    
         
             
            - lib/markdo.rb
         
     | 
| 
       72 
73 
     | 
    
         
             
            - lib/markdo/add_command.rb
         
     | 
| 
       73 
74 
     | 
    
         
             
            - lib/markdo/cli.rb
         
     | 
| 
         @@ -81,6 +82,7 @@ files: 
     | 
|
| 
       81 
82 
     | 
    
         
             
            - lib/markdo/query_command.rb
         
     | 
| 
       82 
83 
     | 
    
         
             
            - lib/markdo/rss_command.rb
         
     | 
| 
       83 
84 
     | 
    
         
             
            - lib/markdo/star_command.rb
         
     | 
| 
      
 85 
     | 
    
         
            +
            - lib/markdo/summary_command.rb
         
     | 
| 
       84 
86 
     | 
    
         
             
            - lib/markdo/tag_command.rb
         
     | 
| 
       85 
87 
     | 
    
         
             
            - lib/markdo/today_command.rb
         
     | 
| 
       86 
88 
     | 
    
         
             
            - lib/markdo/tomorrow_command.rb
         
     | 
| 
         @@ -91,6 +93,7 @@ files: 
     | 
|
| 
       91 
93 
     | 
    
         
             
            - test/fixtures/rss_command.md
         
     | 
| 
       92 
94 
     | 
    
         
             
            - test/ics_command_test.rb
         
     | 
| 
       93 
95 
     | 
    
         
             
            - test/rss_command_test.rb
         
     | 
| 
      
 96 
     | 
    
         
            +
            - test/summary_command_test.rb
         
     | 
| 
       94 
97 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
       95 
98 
     | 
    
         
             
            homepage: http://github.com/benjaminoakes/markdo
         
     | 
| 
       96 
99 
     | 
    
         
             
            licenses:
         
     | 
| 
         @@ -121,4 +124,5 @@ test_files: 
     | 
|
| 
       121 
124 
     | 
    
         
             
            - test/fixtures/rss_command.md
         
     | 
| 
       122 
125 
     | 
    
         
             
            - test/ics_command_test.rb
         
     | 
| 
       123 
126 
     | 
    
         
             
            - test/rss_command_test.rb
         
     | 
| 
      
 127 
     | 
    
         
            +
            - test/summary_command_test.rb
         
     | 
| 
       124 
128 
     | 
    
         
             
            - test/test_helper.rb
         
     |