doing 2.1.41 → 2.1.44
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +67 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/bin/commands/again.rb +1 -3
- data/bin/commands/changes.rb +60 -34
- data/bin/commands/commands.rb +77 -52
- data/bin/commands/commands_accepting.rb +57 -53
- data/bin/commands/config.rb +2 -2
- data/bin/commands/finish.rb +94 -68
- data/bin/commands/flag.rb +5 -1
- data/bin/commands/grep.rb +12 -2
- data/bin/commands/last.rb +2 -0
- data/bin/commands/now.rb +151 -107
- data/bin/commands/on.rb +20 -5
- data/bin/commands/recent.rb +4 -1
- data/bin/commands/show.rb +8 -0
- data/bin/commands/since.rb +6 -2
- data/bin/commands/template.rb +14 -25
- data/bin/commands/today.rb +4 -1
- data/bin/commands/undo.rb +4 -6
- data/bin/commands/view.rb +36 -73
- data/bin/commands/views.rb +102 -5
- data/bin/commands/yesterday.rb +3 -1
- data/bin/doing +31 -4
- data/docs/doc/Array.html +14 -3
- 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/ArrayCleanup.html +316 -0
- data/docs/doc/Doing/ArrayNestedHash.html +1 -1
- data/docs/doc/Doing/ArrayTags.html +1 -1
- data/docs/doc/Doing/CSVExport.html +1 -1
- data/docs/doc/Doing/CalendarImport.html +1 -1
- data/docs/doc/Doing/Change.html +74 -3
- data/docs/doc/Doing/Changes.html +3 -3
- data/docs/doc/Doing/ChronifyArray.html +1 -1
- data/docs/doc/Doing/ChronifyNumeric.html +1 -1
- data/docs/doc/Doing/ChronifyString.html +1 -1
- data/docs/doc/Doing/Color.html +1 -1
- data/docs/doc/Doing/Completion/BashCompletions.html +1 -1
- data/docs/doc/Doing/Completion/FishCompletions.html +1 -1
- data/docs/doc/Doing/Completion/StringUtils.html +1 -1
- data/docs/doc/Doing/Completion/ZshCompletions.html +1 -1
- data/docs/doc/Doing/Completion.html +1 -1
- data/docs/doc/Doing/Configuration.html +82 -2
- data/docs/doc/Doing/DayOneRenderer.html +1 -1
- data/docs/doc/Doing/DayoneExport.html +1 -1
- data/docs/doc/Doing/DoingImport.html +1 -1
- data/docs/doc/Doing/Entry.html +109 -4
- 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/HistoryLimitError.html +1 -1
- data/docs/doc/Doing/Errors/InvalidPlugin.html +1 -1
- data/docs/doc/Doing/Errors/MissingBackupFile.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/HTMLExport.html +1 -1
- data/docs/doc/Doing/Hooks.html +1 -1
- data/docs/doc/Doing/Item.html +1 -1
- data/docs/doc/Doing/ItemDates.html +1 -1
- data/docs/doc/Doing/ItemQuery.html +1 -1
- data/docs/doc/Doing/ItemState.html +1 -1
- data/docs/doc/Doing/ItemTags.html +1 -1
- data/docs/doc/Doing/Items.html +2 -1
- data/docs/doc/Doing/JSONExport.html +1 -1
- data/docs/doc/Doing/Logger.html +1 -1
- data/docs/doc/Doing/MarkdownExport.html +1 -1
- data/docs/doc/Doing/Note.html +3 -2
- data/docs/doc/Doing/Pager.html +1 -1
- data/docs/doc/Doing/Plugins.html +181 -76
- data/docs/doc/Doing/Prompt.html +1 -1
- data/docs/doc/Doing/PromptChoose.html +1 -1
- data/docs/doc/Doing/PromptFZF.html +1 -1
- data/docs/doc/Doing/PromptInput.html +1 -1
- data/docs/doc/Doing/PromptSTD.html +1 -1
- data/docs/doc/Doing/PromptYN.html +1 -1
- data/docs/doc/Doing/Section.html +1 -1
- data/docs/doc/Doing/StringHighlight.html +1 -1
- data/docs/doc/Doing/StringNormalize.html +35 -1
- data/docs/doc/Doing/StringQuery.html +1 -1
- data/docs/doc/Doing/StringTags.html +1 -1
- data/docs/doc/Doing/StringTransform.html +35 -1
- data/docs/doc/Doing/StringTruncate.html +1 -1
- data/docs/doc/Doing/StringURL.html +1 -1
- data/docs/doc/Doing/SymbolNormalize.html +1 -1
- data/docs/doc/Doing/TaskPaperExport.html +1 -1
- data/docs/doc/Doing/TemplateExport.html +1 -1
- data/docs/doc/Doing/TemplateString.html +3 -3
- data/docs/doc/Doing/TimingImport.html +1 -1
- data/docs/doc/Doing/Types.html +23 -18
- data/docs/doc/Doing/Util/Backup.html +2 -156
- data/docs/doc/Doing/Util.html +66 -9
- data/docs/doc/Doing/Version.html +1 -1
- data/docs/doc/Doing/WWID.html +84 -3
- data/docs/doc/Doing.html +4 -4
- data/docs/doc/FalseClass.html +11 -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 +461 -6
- data/docs/doc/Numeric.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 +5 -5
- data/docs/doc/Symbol.html +1 -1
- data/docs/doc/Time.html +68 -3
- data/docs/doc/TrueClass.html +11 -1
- data/docs/doc/_index.html +16 -9
- data/docs/doc/class_list.html +1 -1
- data/docs/doc/file.README.html +2 -2
- data/docs/doc/index.html +2 -2
- data/docs/doc/method_list.html +529 -417
- data/docs/doc/top-level-namespace.html +11 -1
- data/doing.rdoc +169 -13
- data/lib/completion/_doing.zsh +13 -13
- data/lib/completion/doing.bash +22 -22
- data/lib/completion/doing.fish +24 -1
- data/lib/doing/add_options.rb +48 -1
- data/lib/doing/array/array.rb +2 -0
- data/lib/doing/array/cleanup.rb +31 -0
- data/lib/doing/changelog/change.rb +13 -5
- data/lib/doing/changelog/changes.rb +11 -2
- data/lib/doing/changelog/entry.rb +9 -2
- data/lib/doing/configuration.rb +28 -3
- data/lib/doing/good.rb +18 -1
- data/lib/doing/hash.rb +126 -22
- data/lib/doing/normalize.rb +13 -0
- data/lib/doing/note.rb +1 -1
- data/lib/doing/pager.rb +9 -3
- data/lib/doing/plugin_manager.rb +30 -5
- data/lib/doing/prompt/choose.rb +1 -1
- data/lib/doing/prompt/input.rb +1 -1
- data/lib/doing/string/transform.rb +6 -0
- data/lib/doing/types.rb +9 -8
- data/lib/doing/util.rb +12 -6
- data/lib/doing/util_backup.rb +55 -48
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid/display.rb +4 -1
- data/lib/doing/wwid/editor.rb +6 -3
- data/lib/doing/wwid/interactive.rb +10 -20
- data/lib/doing/wwid/modify.rb +2 -0
- data/lib/doing/wwid/wwid.rb +21 -3
- data/lib/doing.rb +12 -3
- metadata +4 -2
data/lib/doing/wwid/editor.rb
CHANGED
@@ -12,7 +12,7 @@ module Doing
|
|
12
12
|
|
13
13
|
raise MissingEditor, 'No EDITOR variable defined in environment' if Util.default_editor.nil?
|
14
14
|
|
15
|
-
tmpfile = Tempfile.new(['
|
15
|
+
tmpfile = Tempfile.new(['doing_temp', '.doing'])
|
16
16
|
|
17
17
|
File.open(tmpfile.path, 'w+') do |f|
|
18
18
|
f.puts input
|
@@ -134,14 +134,15 @@ module Doing
|
|
134
134
|
end
|
135
135
|
divider = "-----------"
|
136
136
|
notice =<<~EONOTICE
|
137
|
+
|
137
138
|
# - You may delete entries, but leave all divider lines (---) in place.
|
138
139
|
# - Start and @done dates replaced with a time string (yesterday 3pm) will
|
139
140
|
# be parsed automatically. Do not delete the pipe (|) between start date
|
140
141
|
# and entry title.
|
141
142
|
EONOTICE
|
142
|
-
input = "#{editable_items.map(&:strip).join("\n#{divider}\n")}\n
|
143
|
+
input = "#{editable_items.map(&:strip).join("\n#{divider}\n")}\n"
|
143
144
|
|
144
|
-
new_items = fork_editor(input).split(/^#{divider}/).map(&:strip)
|
145
|
+
new_items = fork_editor(input, message: notice).split(/^#{divider}/).map(&:strip)
|
145
146
|
|
146
147
|
new_items.each_with_index do |new_item, i|
|
147
148
|
input_lines = new_item.split(/[\n\r]+/).delete_if(&:ignore?)
|
@@ -190,6 +191,8 @@ module Doing
|
|
190
191
|
content = ["#{item.date.strftime('%F %R')} | #{item.title.dup}"]
|
191
192
|
content << item.note.strip_lines.join("\n") unless item.note.empty?
|
192
193
|
new_item = fork_editor(content.join("\n"))
|
194
|
+
raise UserCancelled, 'No change' if new_item.strip == content.join("\n").strip
|
195
|
+
|
193
196
|
date, title, note = format_input(new_item)
|
194
197
|
date ||= item.date
|
195
198
|
|
@@ -92,22 +92,21 @@ module Doing
|
|
92
92
|
|
93
93
|
actions.concat(['resume/repeat', 'begin/reset']) if items.count == 1
|
94
94
|
|
95
|
-
choice = Prompt.choose_from(actions,
|
95
|
+
choice = Prompt.choose_from(actions.map(&:titlecase),
|
96
96
|
prompt: 'What do you want to do with the selected items? > ',
|
97
97
|
multiple: true,
|
98
98
|
sorted: false,
|
99
99
|
fzf_args: ["--height=#{actions.count + 3}", '--tac', '--no-sort', '--info=hidden'])
|
100
100
|
return unless choice
|
101
101
|
|
102
|
-
to_do = choice.strip.split(/\n/)
|
102
|
+
to_do = choice.strip.split(/\n/).map(&:downcase)
|
103
|
+
|
103
104
|
to_do.each do |action|
|
104
105
|
case action
|
105
|
-
when /resume/
|
106
|
-
opt[
|
107
|
-
when /
|
108
|
-
opt[:
|
109
|
-
when /autotag/
|
110
|
-
opt[:autotag] = true
|
106
|
+
when /(resume|reset|autotag|archive|delete|finish|cancel|flag)/
|
107
|
+
opt[action.to_sym] = true
|
108
|
+
when /edit/
|
109
|
+
opt[:editor] = true
|
111
110
|
when /(add|remove) tag/
|
112
111
|
type = action =~ /^add/ ? 'add' : 'remove'
|
113
112
|
raise InvalidArgument, "'add tag' and 'remove tag' can not be used together" if opt[:tag]
|
@@ -149,21 +148,9 @@ module Doing
|
|
149
148
|
|
150
149
|
opt[:save_to] = filename
|
151
150
|
end
|
152
|
-
when /archive/
|
153
|
-
opt[:archive] = true
|
154
|
-
when /delete/
|
155
|
-
opt[:delete] = true
|
156
|
-
when /edit/
|
157
|
-
opt[:editor] = true
|
158
|
-
when /finish/
|
159
|
-
opt[:finish] = true
|
160
|
-
when /cancel/
|
161
|
-
opt[:cancel] = true
|
162
151
|
when /move/
|
163
152
|
section = choose_section.strip
|
164
153
|
opt[:move] = section.strip unless section =~ /^ *$/
|
165
|
-
when /flag/
|
166
|
-
opt[:flag] = true
|
167
154
|
end
|
168
155
|
end
|
169
156
|
end
|
@@ -263,6 +250,9 @@ module Doing
|
|
263
250
|
write(@doing_file)
|
264
251
|
|
265
252
|
if opt[:editor]
|
253
|
+
sleep 2 # This seems to be necessary between running fzf
|
254
|
+
# and forking the editor, otherwise vim gets all
|
255
|
+
# screwy and I can't figure out why
|
266
256
|
edit_items(items) # hooked
|
267
257
|
|
268
258
|
write(@doing_file)
|
data/lib/doing/wwid/modify.rb
CHANGED
data/lib/doing/wwid/wwid.rb
CHANGED
@@ -100,10 +100,28 @@ module Doing
|
|
100
100
|
##
|
101
101
|
## @param title [String] The title of the view to retrieve
|
102
102
|
##
|
103
|
-
def get_view(title)
|
104
|
-
|
103
|
+
def get_view(title, fallback: nil)
|
104
|
+
Doing.setting(['views', title], fallback)
|
105
|
+
end
|
106
|
+
|
107
|
+
def rename_view_keys(view)
|
108
|
+
options = view.symbolize_keys
|
109
|
+
# options.rename_key(:tags, :tag, keep: true)
|
110
|
+
options.rename_key(:output_format, :output)
|
111
|
+
options.rename_key(:tags_bool, :bool)
|
112
|
+
options.rename_key(:tag_sort, :sort_tags)
|
113
|
+
options.rename_key(:negate, :not)
|
114
|
+
options.rename_key(:order, :sort)
|
115
|
+
|
116
|
+
options
|
117
|
+
end
|
105
118
|
|
106
|
-
|
119
|
+
def view_to_options(title)
|
120
|
+
view = rename_view_keys(get_view(guess_view(title)))
|
121
|
+
view.deep_merge(rename_view_keys(get_view(guess_view(view[:parent]), fallback: {}))) if view.key?(:parent)
|
122
|
+
view.deep_merge(rename_view_keys(get_view(view[:config_template], fallback: {}))) if view.key?(:config_template)
|
123
|
+
view.deep_merge(Doing.setting('templates.default').symbolize_keys)
|
124
|
+
view
|
107
125
|
end
|
108
126
|
|
109
127
|
private
|
data/lib/doing.rb
CHANGED
@@ -24,10 +24,9 @@ require 'tty-markdown'
|
|
24
24
|
require 'tty-reader'
|
25
25
|
require 'tty-screen'
|
26
26
|
|
27
|
-
require_relative 'doing/changelog/changelog'
|
28
|
-
require_relative 'doing/hash'
|
29
|
-
require_relative 'doing/types'
|
30
27
|
require_relative 'doing/colors'
|
28
|
+
require_relative 'doing/types'
|
29
|
+
require_relative 'doing/hash'
|
31
30
|
require_relative 'doing/template_string'
|
32
31
|
require_relative 'doing/string/string'
|
33
32
|
require_relative 'doing/time'
|
@@ -35,6 +34,7 @@ require_relative 'doing/array/array'
|
|
35
34
|
require_relative 'doing/good'
|
36
35
|
require_relative 'doing/normalize'
|
37
36
|
require_relative 'doing/util'
|
37
|
+
require_relative 'doing/changelog/changelog'
|
38
38
|
require_relative 'doing/util_backup'
|
39
39
|
require_relative 'doing/configuration'
|
40
40
|
require_relative 'doing/section'
|
@@ -85,6 +85,15 @@ module Doing
|
|
85
85
|
config.settings
|
86
86
|
end
|
87
87
|
|
88
|
+
def original_options
|
89
|
+
@original_options ||= {
|
90
|
+
date_begin: nil,
|
91
|
+
date_end: nil,
|
92
|
+
date_range: nil,
|
93
|
+
date_interval: nil
|
94
|
+
}
|
95
|
+
end
|
96
|
+
|
88
97
|
##
|
89
98
|
## Fetch a config setting using a dot-separated keypath
|
90
99
|
## or array of keys
|
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.44
|
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-03-
|
11
|
+
date: 2022-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: github-markup
|
@@ -489,6 +489,7 @@ files:
|
|
489
489
|
- docs/doc/BooleanTermParser/QueryParser.html
|
490
490
|
- docs/doc/BooleanTermParser/QueryTransformer.html
|
491
491
|
- docs/doc/Doing.html
|
492
|
+
- docs/doc/Doing/ArrayCleanup.html
|
492
493
|
- docs/doc/Doing/ArrayNestedHash.html
|
493
494
|
- docs/doc/Doing/ArrayTags.html
|
494
495
|
- docs/doc/Doing/CLIFormat.html
|
@@ -623,6 +624,7 @@ files:
|
|
623
624
|
- lib/doing.rb
|
624
625
|
- lib/doing/add_options.rb
|
625
626
|
- lib/doing/array/array.rb
|
627
|
+
- lib/doing/array/cleanup.rb
|
626
628
|
- lib/doing/array/nested_hash.rb
|
627
629
|
- lib/doing/array/tags.rb
|
628
630
|
- lib/doing/boolean_term_parser.rb
|