doing 2.1.86 → 2.1.88
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +46 -11
- data/README.md +1 -1
- data/bin/commands/changes.rb +1 -0
- data/docs/doc/Array.html +2 -2
- data/docs/doc/BooleanTermParser/Clause.html +2 -2
- data/docs/doc/BooleanTermParser/Operator.html +2 -2
- data/docs/doc/BooleanTermParser/Query.html +2 -2
- data/docs/doc/BooleanTermParser/QueryParser.html +2 -2
- data/docs/doc/BooleanTermParser/QueryTransformer.html +2 -2
- data/docs/doc/BooleanTermParser.html +2 -2
- data/docs/doc/Doing/ArrayCleanup.html +2 -2
- data/docs/doc/Doing/ArrayNestedHash.html +2 -2
- data/docs/doc/Doing/ArrayTags.html +2 -2
- data/docs/doc/Doing/ByDayExport.html +2 -2
- data/docs/doc/Doing/CSVExport.html +2 -2
- data/docs/doc/Doing/CalendarImport.html +2 -2
- data/docs/doc/Doing/Change.html +4 -4
- data/docs/doc/Doing/Changes.html +4 -4
- data/docs/doc/Doing/ChronifyArray.html +2 -2
- data/docs/doc/Doing/ChronifyNumeric.html +2 -2
- data/docs/doc/Doing/ChronifyString.html +2 -2
- data/docs/doc/Doing/Color.html +2 -2
- data/docs/doc/Doing/Completion/BashCompletions.html +2 -2
- data/docs/doc/Doing/Completion/FigCompletions.html +2 -2
- data/docs/doc/Doing/Completion/FishCompletions.html +2 -2
- data/docs/doc/Doing/Completion/StringUtils.html +2 -2
- data/docs/doc/Doing/Completion/ZshCompletions.html +2 -2
- data/docs/doc/Doing/Completion.html +2 -2
- data/docs/doc/Doing/Configuration.html +2 -2
- data/docs/doc/Doing/DayOneRenderer.html +2 -2
- data/docs/doc/Doing/DayoneExport.html +2 -2
- data/docs/doc/Doing/DoingExport.html +2 -2
- data/docs/doc/Doing/DoingImport.html +2 -2
- data/docs/doc/Doing/Entry.html +2 -2
- data/docs/doc/Doing/Errors/DoingNoTraceError.html +2 -2
- data/docs/doc/Doing/Errors/DoingRuntimeError.html +2 -2
- data/docs/doc/Doing/Errors/DoingStandardError.html +2 -2
- data/docs/doc/Doing/Errors/EmptyInput.html +2 -2
- data/docs/doc/Doing/Errors/HistoryLimitError.html +2 -2
- data/docs/doc/Doing/Errors/InvalidPlugin.html +2 -2
- data/docs/doc/Doing/Errors/MissingBackupFile.html +2 -2
- data/docs/doc/Doing/Errors/NoResults.html +2 -2
- data/docs/doc/Doing/Errors/PluginException.html +2 -2
- data/docs/doc/Doing/Errors/UserCancelled.html +2 -2
- data/docs/doc/Doing/Errors/WrongCommand.html +2 -2
- data/docs/doc/Doing/Errors.html +2 -2
- data/docs/doc/Doing/HTMLExport.html +2 -2
- data/docs/doc/Doing/Hooks.html +2 -2
- data/docs/doc/Doing/Item.html +4 -4
- data/docs/doc/Doing/ItemDates.html +2 -2
- data/docs/doc/Doing/ItemQuery.html +2 -2
- data/docs/doc/Doing/ItemState.html +2 -2
- data/docs/doc/Doing/ItemTags.html +2 -2
- data/docs/doc/Doing/Items.html +2 -2
- data/docs/doc/Doing/JSONExport.html +2 -2
- data/docs/doc/Doing/JSONImport.html +2 -2
- data/docs/doc/Doing/Logger.html +15 -15
- data/docs/doc/Doing/MarkdownExport.html +2 -2
- data/docs/doc/Doing/Note.html +2 -2
- data/docs/doc/Doing/Pager.html +2 -2
- data/docs/doc/Doing/Plugins.html +2 -2
- data/docs/doc/Doing/Prompt.html +2 -2
- data/docs/doc/Doing/PromptChoose.html +2 -2
- data/docs/doc/Doing/PromptFZF.html +2 -2
- data/docs/doc/Doing/PromptInput.html +2 -2
- data/docs/doc/Doing/PromptSTD.html +2 -2
- data/docs/doc/Doing/PromptYN.html +2 -2
- data/docs/doc/Doing/Section.html +2 -2
- data/docs/doc/Doing/StringHighlight.html +2 -2
- data/docs/doc/Doing/StringNormalize.html +2 -2
- data/docs/doc/Doing/StringQuery.html +2 -2
- data/docs/doc/Doing/StringTags.html +2 -2
- data/docs/doc/Doing/StringTransform.html +2 -2
- data/docs/doc/Doing/StringTruncate.html +2 -2
- data/docs/doc/Doing/StringURL.html +2 -2
- data/docs/doc/Doing/SymbolNormalize.html +2 -2
- data/docs/doc/Doing/TaskPaperExport.html +2 -2
- data/docs/doc/Doing/TemplateExport.html +2 -2
- data/docs/doc/Doing/TemplateString.html +2 -2
- data/docs/doc/Doing/TimingImport.html +2 -2
- data/docs/doc/Doing/Types.html +2 -2
- data/docs/doc/Doing/Util/Backup.html +2 -2
- data/docs/doc/Doing/Util.html +2 -2
- data/docs/doc/Doing/Version.html +2 -2
- data/docs/doc/Doing/WWID.html +2 -2
- data/docs/doc/Doing.html +3 -3
- data/docs/doc/FalseClass.html +2 -2
- data/docs/doc/GLI/Commands/Help.html +2 -2
- data/docs/doc/GLI/Commands/MarkdownDocumentListener.html +2 -2
- data/docs/doc/GLI/Commands.html +2 -2
- data/docs/doc/GLI.html +2 -2
- data/docs/doc/Hash.html +2 -2
- data/docs/doc/Numeric.html +2 -2
- data/docs/doc/Object.html +2 -2
- data/docs/doc/PhraseParser/Operator.html +12 -2
- data/docs/doc/PhraseParser/PhraseClause.html +3 -3
- data/docs/doc/PhraseParser/Query.html +2 -2
- data/docs/doc/PhraseParser/QueryParser.html +18 -2
- data/docs/doc/PhraseParser/QueryTransformer.html +12 -2
- data/docs/doc/PhraseParser/TermClause.html +12 -2
- data/docs/doc/PhraseParser.html +2 -2
- data/docs/doc/Status.html +2 -2
- data/docs/doc/String.html +2 -2
- data/docs/doc/Symbol.html +2 -2
- data/docs/doc/Time.html +2 -2
- data/docs/doc/TrueClass.html +2 -2
- data/docs/doc/_index.html +2 -2
- data/docs/doc/file.README.html +3 -3
- data/docs/doc/index.html +3 -3
- data/docs/doc/top-level-namespace.html +2 -2
- data/doing.gemspec +8 -5
- data/doing.rdoc +1 -1
- data/lib/doing/phrase_parser.rb +10 -22
- data/lib/doing/version.rb +1 -1
- data/lib/doing.rb +0 -1
- metadata +79 -6
data/lib/doing/phrase_parser.rb
CHANGED
@@ -7,6 +7,8 @@ module PhraseParser
|
|
7
7
|
# terms. This is done creating multiple types of clauses instead of just one.
|
8
8
|
# A phrase clause generates an Elasticsearch match_phrase query.
|
9
9
|
class QueryParser < Parslet::Parser
|
10
|
+
CLAUSE_TYPES = %i[should must must_not].freeze
|
11
|
+
|
10
12
|
rule(:term) { match('[^\s"]').repeat(1).as(:term) }
|
11
13
|
rule(:quote) { str('"') }
|
12
14
|
rule(:operator) { (str('+') | str('-')).as(:operator) }
|
@@ -19,8 +21,9 @@ module PhraseParser
|
|
19
21
|
root(:query)
|
20
22
|
end
|
21
23
|
|
24
|
+
# Transforms the parsed query into a Query object
|
22
25
|
class QueryTransformer < Parslet::Transform
|
23
|
-
rule(:
|
26
|
+
rule(clause: subtree(:clause)) do
|
24
27
|
if clause[:term]
|
25
28
|
TermClause.new(clause[:operator]&.to_s, clause[:term].to_s)
|
26
29
|
elsif clause[:phrase]
|
@@ -33,6 +36,7 @@ module PhraseParser
|
|
33
36
|
rule(query: sequence(:clauses)) { Query.new(clauses) }
|
34
37
|
end
|
35
38
|
|
39
|
+
# Represents an operator
|
36
40
|
class Operator
|
37
41
|
def self.symbol(str)
|
38
42
|
case str
|
@@ -48,6 +52,7 @@ module PhraseParser
|
|
48
52
|
end
|
49
53
|
end
|
50
54
|
|
55
|
+
# Represents a term clause
|
51
56
|
class TermClause
|
52
57
|
attr_accessor :operator, :term
|
53
58
|
|
@@ -57,7 +62,7 @@ module PhraseParser
|
|
57
62
|
end
|
58
63
|
end
|
59
64
|
|
60
|
-
#
|
65
|
+
# Represents a phrase clause
|
61
66
|
class PhraseClause
|
62
67
|
attr_accessor :operator, :phrase
|
63
68
|
|
@@ -79,27 +84,10 @@ module PhraseParser
|
|
79
84
|
end
|
80
85
|
|
81
86
|
def to_elasticsearch
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
query[:should] = should_clauses.map do |clause|
|
86
|
-
clause_to_query(clause)
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
if must_clauses.any?
|
91
|
-
query[:must] = must_clauses.map do |clause|
|
92
|
-
clause_to_query(clause)
|
93
|
-
end
|
87
|
+
QueryParser::CLAUSE_TYPES.each_with_object({}) do |type, query|
|
88
|
+
clauses = instance_variable_get("@#{type}_clauses")
|
89
|
+
query[type] = clauses.map { |clause| clause_to_query(clause) } if clauses&.any?
|
94
90
|
end
|
95
|
-
|
96
|
-
if must_not_clauses.any?
|
97
|
-
query[:must_not] = must_not_clauses.map do |clause|
|
98
|
-
clause_to_query(clause)
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
query
|
103
91
|
end
|
104
92
|
|
105
93
|
def clause_to_query(clause)
|
data/lib/doing/version.rb
CHANGED
data/lib/doing.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
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.88
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-12 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: github-markup
|
@@ -158,6 +157,20 @@ dependencies:
|
|
158
157
|
- - ">="
|
159
158
|
- !ruby/object:Gem::Version
|
160
159
|
version: 0.9.36
|
160
|
+
- !ruby/object:Gem::Dependency
|
161
|
+
name: base64
|
162
|
+
requirement: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.2'
|
167
|
+
type: :runtime
|
168
|
+
prerelease: false
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0.2'
|
161
174
|
- !ruby/object:Gem::Dependency
|
162
175
|
name: chronic
|
163
176
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,6 +191,20 @@ dependencies:
|
|
178
191
|
- - ">="
|
179
192
|
- !ruby/object:Gem::Version
|
180
193
|
version: 0.10.2
|
194
|
+
- !ruby/object:Gem::Dependency
|
195
|
+
name: csv
|
196
|
+
requirement: !ruby/object:Gem::Requirement
|
197
|
+
requirements:
|
198
|
+
- - "~>"
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: '3.3'
|
201
|
+
type: :runtime
|
202
|
+
prerelease: false
|
203
|
+
version_requirements: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - "~>"
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '3.3'
|
181
208
|
- !ruby/object:Gem::Dependency
|
182
209
|
name: deep_merge
|
183
210
|
requirement: !ruby/object:Gem::Requirement
|
@@ -238,6 +265,40 @@ dependencies:
|
|
238
265
|
- - ">="
|
239
266
|
- !ruby/object:Gem::Version
|
240
267
|
version: 5.0.0
|
268
|
+
- !ruby/object:Gem::Dependency
|
269
|
+
name: logger
|
270
|
+
requirement: !ruby/object:Gem::Requirement
|
271
|
+
requirements:
|
272
|
+
- - "~>"
|
273
|
+
- !ruby/object:Gem::Version
|
274
|
+
version: '1.4'
|
275
|
+
- - ">="
|
276
|
+
- !ruby/object:Gem::Version
|
277
|
+
version: 1.4.2
|
278
|
+
type: :runtime
|
279
|
+
prerelease: false
|
280
|
+
version_requirements: !ruby/object:Gem::Requirement
|
281
|
+
requirements:
|
282
|
+
- - "~>"
|
283
|
+
- !ruby/object:Gem::Version
|
284
|
+
version: '1.4'
|
285
|
+
- - ">="
|
286
|
+
- !ruby/object:Gem::Version
|
287
|
+
version: 1.4.2
|
288
|
+
- !ruby/object:Gem::Dependency
|
289
|
+
name: ostruct
|
290
|
+
requirement: !ruby/object:Gem::Requirement
|
291
|
+
requirements:
|
292
|
+
- - "~>"
|
293
|
+
- !ruby/object:Gem::Version
|
294
|
+
version: '0.6'
|
295
|
+
type: :runtime
|
296
|
+
prerelease: false
|
297
|
+
version_requirements: !ruby/object:Gem::Requirement
|
298
|
+
requirements:
|
299
|
+
- - "~>"
|
300
|
+
- !ruby/object:Gem::Version
|
301
|
+
version: '0.6'
|
241
302
|
- !ruby/object:Gem::Dependency
|
242
303
|
name: parslet
|
243
304
|
requirement: !ruby/object:Gem::Requirement
|
@@ -278,6 +339,20 @@ dependencies:
|
|
278
339
|
- - ">="
|
279
340
|
- !ruby/object:Gem::Version
|
280
341
|
version: 3.6.0
|
342
|
+
- !ruby/object:Gem::Dependency
|
343
|
+
name: reline
|
344
|
+
requirement: !ruby/object:Gem::Requirement
|
345
|
+
requirements:
|
346
|
+
- - "~>"
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: '0.6'
|
349
|
+
type: :runtime
|
350
|
+
prerelease: false
|
351
|
+
version_requirements: !ruby/object:Gem::Requirement
|
352
|
+
requirements:
|
353
|
+
- - "~>"
|
354
|
+
- !ruby/object:Gem::Version
|
355
|
+
version: '0.6'
|
281
356
|
- !ruby/object:Gem::Dependency
|
282
357
|
name: safe_yaml
|
283
358
|
requirement: !ruby/object:Gem::Requirement
|
@@ -845,7 +920,6 @@ homepage: http://brettterpstra.com/project/doing/
|
|
845
920
|
licenses:
|
846
921
|
- MIT
|
847
922
|
metadata: {}
|
848
|
-
post_install_message:
|
849
923
|
rdoc_options:
|
850
924
|
- "--title"
|
851
925
|
- doing
|
@@ -867,8 +941,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
867
941
|
- !ruby/object:Gem::Version
|
868
942
|
version: '0'
|
869
943
|
requirements: []
|
870
|
-
rubygems_version: 3.
|
871
|
-
signing_key:
|
944
|
+
rubygems_version: 3.6.2
|
872
945
|
specification_version: 4
|
873
946
|
summary: A command line tool for managing What Was I Doing reminders
|
874
947
|
test_files: []
|