todo-jsonl 0.1.28 → 0.1.29
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/bin/todo.rb +11 -11
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 2af368dfb4ac9e0f8e6448e005bb7242c509d6bf0ce1e97bdc8783629c3dd77f
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: dc5f0da8574ea5bda98627c122e9a0bdc7c3d661cba879c4ac09bff3cdb075ba
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 1d0b4562ca3af2722f5fb2eb594f248ccaf2b69b18eb2a7f2e19f386da1f60352260631a7afd53e5cf375a3f7c37297a85808a701870b0c2eb73efe9797416e8
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 030be81b91d66d0d084dff2c805df49cc1f2705aa020d607a06003d542a139e0f6b6708d307a6e448e14c0ca76b135878e643c5ab54132ac457be506cea43b4f
         
     | 
    
        data/bin/todo.rb
    CHANGED
    
    | 
         @@ -129,6 +129,7 @@ class Todo 
     | 
|
| 
       129 
129 
     | 
    
         
             
                rescue => error
         
     | 
| 
       130 
130 
     | 
    
         
             
                  puts "#{colorize('ERROR:', :red)} #{error}"
         
     | 
| 
       131 
131 
     | 
    
         
             
                end
         
     | 
| 
      
 132 
     | 
    
         
            +
                self
         
     | 
| 
       132 
133 
     | 
    
         
             
              end
         
     | 
| 
       133 
134 
     | 
    
         | 
| 
       134 
135 
     | 
    
         
             
              private
         
     | 
| 
         @@ -177,15 +178,15 @@ class Todo 
     | 
|
| 
       177 
178 
     | 
    
         
             
                due_dates_for_queries = next_7_days.map do |day| day.strftime(DATE_FORMAT) end
         
     | 
| 
       178 
179 
     | 
    
         | 
| 
       179 
180 
     | 
    
         
             
                @queries = {
         
     | 
| 
       180 
     | 
    
         
            -
                  ':active'    =>  
     | 
| 
       181 
     | 
    
         
            -
                  ':done'      => ' 
     | 
| 
       182 
     | 
    
         
            -
                  ':blocked'   => ' 
     | 
| 
       183 
     | 
    
         
            -
                  ':started'   => ' 
     | 
| 
       184 
     | 
    
         
            -
                  ':new'       => ' 
     | 
| 
       185 
     | 
    
         
            -
                  ':all'       =>  
     | 
| 
       186 
     | 
    
         
            -
                  ':today'     =>  
     | 
| 
       187 
     | 
    
         
            -
                  ':tomorrow'  =>  
     | 
| 
       188 
     | 
    
         
            -
                  ':next7days' =>  
     | 
| 
      
 181 
     | 
    
         
            +
                  ':active'    => lambda do |task| /(new|started|blocked)/.match(task[:state]) end,
         
     | 
| 
      
 182 
     | 
    
         
            +
                  ':done'      => lambda do |task| 'done' == task[:state] end,
         
     | 
| 
      
 183 
     | 
    
         
            +
                  ':blocked'   => lambda do |task| 'blocked' == task[:state] end,
         
     | 
| 
      
 184 
     | 
    
         
            +
                  ':started'   => lambda do |task| 'started' == task[:state] end,
         
     | 
| 
      
 185 
     | 
    
         
            +
                  ':new'       => lambda do |task| 'new' == task[:state] end,
         
     | 
| 
      
 186 
     | 
    
         
            +
                  ':all'       => lambda do |task| /\w+/.match(task[:state]) end,
         
     | 
| 
      
 187 
     | 
    
         
            +
                  ':today'     => lambda do |task| due_dates_for_queries[0] == task[:due] end,
         
     | 
| 
      
 188 
     | 
    
         
            +
                  ':tomorrow'  => lambda do |task| due_dates_for_queries[1] == task[:due] end,
         
     | 
| 
      
 189 
     | 
    
         
            +
                  ':next7days' => lambda do |task| /(#{due_dates_for_queries.join('|')})/.match(task[:due]) end
         
     | 
| 
       189 
190 
     | 
    
         
             
                }
         
     | 
| 
       190 
191 
     | 
    
         
             
              end
         
     | 
| 
       191 
192 
     | 
    
         | 
| 
         @@ -374,10 +375,9 @@ class Todo 
     | 
|
| 
       374 
375 
     | 
    
         
             
              def filter_tasks(tasks, patterns)
         
     | 
| 
       375 
376 
     | 
    
         
             
                items = {}
         
     | 
| 
       376 
377 
     | 
    
         
             
                tasks.each do |num, task|
         
     | 
| 
       377 
     | 
    
         
            -
                  normalized_task = "state=#{task[:state]} due=#{task[:due]} #{task[:title]}"
         
     | 
| 
       378 
378 
     | 
    
         
             
                  match = true
         
     | 
| 
       379 
379 
     | 
    
         
             
                  patterns.each do |pattern|
         
     | 
| 
       380 
     | 
    
         
            -
                    match = false unless  
     | 
| 
      
 380 
     | 
    
         
            +
                    match = false unless @queries[pattern] ? @queries[pattern].call(task) : /#{pattern}/ix.match(task[:title])
         
     | 
| 
       381 
381 
     | 
    
         
             
                  end
         
     | 
| 
       382 
382 
     | 
    
         
             
                  items[num] = task if match
         
     | 
| 
       383 
383 
     | 
    
         
             
                end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: todo-jsonl
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.29
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Gabor Bata
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2021-03- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-03-10 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: 
         
     | 
| 
       14 
14 
     | 
    
         
             
            email: 
         
     |