doing 2.1.33 → 2.1.34
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/CHANGELOG.md +23 -0
- data/Gemfile.lock +1 -1
- data/bin/commands/config.rb +9 -9
- data/bin/commands/done.rb +1 -1
- data/bin/commands/grep.rb +2 -29
- data/bin/commands/meanwhile.rb +1 -1
- data/bin/commands/now.rb +1 -1
- data/bin/commands/on.rb +6 -16
- data/bin/commands/recent.rb +2 -14
- data/bin/commands/rotate.rb +17 -0
- data/bin/commands/sections.rb +82 -7
- data/bin/commands/show.rb +1 -21
- data/bin/commands/since.rb +5 -16
- data/bin/commands/today.rb +3 -28
- data/bin/commands/yesterday.rb +2 -35
- data/bin/doing +5 -6
- data/docs/doc/Array.html +1 -1
- data/docs/doc/BooleanTermParser/Clause.html +1 -1
- data/docs/doc/BooleanTermParser/Operator.html +1 -1
- data/docs/doc/BooleanTermParser/Query.html +1 -1
- data/docs/doc/BooleanTermParser/QueryParser.html +1 -1
- data/docs/doc/BooleanTermParser/QueryTransformer.html +1 -1
- data/docs/doc/BooleanTermParser.html +1 -1
- data/docs/doc/Doing/Color.html +1 -1
- data/docs/doc/Doing/Completion.html +1 -1
- data/docs/doc/Doing/Configuration.html +1 -1
- data/docs/doc/Doing/Errors/DoingNoTraceError.html +1 -1
- data/docs/doc/Doing/Errors/DoingRuntimeError.html +1 -1
- data/docs/doc/Doing/Errors/DoingStandardError.html +1 -1
- data/docs/doc/Doing/Errors/EmptyInput.html +1 -1
- data/docs/doc/Doing/Errors/NoResults.html +1 -1
- data/docs/doc/Doing/Errors/PluginException.html +1 -1
- data/docs/doc/Doing/Errors/UserCancelled.html +1 -1
- data/docs/doc/Doing/Errors/WrongCommand.html +1 -1
- data/docs/doc/Doing/Errors.html +1 -1
- data/docs/doc/Doing/Hooks.html +1 -1
- data/docs/doc/Doing/Item.html +20 -3
- data/docs/doc/Doing/Items.html +209 -1
- data/docs/doc/Doing/Logger.html +1807 -0
- data/docs/doc/Doing/Note.html +1 -1
- data/docs/doc/Doing/Pager.html +1 -1
- data/docs/doc/Doing/Plugins.html +1 -1
- data/docs/doc/Doing/Prompt.html +1 -1
- data/docs/doc/Doing/Section.html +1 -1
- data/docs/doc/Doing/TemplateString.html +1 -1
- data/docs/doc/Doing/Types.html +2 -2
- data/docs/doc/Doing/Util/Backup.html +1 -1
- data/docs/doc/Doing/Util.html +1 -1
- data/docs/doc/Doing/WWID.html +3 -53
- data/docs/doc/Doing.html +4 -4
- data/docs/doc/FalseClass.html +1 -1
- data/docs/doc/GLI/Commands/Help.html +1 -1
- data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +1 -1
- data/docs/doc/GLI/Commands.html +1 -1
- data/docs/doc/GLI.html +1 -1
- data/docs/doc/Hash.html +1 -1
- data/docs/doc/Object.html +1 -1
- data/docs/doc/PhraseParser/Operator.html +1 -1
- data/docs/doc/PhraseParser/PhraseClause.html +1 -1
- data/docs/doc/PhraseParser/Query.html +1 -1
- data/docs/doc/PhraseParser/QueryParser.html +1 -1
- data/docs/doc/PhraseParser/QueryTransformer.html +1 -1
- data/docs/doc/PhraseParser/TermClause.html +1 -1
- data/docs/doc/PhraseParser.html +1 -1
- data/docs/doc/Status.html +1 -1
- data/docs/doc/String.html +1 -1
- data/docs/doc/Symbol.html +1 -1
- data/docs/doc/Time.html +1 -1
- data/docs/doc/TrueClass.html +1 -1
- data/docs/doc/_index.html +10 -10
- data/docs/doc/class_list.html +1 -1
- data/docs/doc/file.README.html +1 -1
- data/docs/doc/index.html +1 -1
- data/docs/doc/method_list.html +407 -383
- data/docs/doc/top-level-namespace.html +1 -1
- data/doing.rdoc +229 -17
- data/lib/completion/_doing.zsh +11 -15
- data/lib/completion/doing.bash +12 -23
- data/lib/completion/doing.fish +38 -12
- data/lib/doing/add_options.rb +36 -1
- data/lib/doing/chronify/string.rb +1 -1
- data/lib/doing/item.rb +9 -2
- data/lib/doing/items.rb +48 -0
- data/lib/doing/{log_adapter.rb → logger.rb} +8 -2
- data/lib/doing/plugins/import/calendar_import.rb +1 -1
- data/lib/doing/plugins/import/doing_import.rb +1 -1
- data/lib/doing/plugins/import/timing_import.rb +1 -1
- data/lib/doing/string/tags.rb +1 -1
- data/lib/doing/types.rb +1 -1
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +43 -43
- data/lib/doing.rb +4 -3
- data/lib/examples/plugins/capture_thing_import.rb +1 -1
- metadata +4 -4
- data/bin/commands/add_section.rb +0 -15
data/lib/doing/wwid.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Doing
|
|
|
14
14
|
class WWID
|
|
15
15
|
attr_reader :additional_configs, :current_section, :doing_file, :content
|
|
16
16
|
|
|
17
|
-
attr_accessor :config, :config_file, :
|
|
17
|
+
attr_accessor :config, :config_file, :default_option
|
|
18
18
|
|
|
19
19
|
include Color
|
|
20
20
|
# include Util
|
|
@@ -26,7 +26,12 @@ module Doing
|
|
|
26
26
|
@timers = {}
|
|
27
27
|
@recorded_items = []
|
|
28
28
|
@content = Items.new
|
|
29
|
-
|
|
29
|
+
Doing.auto_tag = true
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# For backwards compatibility where @wwid.config was accessed instead of Doing.config.settings
|
|
33
|
+
def config
|
|
34
|
+
Doing.config.settings
|
|
30
35
|
end
|
|
31
36
|
|
|
32
37
|
##
|
|
@@ -354,7 +359,7 @@ module Doing
|
|
|
354
359
|
title = [title.strip.cap_first]
|
|
355
360
|
title = title.join(' ')
|
|
356
361
|
|
|
357
|
-
if
|
|
362
|
+
if Doing.auto_tag
|
|
358
363
|
title = autotag(title)
|
|
359
364
|
title.add_tags!(Doing.setting('default_tags')) if Doing.setting('default_tags').good?
|
|
360
365
|
end
|
|
@@ -499,7 +504,7 @@ module Doing
|
|
|
499
504
|
# Remove @done tag
|
|
500
505
|
title = item.title.sub(/\s*@done(\(.*?\))?/, '').chomp
|
|
501
506
|
section = opt[:in].nil? ? item.section : guess_section(opt[:in])
|
|
502
|
-
|
|
507
|
+
Doing.auto_tag = false
|
|
503
508
|
|
|
504
509
|
note = opt[:note] || Note.new
|
|
505
510
|
|
|
@@ -667,12 +672,14 @@ module Doing
|
|
|
667
672
|
items = section =~ /^all$/i ? @content.clone : @content.in_section(section)
|
|
668
673
|
end
|
|
669
674
|
|
|
670
|
-
opt[:time_filter]
|
|
671
|
-
|
|
672
|
-
if opt[:from]
|
|
673
|
-
opt[:
|
|
674
|
-
|
|
675
|
-
|
|
675
|
+
if !opt[:time_filter]
|
|
676
|
+
opt[:time_filter] = [nil, nil]
|
|
677
|
+
if opt[:from] && !opt[:date_filter]
|
|
678
|
+
if opt[:from][0].is_a?(String) && opt[:from][0] =~ time_rx
|
|
679
|
+
opt[:time_filter] = opt[:from]
|
|
680
|
+
elsif opt[:from][0].is_a?(Time)
|
|
681
|
+
opt[:date_filter] = opt[:from]
|
|
682
|
+
end
|
|
676
683
|
end
|
|
677
684
|
end
|
|
678
685
|
|
|
@@ -1255,7 +1262,7 @@ module Doing
|
|
|
1255
1262
|
removed = []
|
|
1256
1263
|
|
|
1257
1264
|
if opt[:autotag]
|
|
1258
|
-
new_title = autotag(item.title) if
|
|
1265
|
+
new_title = autotag(item.title) if Doing.auto_tag
|
|
1259
1266
|
if new_title == item.title
|
|
1260
1267
|
logger.count(:skipped, level: :debug, message: '%count unchaged %items')
|
|
1261
1268
|
# logger.debug('Autotag:', 'No changes')
|
|
@@ -1653,6 +1660,7 @@ module Doing
|
|
|
1653
1660
|
opt[:tag_order] ||= :asc
|
|
1654
1661
|
opt[:tags_color] = cfg['tags_color'] || false if opt[:tags_color].nil?
|
|
1655
1662
|
opt[:template] ||= cfg['template']
|
|
1663
|
+
opt[:sort_tags] ||= opt[:tag_sort]
|
|
1656
1664
|
|
|
1657
1665
|
# opt[:highlight] ||= true
|
|
1658
1666
|
title = ''
|
|
@@ -1768,6 +1776,7 @@ module Doing
|
|
|
1768
1776
|
from: opt[:from],
|
|
1769
1777
|
format: cfg['date_format'],
|
|
1770
1778
|
interval_format: opt[:interval_format],
|
|
1779
|
+
only_timed: opt[:only_timed],
|
|
1771
1780
|
order: cfg['order'] || :asc,
|
|
1772
1781
|
output: output,
|
|
1773
1782
|
section: opt[:section],
|
|
@@ -1800,19 +1809,19 @@ module Doing
|
|
|
1800
1809
|
# :date_filter expects an array with start and end date
|
|
1801
1810
|
dates = dates.split_date_range if dates.instance_of?(String)
|
|
1802
1811
|
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1812
|
+
opt[:section] = section
|
|
1813
|
+
opt[:count] = 0
|
|
1814
|
+
opt[:order] = :asc
|
|
1815
|
+
opt[:date_filter] = dates
|
|
1816
|
+
opt[:times] = times
|
|
1817
|
+
opt[:output] = output
|
|
1818
|
+
|
|
1819
|
+
time_rx = /^(\d{1,2}+(:\d{1,2}+)?( *(am|pm))?|midnight|noon)$/
|
|
1820
|
+
if opt[:from] && opt[:from][0].is_a?(String) && opt[:from][0] =~ time_rx
|
|
1821
|
+
opt[:time_filter] = opt[:from]
|
|
1822
|
+
end
|
|
1823
|
+
|
|
1824
|
+
list_section(opt)
|
|
1816
1825
|
end
|
|
1817
1826
|
|
|
1818
1827
|
##
|
|
@@ -1827,30 +1836,20 @@ module Doing
|
|
|
1827
1836
|
opt ||= {}
|
|
1828
1837
|
opt[:totals] ||= false
|
|
1829
1838
|
opt[:sort_tags] ||= false
|
|
1839
|
+
opt[:config_template] ||= 'today'
|
|
1840
|
+
opt[:yesterday] = true
|
|
1841
|
+
|
|
1830
1842
|
section = guess_section(section)
|
|
1831
1843
|
y = (Time.now - (60 * 60 * 24)).strftime('%Y-%m-%d')
|
|
1832
1844
|
opt[:after] = "#{y} #{opt[:after]}" if opt[:after]
|
|
1833
1845
|
opt[:before] = "#{y} #{opt[:before]}" if opt[:before]
|
|
1834
1846
|
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
duration: opt[:duration],
|
|
1840
|
-
from: opt[:from],
|
|
1841
|
-
order: opt[:order],
|
|
1842
|
-
output: output,
|
|
1843
|
-
section: section,
|
|
1844
|
-
sort_tags: opt[:sort_tags],
|
|
1845
|
-
tag_order: opt[:tag_order],
|
|
1846
|
-
times: times,
|
|
1847
|
-
totals: opt[:totals],
|
|
1848
|
-
yesterday: true,
|
|
1849
|
-
config_template: opt[:config_template] || 'today',
|
|
1850
|
-
template: opt[:template]
|
|
1851
|
-
}
|
|
1847
|
+
opt[:output] = output
|
|
1848
|
+
opt[:section] = section
|
|
1849
|
+
opt[:times] = times
|
|
1850
|
+
opt[:count] = 0
|
|
1852
1851
|
|
|
1853
|
-
list_section(
|
|
1852
|
+
list_section(opt)
|
|
1854
1853
|
end
|
|
1855
1854
|
|
|
1856
1855
|
##
|
|
@@ -1947,7 +1946,7 @@ module Doing
|
|
|
1947
1946
|
##
|
|
1948
1947
|
def autotag(string)
|
|
1949
1948
|
return unless string
|
|
1950
|
-
return string unless
|
|
1949
|
+
return string unless Doing.auto_tag
|
|
1951
1950
|
|
|
1952
1951
|
original = string.dup
|
|
1953
1952
|
text = string.dup
|
|
@@ -2250,6 +2249,7 @@ EOTAIL
|
|
|
2250
2249
|
output = @other_content_top ? "#{@other_content_top.join("\n")}\n" : ''
|
|
2251
2250
|
was_color = Color.coloring?
|
|
2252
2251
|
Color.coloring = false
|
|
2252
|
+
@content.dedup!(match_section: true)
|
|
2253
2253
|
output += @content.to_s
|
|
2254
2254
|
output += @other_content_bottom.join("\n") unless @other_content_bottom.nil?
|
|
2255
2255
|
# Just strip all ANSI colors from the content before writing to doing file
|
data/lib/doing.rb
CHANGED
|
@@ -42,7 +42,7 @@ require_relative 'doing/items'
|
|
|
42
42
|
require_relative 'doing/note'
|
|
43
43
|
require_relative 'doing/item'
|
|
44
44
|
require_relative 'doing/wwid'
|
|
45
|
-
require_relative 'doing/
|
|
45
|
+
require_relative 'doing/logger'
|
|
46
46
|
require_relative 'doing/prompt'
|
|
47
47
|
require_relative 'doing/errors'
|
|
48
48
|
require_relative 'doing/hooks'
|
|
@@ -57,13 +57,14 @@ require_relative 'doing/chronify/chronify'
|
|
|
57
57
|
# Main doing module
|
|
58
58
|
module Doing
|
|
59
59
|
class << self
|
|
60
|
+
attr_accessor :auto_tag
|
|
60
61
|
#
|
|
61
62
|
# Fetch the logger
|
|
62
63
|
#
|
|
63
|
-
# @return the
|
|
64
|
+
# @return the Logger instance.
|
|
64
65
|
#
|
|
65
66
|
def logger
|
|
66
|
-
@logger ||=
|
|
67
|
+
@logger ||= Logger.new((ENV['DOING_LOG_LEVEL'] || :info).to_sym)
|
|
67
68
|
end
|
|
68
69
|
|
|
69
70
|
##
|
|
@@ -33,7 +33,7 @@ module Doing
|
|
|
33
33
|
raise InvalidArgument, 'Path is not a directory' unless File.directory?(path)
|
|
34
34
|
|
|
35
35
|
options[:no_overlap] ||= false
|
|
36
|
-
options[:autotag] ||=
|
|
36
|
+
options[:autotag] ||= Doing.auto_tag
|
|
37
37
|
|
|
38
38
|
tags = options[:tag] ? options[:tag].split(/[ ,]+/).map { |t| t.sub(/^@?/, '') } : []
|
|
39
39
|
options[:tag] = nil
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: doing
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.34
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brett Terpstra
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-02-
|
|
11
|
+
date: 2022-02-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: github-markup
|
|
@@ -458,7 +458,6 @@ files:
|
|
|
458
458
|
- Rakefile
|
|
459
459
|
- _config.yml
|
|
460
460
|
- bash_profile
|
|
461
|
-
- bin/commands/add_section.rb
|
|
462
461
|
- bin/commands/again.rb
|
|
463
462
|
- bin/commands/archive.rb
|
|
464
463
|
- bin/commands/cancel.rb
|
|
@@ -527,6 +526,7 @@ files:
|
|
|
527
526
|
- docs/doc/Doing/Item.html
|
|
528
527
|
- docs/doc/Doing/Items.html
|
|
529
528
|
- docs/doc/Doing/LogAdapter.html
|
|
529
|
+
- docs/doc/Doing/Logger.html
|
|
530
530
|
- docs/doc/Doing/Note.html
|
|
531
531
|
- docs/doc/Doing/Pager.html
|
|
532
532
|
- docs/doc/Doing/Plugins.html
|
|
@@ -614,7 +614,7 @@ files:
|
|
|
614
614
|
- lib/doing/hooks.rb
|
|
615
615
|
- lib/doing/item.rb
|
|
616
616
|
- lib/doing/items.rb
|
|
617
|
-
- lib/doing/
|
|
617
|
+
- lib/doing/logger.rb
|
|
618
618
|
- lib/doing/markdown_document_listener.rb
|
|
619
619
|
- lib/doing/normalize.rb
|
|
620
620
|
- lib/doing/note.rb
|
data/bin/commands/add_section.rb
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# @@add_section
|
|
4
|
-
desc 'Add a new section to the "doing" file'
|
|
5
|
-
arg_name 'SECTION_NAME'
|
|
6
|
-
command :add_section do |c|
|
|
7
|
-
c.example 'doing add_section Ideas', desc: 'Add a section called Ideas to the doing file'
|
|
8
|
-
|
|
9
|
-
c.action do |_global_options, _options, args|
|
|
10
|
-
raise InvalidArgument, "Section #{args[0]} already exists" if @wwid.sections.include?(args[0])
|
|
11
|
-
|
|
12
|
-
@wwid.content.add_section(args.join(' ').cap_first, log: true)
|
|
13
|
-
@wwid.write(@wwid.doing_file)
|
|
14
|
-
end
|
|
15
|
-
end
|